-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core[fix] @tool typing #25856
base: master
Are you sure you want to change the base?
core[fix] @tool typing #25856
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
0a52e2d
to
0c6914c
Compare
infer_schema: bool = True, | ||
response_format: Literal["content", "content_and_artifact"] = "content", | ||
parse_docstring: bool = False, | ||
error_on_invalid_docstring: bool = True, | ||
) -> Callable: | ||
) -> StructuredTool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be Union[Tool, Callable] i believe
@tool(return_direct=True) # this outputs a Callable that creates a StructuredTool
def foo(...)
@tool(infer_schema=False) # this outputs a Callable that creates a Tool
def foo(...)
@@ -101,6 +101,17 @@ async def _arun(self, arg1: int, arg2: bool, arg3: Optional[dict] = None) -> str | |||
raise NotImplementedError | |||
|
|||
|
|||
def test_tool_typing() -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we add a test case for each tool overload variant?
Description: Fixes '@tool' typing addressing incompatibility in assignment
Issue: #24089