Skip to content

Conversation

@tamirh
Copy link

@tamirh tamirh commented Oct 28, 2025

Description

Feature Request: #3732

Adding in a way to define safety restrictions on Google LLM via the constructor params

Changes

Take safety_settings list/dict and pass it on to the LLMStream via _extra_kwargs.

Note: Also added doc line for missing doc on seed param

@CLAassistant
Copy link

CLAassistant commented Oct 28, 2025

CLA assistant check
All committers have signed the CLA.

gemini_tools: NotGivenOr[list[_LLMTool]] = NOT_GIVEN,
http_options: NotGivenOr[types.HttpOptions] = NOT_GIVEN,
seed: NotGivenOr[int] = NOT_GIVEN,
safety_settings: NotGivenOr[list[types.SafetySettingOrDict] | dict[str, str]] = NOT_GIVEN,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be best to only accept SafetySettingOrDict types for this parameter. If you want to support accepting dict[str, str] then you would need to cast it to SafetySetting anyway to pass to GenerateContentConfig

Suggested change
safety_settings: NotGivenOr[list[types.SafetySettingOrDict] | dict[str, str]] = NOT_GIVEN,
safety_settings: NotGivenOr[list[types.SafetySettingOrDict]] = NOT_GIVEN,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants