-
Notifications
You must be signed in to change notification settings - Fork 133
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: add custom params to VertexAIGeminiGenerator and VertexAIGeminiChatGenerator #1100
Conversation
self._model = GenerativeModel( | ||
self._model_name, | ||
generation_config=self._generation_config, | ||
safety_settings=self._safety_settings, | ||
tools=self._tools, | ||
tool_config=self._tool_config, | ||
system_instruction=self._system_instruction, |
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.
Initially, we were passing tools
and other parameters directly in the generate_content
method. However, these can be passed during model initialization instead, which simplifies parameter handling. See the reference here. This approach simplifies the API's requirement that system_instruction
can only be passed during model initialization.
...s/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py
Show resolved
Hide resolved
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.
Looks quite good to me already. There is one if/else that we can simplify in Generator and ChatGenerator.
...s/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py
Show resolved
Hide resolved
...s/google_vertex/src/haystack_integrations/components/generators/google_vertex/chat/gemini.py
Outdated
Show resolved
Hide resolved
...ations/google_vertex/src/haystack_integrations/components/generators/google_vertex/gemini.py
Outdated
Show resolved
Hide resolved
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.
LGTM! 👍
…ChatGenerator (#1100) * Added "tool_config" and "system_instruction" params
Related Issues
Proposed Changes:
tool_config
andsystem_instruction
parameters to be passed to the model.GenerativeModel
(marked in comments).How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.