go-openai
go-openai copied to clipboard
Add additional method to pass pagination options to Files/List requests
Describe the change This adds an additional function to pass through arguments for the Files List endpoint. I did this in preference of breaking the existing function - but if you feel that's worth doing we can easily change this to be a breaking change!
These arguments let you paginate through large file lists (as there is a limit of 10k per response). Without this change this client doesn't let you paginate through your files, which we would love to do!
The arguments to List files follows the same pattern as the other endpoints and accepts a limit, start id, and order.
The API returns has_more if there are more entries along with the start and end id.
Provide OpenAI documentation link
This doesn't seem to be in the current documentation here: https://platform.openai.com/docs/api-reference/files/list However this does seem to be the behaviour and it matches other endpoints.
Describe your solution Describe how your changes address the problem or how they add the feature. This should include a brief description of your approach and any new libraries or dependencies you're using.
Tests I added an additional test for this method - but tbh it's not doing a whole lot.