Skip to content

Commit

Permalink
Fix __namespace__ argument
Browse files Browse the repository at this point in the history
  • Loading branch information
koxudaxi committed Jun 21, 2024
1 parent 469315a commit 95e7bd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mirascope/core/base/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def convert_function_to_base_tool(
fn: Callable,
base: type[BaseToolT],
__doc__: str | None = None,
namespace: str | None = None,
__namespace__: str | None = None,
) -> type[BaseToolT]:
"""Constructst a `BaseToolT` type from the given function.
Expand All @@ -164,7 +164,7 @@ def convert_function_to_base_tool(
fn: The function to convert.
base: The `BaseToolT` type to which the function is converted.
__doc__: The docstring to use for the constructed `BaseToolT` type.
namespace: The namespace to use for the constructed `BaseToolT` type.
__namespace__: The namespace to use for the constructed `BaseToolT` type.
Returns:
The constructed `BaseToolT` type.
Expand Down Expand Up @@ -225,7 +225,7 @@ def convert_function_to_base_tool(
)

model = create_model(
f"{namespace}.{fn.__name__}" if namespace else fn.__name__,
f"{__namespace__}.{fn.__name__}" if __namespace__ else fn.__name__,
__base__=base,
__doc__=inspect.cleandoc(func_doc) if func_doc else DEFAULT_TOOL_DOCSTRING,
**cast(dict[str, Any], field_definitions),
Expand Down

0 comments on commit 95e7bd4

Please sign in to comment.