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

Handle max batch size for embeddings. #83

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

MarkDaoust
Copy link
Collaborator

The API has a max batch size of 100.

Break the list of texts into batches and make multiple calls to respect the max size.

@MarkDaoust MarkDaoust requested a review from a team as a code owner October 13, 2023 20:42
@github-actions github-actions bot added the status:awaiting review PR awaiting review from a maintainer label Oct 13, 2023
@keertk keertk added component:python sdk Issue/PR related to Python SDK subcategory:python api labels Oct 16, 2023
markmcd
markmcd previously approved these changes Oct 17, 2023
google/generativeai/text.py Show resolved Hide resolved
google/generativeai/text.py Show resolved Hide resolved
@MarkDaoust MarkDaoust merged commit 0d8d339 into google-gemini:main Oct 19, 2023
6 checks passed
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Oct 19, 2023
markmcd pushed a commit to markmcd/generative-ai-python that referenced this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants