Add additional method to pass pagination options to Files/List requests #918
+47
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.