mirror of
https://github.com/microsoft/autogen.git
synced 2026-05-13 03:00:55 -04:00
replace assertion with valueerror (#3974)
Co-authored-by: Leonardo Pinheiro <lpinheiro@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
3fe0f9e97d
commit
a626d7cf18
@@ -46,5 +46,6 @@ class FunctionTool(BaseTool[BaseModel, BaseModel]):
|
||||
cancellation_token.link_future(future)
|
||||
result = await future
|
||||
|
||||
assert isinstance(result, self.return_type())
|
||||
if not isinstance(result, self.return_type()):
|
||||
raise ValueError(f"Expected return type {self.return_type()}, got {type(result)}")
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user