Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional method to pass pagination options to Files/List requests #918

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rliddler
Copy link

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.

List files follows the same pattern as the other endpoints and accepts a
limit, start id, and order.

It returns has_more if there are more entries along with the start and
end id.

This doesn't seem to be in the current documentation here:
https://platform.openai.com/docs/api-reference/files/list

However this is the behaviour and it matches other endpoints.

Without this change this client doesn't let you paginate through your
files, which we would love to do!
@rliddler rliddler force-pushed the add-options-to-list-files-request branch from 263a69b to a7be8b8 Compare December 30, 2024 13:41
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.70%. Comparing base (774fc9d) to head (a7be8b8).
Report is 78 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #918      +/-   ##
==========================================
+ Coverage   98.46%   98.70%   +0.24%     
==========================================
  Files          24       26       +2     
  Lines        1364     1778     +414     
==========================================
+ Hits         1343     1755     +412     
- Misses         15       16       +1     
- Partials        6        7       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant