-
Notifications
You must be signed in to change notification settings - Fork 267
feat(go/plugins/googlegenai)!: use go-genai
SDK configuration
#2958
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
go-genai
SDK configuration
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.
We were also going to add errors if certain config fields were set that are native Genkit features, no?
go/plugins/googlegenai/gemini.go
Outdated
@@ -39,6 +40,9 @@ import ( | |||
"google.golang.org/genai" | |||
) | |||
|
|||
// Plugin configuration alias | |||
type GeminiConfig = genai.GenerateContentConfig |
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 let's omit this for now because we would probably want aliases for all the types, not just the top level... at which point I'm not sure it's worth it.
|
||
// Genkit primitive fields must be used instead of go-genai fields | ||
// i.e.: system prompt, tools, cached content, response schema, etc | ||
if gcc.SystemInstruction != nil { |
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.
@apascal07, here's where we validate the user request message do not set Genkit native features. I've added:
- System prompts
- Tools (just for function declaration tools, but kept the ability to support Code Execution, Google Search and so on)
- Cached contents
- Response schema
- Response mime type
f34a722
to
2202be9
Compare
Remove the usage of
googlegenai.GeminiConfig
and usegenai.GenerateContentConfig
insteadChecklist (if applicable):