|
|
@ -103,7 +103,7 @@ class QianfanChatEndpoint(BaseChatModel):
|
|
|
|
streaming: Optional[bool] = False
|
|
|
|
streaming: Optional[bool] = False
|
|
|
|
"""Whether to stream the results or not."""
|
|
|
|
"""Whether to stream the results or not."""
|
|
|
|
|
|
|
|
|
|
|
|
request_timeout: Optional[int] = 60
|
|
|
|
request_timeout: Optional[int] = Field(60, alias="timeout")
|
|
|
|
"""request timeout for chat http requests"""
|
|
|
|
"""request timeout for chat http requests"""
|
|
|
|
|
|
|
|
|
|
|
|
top_p: Optional[float] = 0.8
|
|
|
|
top_p: Optional[float] = 0.8
|
|
|
@ -125,6 +125,11 @@ class QianfanChatEndpoint(BaseChatModel):
|
|
|
|
endpoint: Optional[str] = None
|
|
|
|
endpoint: Optional[str] = None
|
|
|
|
"""Endpoint of the Qianfan LLM, required if custom model used."""
|
|
|
|
"""Endpoint of the Qianfan LLM, required if custom model used."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
|
|
|
|
"""Configuration for this pydantic object."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allow_population_by_field_name = True
|
|
|
|
|
|
|
|
|
|
|
|
@root_validator()
|
|
|
|
@root_validator()
|
|
|
|
def validate_environment(cls, values: Dict) -> Dict:
|
|
|
|
def validate_environment(cls, values: Dict) -> Dict:
|
|
|
|
values["qianfan_ak"] = convert_to_secret_str(
|
|
|
|
values["qianfan_ak"] = convert_to_secret_str(
|
|
|
|