openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.7k stars 483 forks source link

Multiple inputs to Embeddings resource? #171

Closed farez closed 1 year ago

farez commented 1 year ago

Hi!

Is there a way to specify multiple inputs to the Embeddings resource? I tried passing an array as input but that returned:

'$.input' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.

According to OpenAI's doc:

To embed multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed the max input tokens for the model (8191 tokens for text-embedding-ada-002)

Thanks.

farez commented 1 year ago

Please ignore this. It was just a badly formatted input. My bad.