refactor: Update BaiduQianfanChatModel.py to use type hinting for return value
This commit is contained in:
parent
7eeb6ea78a
commit
1391d5ef09
1 changed files with 3 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
from langchain_community.chat_models.baidu_qianfan_endpoint import QianfanChatEndpoint
|
from langchain_community.chat_models.baidu_qianfan_endpoint import QianfanChatEndpoint
|
||||||
from pydantic.v1 import SecretStr
|
from pydantic.v1 import SecretStr
|
||||||
|
|
||||||
|
|
@ -111,4 +113,4 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ValueError("Could not connect to Baidu Qianfan API.") from e
|
raise ValueError("Could not connect to Baidu Qianfan API.") from e
|
||||||
|
|
||||||
return output
|
return cast(LanguageModel, output)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue