-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat (provider/google-vertex): Add support for edge runtime. #3908
base: main
Are you sure you want to change the base?
Conversation
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@google-cloud/[email protected] |
6715320
to
4b9ee6f
Compare
packages/google-vertex/src/google-vertex-auth-google-auth-library.ts
Outdated
Show resolved
Hide resolved
packages/google-vertex/src/google-vertex-auth-google-auth-library.ts
Outdated
Show resolved
Hide resolved
packages/google/src/google-generative-ai-language-model.test.ts
Outdated
Show resolved
Hide resolved
@@ -40,6 +40,7 @@ Optional. A list of unique safety settings for blocking unsafe content. | |||
*/ | |||
safetySettings?: Array<{ | |||
category: | |||
| 'HARM_CATEGORY_UNSPECIFIED' |
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.
are these harm categories the same in vertex & genai? i vaguely remember differences.
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.
The only difference I see is for the older PaLM models. Here is my understanding:
GenAI Harm Categories
Vertex Harm Categories
The PaLM entries in the GenAI link are missing:
HARM_CATEGORY_DEROGATORY | PaLM - Negative or harmful comments targeting identity and/or protected attribute.
HARM_CATEGORY_TOXICITY | PaLM - Content that is rude, disrespectful, or profane.
HARM_CATEGORY_VIOLENCE | PaLM - Describes scenarios depicting violence against an individual or group, or general descriptions of gore.
HARM_CATEGORY_SEXUAL | PaLM - Contains references to sexual acts or other lewd content.
HARM_CATEGORY_MEDICAL | PaLM - Promotes unchecked medical advice.
HARM_CATEGORY_DANGEROUS | PaLM - Dangerous content that promotes, facilitates, or encourages harmful acts.
I assume these have been updated over time. Based on the current specs linked above, my take is that this PR is newly updated to reflect the latest, and the only consideration is whether to add the PaLM entries:
- we were missing the
HARM_CATEGORY_UNSPECIFIED
in GenAI but they are relevant there - we were missing
HARM_CATEGORY_CIVIC_INTEGRITY
in both GenAI and Vertex, and it's relevant in both - we were missing the PaLM entries above in both. GenAI spec has the PaLM entries and Vertex doesn't
- https://ai.google.dev/palm_docs notes "Warning: The PaLM API is decomissioned. The Vertex AI PaLM API is scheduled to be decomissioned in October 2024. Please upgrade to the Gemini API. Learn more about this in the PaLM API deprecation guide."
It is not clear to me that the PaLM models are a forward-going concern, so I would personally omit them for now.
Needs docs update (showing how to use different auth solutions) and changeset (works on edge now). |
5d111be
to
f380aca
Compare
c1b2f7b
to
2f30d44
Compare
- vertex: peer deps for google, google-auth-library - vertex: don't export experimental auth token fns - vertex: no need for "module" export for './internal' - vertex: revise edge-compatible auth (buffer, file creds) - vertex: provider incorporates user option for generateAuthToken - vertex: update export symbol for edge-compatible auth token generation fn - google: 'content' in response schema optional for safety failure parsing
2f30d44
to
8a9137c
Compare
8a9137c
to
d2ebc4c
Compare
f7f8334
to
0d0e566
Compare
0d0e566
to
e9ae5cf
Compare
No description provided.