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

google-common [major] / google-webauth [minor] / google-gauth [minor]: Gemini functions #4864

Merged
merged 48 commits into from
Mar 27, 2024

Conversation

afirstenberg
Copy link
Contributor

@afirstenberg afirstenberg commented Mar 24, 2024

Adds support for function calling through langchain tools.
Adds support for bind().
Adjust testing, since AI Studio has gotten more strict.

Tested with AI Studio and Vertex AI. (Note this does not change the google-genai package.)

Missing:

  • Support for withStructuredOutput() (@jacoblee93 says he will handle)
  • Documentation

Fixes #4253

New exports:

@langchain/google-*/{types,utils}

  • I opted to export from separate entrypoints because if I exported all types/utils from the root entrypoint of common then we would be stuck with two bad options:
  1. individually import & re-export modules inside packages like gauth/vertexai, etc so we aren't also exporting all the base classes from common. This means we will also need to remember to update the exports & cut releases for all these packages when a new type/util is added that we want to export.
  2. re-export everything, including base classes. This would confuse users as they'd see ChatGoogle, ChatVertexAI, etc, etc in IDE autocompletes when looking at exports from, for example @langchain/google-vertexai
  • Added a new util zodToGeminiParameters since the google function definition does not cleanly allow for passing the result of zodToJsonSchema into the parameters field of a function.

Copy link

vercel bot commented Mar 24, 2024

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

Name Status Preview Comments Updated (UTC)
langchainjs-api-refs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2024 4:08pm
langchainjs-docs ✅ Ready (Inspect) Visit Preview Mar 27, 2024 4:08pm

@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. auto:improvement Medium size change to existing code to handle new use-cases labels Mar 24, 2024
@@ -39,7 +39,9 @@
"author": "LangChain",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! 👋 I noticed that this PR adds new dependencies to the "dependencies" section, which might impact the project's peer/dev/hard dependencies. I've flagged this for the maintainers to review. Keep up the great work!

@jacoblee93
Copy link
Collaborator

Thanks both of you! Mostly nits, and looks like build is also failing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto:improvement Medium size change to existing code to handle new use-cases size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Google Gemini Vertex AI Function Calling
3 participants