alexrudall / ruby-openai

OpenAI API + Ruby! 🤖❤️ NEW: Assistant Vector Stores
MIT License
2.61k stars 302 forks source link

batches.list is missing after/limit query parameters support + README inaccuracy regarding batches #490

Closed marckohlbrugge closed 2 weeks ago

marckohlbrugge commented 1 month ago

https://github.com/alexrudall/ruby-openai/blob/8eb793e5482feef1adf97854d615d151f226a6d6/lib/openai/batches.rb#L1-L23

Is missing support for the after and limit parameters described here:

after string Optional A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

limit integer Optional Defaults to 20 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

API Reference


In addition, the README incorrectly states that Batches are only available for completions, while embeddings are also supported.

README:

https://github.com/alexrudall/ruby-openai/blob/8eb793e5482feef1adf97854d615d151f226a6d6/README.md?plain=1#L501

OpenAI Docs:

Batches start with a .jsonl file where each line contains the details of an individual request to the API. For now, the available endpoints are /v1/chat/completions (Chat Completions API) and /v1/embeddings (Embeddings API).

Source: https://platform.openai.com/docs/guides/batch/1-preparing-your-batch-file