Share via


GoogleSearchSettings Class

Google Search Connector settings.

The settings are first loaded from environment variables with the prefix '>>GOOGLE_<<'. If the environment variables are not found, the settings can be loaded from a .env file with the encoding 'utf-8'. If the settings are not found in the .env file, the settings are ignored; however, validation will fail alerting that the settings are missing.

Required settings for prefix '>>GOOGLE_<<' are:

  • search_api_key: SecretStr - The Google Search API key (Env var GOOGLE_API_KEY)

Optional settings for prefix '>>GOOGLE_<<' are:

  • search_engine_id: str - The Google search engine ID (Env var GOOGLE_SEARCH_ENGINE_ID)
  • env_file_path: str | None - if provided, the .env settings are read from this file path location
  • env_file_encoding: str - if provided, the .env file encoding used. Defaults to "utf-8".

Constructor

GoogleSearchSettings(_case_sensitive: bool | None = None, _nested_model_default_partial_update: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_ignore_empty: bool | None = None, _env_nested_delimiter: str | None = None, _env_parse_none_str: str | None = None, _env_parse_enums: bool | None = None, _cli_prog_name: str | None = None, _cli_parse_args: bool | list[str] | tuple[str, ...] | None = None, _cli_settings_source: CliSettingsSource[Any] | None = None, _cli_parse_none_str: str | None = None, _cli_hide_none_type: bool | None = None, _cli_avoid_json: bool | None = None, _cli_enforce_required: bool | None = None, _cli_use_class_docs_for_groups: bool | None = None, _cli_exit_on_error: bool | None = None, _cli_prefix: str | None = None, _cli_implicit_flags: bool | None = None, _secrets_dir: PathType | None = None, *, env_file_path: str | None = None, env_file_encoding: str = 'utf-8', search_api_key: SecretStr, search_engine_id: str | None = None)

Parameters

Name Description
_case_sensitive
Default value: None
_nested_model_default_partial_update
Default value: None
_env_prefix
Default value: None
_env_file
Default value: .
_env_file_encoding
Default value: None
_env_ignore_empty
Default value: None
_env_nested_delimiter
Default value: None
_env_parse_none_str
Default value: None
_env_parse_enums
Default value: None
_cli_prog_name
Default value: None
_cli_parse_args
Default value: None
_cli_settings_source
Default value: None
_cli_parse_none_str
Default value: None
_cli_hide_none_type
Default value: None
_cli_avoid_json
Default value: None
_cli_enforce_required
Default value: None
_cli_use_class_docs_for_groups
Default value: None
_cli_exit_on_error
Default value: None
_cli_prefix
Default value: None
_cli_implicit_flags
Default value: None
_secrets_dir
Default value: None

Keyword-Only Parameters

Name Description
env_file_path
Required
env_file_encoding
Default value: utf-8
search_api_key
Required
search_engine_id
Required

Attributes

env_prefix

env_prefix: ClassVar[str] = 'GOOGLE_'

search_api_key

search_api_key: SecretStr

search_engine_id

search_engine_id: str | None