mirror of
https://github.com/hwchase17/langchain.git
synced 2026-05-17 04:45:11 +00:00
fix(core): use non-string cast to fix mypy no-any-return in create_schema_from_function
This commit is contained in:
@@ -247,7 +247,7 @@ def create_schema_from_function(
|
||||
for param_name, param in sig.parameters.items():
|
||||
resolved = type_hints.get(param_name, param.annotation)
|
||||
if not include_injected and _is_injected_arg_type(resolved):
|
||||
filter_args_.append(param_name) # type: ignore[union-attr]
|
||||
filter_args_.append(param_name)
|
||||
|
||||
description, arg_descriptions = _infer_arg_descriptions(
|
||||
func,
|
||||
@@ -318,7 +318,7 @@ def create_schema_from_function(
|
||||
**field_definitions,
|
||||
)
|
||||
model.__doc__ = textwrap.dedent(description or func.__doc__ or "")
|
||||
return model
|
||||
return cast(type[BaseModel], model)
|
||||
|
||||
|
||||
class ToolException(Exception): # noqa: N818
|
||||
|
||||
Reference in New Issue
Block a user