community[patch]: chat model mypy fixes (#17061)

Related to #17048
This commit is contained in:
Bagatur
2024-02-05 13:42:59 -08:00
committed by GitHub
parent d93de71d08
commit 66e45e8ab7
17 changed files with 101 additions and 89 deletions

View File

@@ -13,6 +13,7 @@ from typing import (
Mapping,
Optional,
Union,
cast,
)
from langchain_core.callbacks import (
@@ -197,7 +198,7 @@ class ChatTongyi(BaseChatModel):
return {
"model": self.model_name,
"top_p": self.top_p,
"api_key": self.dashscope_api_key.get_secret_value(), # type: ignore[union-attr]
"api_key": cast(SecretStr, self.dashscope_api_key).get_secret_value(),
"result_format": "message",
**self.model_kwargs,
}