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

fix(google-genai): Update fileData & inlineData to kebab case as per REST API requirements #7631

Closed
wants to merge 1 commit into from

Conversation

hongkongkiwi
Copy link
Contributor

Google Gemini HTTP API (which is what we are using in this module) actually requires file_data and inline_data to be in kebab case. This is different to the SDKs which use Snake case.

It is possible to use Snake case for some things but with mixed results (e.g. inlineData works, but fileData does not), however officially both should be kebab (see Shell docs): https://ai.google.dev/api/files and have been tested working.

Previously, I had contributed a fix which added the fileData #7621 , but it was using snake case which is wrong and didn't actually work consistently.

So this fix converts both inline_data and file_data to kebab case, which is what the HTTP API wants. Google docs are sparse, but REST/Shell examples always show kebab case for these fields.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 30, 2025
Copy link

vercel bot commented Jan 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview Jan 30, 2025 4:34pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ⬜️ Ignored (Inspect) Jan 30, 2025 4:34pm

@dosubot dosubot bot added the auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs label Jan 30, 2025
@hongkongkiwi hongkongkiwi changed the title Update fileData & inlineData to kebab case as per REST API requirements fix(google-genai): Update fileData & inlineData to kebab case as per REST API requirements Jan 30, 2025
Google Gemini HTTP API requires file_data and inline_data to be in kebab case. This is different to the SDKs which use Snake case.

It is possible to use Snake case but with mixed results (e.g. inlineData works, but fileData does not), however officially both should be kebab (see Shell docs): https://ai.google.dev/api/files and have been tested working.
@hongkongkiwi
Copy link
Contributor Author

Although this works, I misunderstood that we do actually use the official sdk client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant