Skip to content

Commit ad1f8d6

Browse files
authored
feat(genai): add aliases for timeout and max_retries (#1175)
`retries` is now an alias for `max_retries` and `request_timeout` is an alias for `timeout`.
1 parent 0b42534 commit ad1f8d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/genai/langchain_google_genai/_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ class _BaseGoogleGenerativeAI(BaseModel):
5858
"""Number of chat completions to generate for each prompt. Note that the API may
5959
not return the full ``n`` completions if duplicates are generated."""
6060

61-
max_retries: int = 6
61+
max_retries: int = Field(default=6, alias="retries")
6262
"""The maximum number of retries to make when generating. If unset, will default
6363
to ``6``."""
6464

65-
timeout: Optional[float] = None
65+
timeout: Optional[float] = Field(default=None, alias="request_timeout")
6666
"""The maximum number of seconds to wait for a response."""
6767

6868
client_options: Optional[Dict] = Field(

0 commit comments

Comments
 (0)