You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In FunctionTool init, when calling the function args_base_model_from_signature is does not return the name of the function, but the name of the last input. See below the current implementation of this function (from file python/packages/autogen-core/src/autogen_core/_function_utils.py) :
def args_base_model_from_signature(name: str, sig: inspect.Signature) -> Type[BaseModel]:
fields: Dict[str, tuple[Type[Any], Any]] = {}
for name, param in sig.parameters.items():
# This is handled externally
if name == "cancellation_token":
continue
if param.annotation is inspect.Parameter.empty:
raise ValueError("No annotation")
type = normalize_annotated_type(param.annotation)
description = type2description(name, param.annotation)
default_value = param.default if param.default is not inspect.Parameter.empty else PydanticUndefined
fields[name] = (type, Field(default=default_value, description=description))
return cast(BaseModel, create_model(name, **fields)) # type: ignore
In it, the param name is overwritten in the for loot. A correct implementation could look like :
def args_base_model_from_signature(name: str, sig: inspect.Signature) -> Type[BaseModel]:
fields: Dict[str, tuple[Type[Any], Any]] = {}
for param_name, param in sig.parameters.items():
# This is handled externally
if param_name == "cancellation_token":
continue
if param.annotation is inspect.Parameter.empty:
raise ValueError("No annotation")
type = normalize_annotated_type(param.annotation)
description = type2description(name, param.annotation)
default_value = param.default if param.default is not inspect.Parameter.empty else PydanticUndefined
fields[param_name] = (type, Field(default=default_value, description=description))
return cast(BaseModel, create_model(name, **fields)) # type: ignore
The text was updated successfully, but these errors were encountered:
In
FunctionTool
init, when calling the functionargs_base_model_from_signature
is does not return the name of the function, but the name of the last input. See below the current implementation of this function (from filepython/packages/autogen-core/src/autogen_core/_function_utils.py
) :In it, the param
name
is overwritten in the for loot. A correct implementation could look like :The text was updated successfully, but these errors were encountered: