Revert "integrations[patch]: remove non-required chat param defaults" (#29048)

Reverts langchain-ai/langchain#26730

discuss best way to release default changes (esp openai temperature)
This commit is contained in:
Erick Friis
2025-01-06 14:45:34 -08:00
committed by GitHub
parent 3d7ae8b5d2
commit 187131c55c
15 changed files with 43 additions and 51 deletions

View File

@@ -95,11 +95,8 @@ def _create_retry_decorator(
"""Returns a tenacity retry decorator, preconfigured to handle exceptions"""
errors = [httpx.RequestError, httpx.StreamError]
kwargs: dict = dict(
error_types=errors, max_retries=llm.max_retries, run_manager=run_manager
)
return create_base_retry_decorator(
**{k: v for k, v in kwargs.items() if v is not None}
error_types=errors, max_retries=llm.max_retries, run_manager=run_manager
)
@@ -383,13 +380,13 @@ class ChatMistralAI(BaseChatModel):
default_factory=secret_from_env("MISTRAL_API_KEY", default=None),
)
endpoint: Optional[str] = Field(default=None, alias="base_url")
max_retries: Optional[int] = None
timeout: Optional[int] = None
max_concurrent_requests: Optional[int] = None
max_retries: int = 5
timeout: int = 120
max_concurrent_requests: int = 64
model: str = Field(default="mistral-small", alias="model_name")
temperature: Optional[float] = None
temperature: float = 0.7
max_tokens: Optional[int] = None
top_p: Optional[float] = None
top_p: float = 1
"""Decode using nucleus sampling: consider the smallest set of tokens whose
probability sum is at least top_p. Must be in the closed interval [0.0, 1.0]."""
random_seed: Optional[int] = None