-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat: Support Custom Metadata Labels on Vertex AI #8207
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Yu Ishikawa <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@afirstenberg any thoughts on this? |
Signed-off-by: Yu Ishikawa <[email protected]>
5a5a5c3
to
1e54054
Compare
Signed-off-by: Yu Ishikawa <[email protected]>
…pport-vertexai-labels Signed-off-by: Yu Ishikawa <[email protected]>
@@ -1594,6 +1594,7 @@ export function getGeminiAPI(config?: GeminiAPIConfig): GoogleAIAPI { | |||
const ret: GeminiRequest = { | |||
contents, | |||
generationConfig, | |||
labels: parameters.labels, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ok, but would like to see a test to confirm it doesn't show up if not specified.
Thanks for the PR! I hadn't seen this in the Vertex docs before, but it does look useful. Overall, this looks good to me. One comment about making sure the labels aren't included if not set. We should run a test to see if it works on AI Studio, tho it doesn't look it from the discovery doc. I don't think we need to explicitly handle that case, however. I'd rather see the tests integrated into the current test suite (particularly in google-common:chat_models.test.ts using one of the mocked responses and google-vertex/chat_models.int.test.ts) |
Signed-off-by: Yu Ishikawa <[email protected]>
Signed-off-by: Yu Ishikawa <[email protected]>
@afirstenberg Thank you for the feedback. I have updated the code. Can you review it again please? According to my research, the feature of custom metadata labels is currently supported only in Vertex AI. Gemini API doesn't have the feature at the moment. We can also implement the feature only in langchain-google-vertexai and langchain-google-vertexai-web. In that case, we need to implement the property in each. So, I implemented the property in langchain-google-common. |
Fixes # (issue) #8205
This is already supported in
langchain-google
. So, it would be great to support it inlangchainjs
as well.https://github.com/langchain-ai/langchain-google/blob/24ce2fd6aecf7e06c4f524a60e0bb1671e6516c2/libs/vertexai/langchain_google_vertexai/chat_models.py#L1184-L1186