Fix: Use Union instead of | to improve compatibility, fix #15244 (#15245)

This commit is contained in:
chyroc
2023-12-28 14:06:42 +08:00
committed by GitHub
parent 6a5a2fb9c8
commit 6fb3cc6f27
4 changed files with 10 additions and 10 deletions

View File

@@ -233,8 +233,8 @@ class GPTRouter(BaseChatModel):
self,
messages: List[BaseMessage],
stop: Optional[List[str]] = None,
run_manager: CallbackManagerForLLMRun | None = None,
stream: bool | None = None,
run_manager: Optional[CallbackManagerForLLMRun] = None,
stream: Optional[bool] = None,
**kwargs: Any,
) -> ChatResult:
should_stream = stream if stream is not None else self.streaming
@@ -259,8 +259,8 @@ class GPTRouter(BaseChatModel):
self,
messages: List[BaseMessage],
stop: Optional[List[str]] = None,
run_manager: AsyncCallbackManagerForLLMRun | None = None,
stream: bool | None = None,
run_manager: Optional[AsyncCallbackManagerForLLMRun] = None,
stream: Optional[bool] = None,
**kwargs: Any,
) -> ChatResult:
should_stream = stream if stream is not None else self.streaming