# Not possible to create a post request with more than 268 strings for create\_embeddings() of OpenAI.jl?

**URL:** https://discourse.julialang.org/t/not-possible-to-create-a-post-request-with-more-than-268-strings-for-create-embeddings-of-openai-jl/102985
**Category:** General Usage
**Tags:** package
**Created:** [August 19, 2023, 4:49pm UTC](https://discourse.julialang.org/t/not-possible-to-create-a-post-request-with-more-than-268-strings-for-create-embeddings-of-openai-jl/102985 "2023-08-19T16:49:26Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![algunion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/algunion/32/51630_2.png) [@algunion](https://discourse.julialang.org/u/algunion)
#### Post date: [August 19, 2023, 11:47pm UTC](https://discourse.julialang.org/t/not-possible-to-create-a-post-request-with-more-than-268-strings-for-create-embeddings-of-openai-jl/102985/2 "2023-08-19T23:47:51Z")

</div>

The culprit is that some of your string elements are empty (check index `horror_movies.overview[6]`, for example).

This should do the trick:

```julia
import Downloads
using CSV, DataFrames, OpenAI

horror_movies = CSV.read(Downloads.download("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2022/2022-11-01/horror_movies.csv"), DataFrame);

# 298 reviews after removing empties
input = filter(!isempty, horror_movies.overview[1:300])

r = create_embeddings(
    ENV["OPENAI_API_KEY"],
    input
)

```

---

_[View the full topic](https://discourse.julialang.org/t/not-possible-to-create-a-post-request-with-more-than-268-strings-for-create-embeddings-of-openai-jl/102985)._
