Skip to content

Commit 515bdc5

Browse files
committed
added name to pydantic model
1 parent e91da98 commit 515bdc5

File tree

1 file changed

+3
-3
lines changed
  • packages/toolbox-core/src/toolbox_core

1 file changed

+3
-3
lines changed

packages/toolbox-core/src/toolbox_core/tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def __init__(
8181
self.__url = f"{base_url}/api/tool/{name}/invoke"
8282
self.__description = description
8383
self.__params = params
84-
self.__pydantic_model = params_to_pydantic_model(self.__params)
84+
self.__pydantic_model = params_to_pydantic_model(name, self.__params)
8585

8686
inspect_type_params = [param.to_param() for param in self.__params]
8787

@@ -316,7 +316,7 @@ def identify_required_authn_params(
316316
return required_params
317317

318318

319-
def params_to_pydantic_model(params: Sequence[ParameterSchema]) -> Type[BaseModel]:
319+
def params_to_pydantic_model(tool_name: str, params: Sequence[ParameterSchema]) -> Type[BaseModel]:
320320
"""Converts the given parameters to a Pydantic BaseModel class."""
321321
field_definitions = {}
322322
for field in params:
@@ -327,4 +327,4 @@ def params_to_pydantic_model(params: Sequence[ParameterSchema]) -> Type[BaseMode
327327
Field(description=field.description),
328328
),
329329
)
330-
return create_model("tool_model", **field_definitions)
330+
return create_model(tool_name, **field_definitions)

0 commit comments

Comments
 (0)