Skip to content
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

standard-tests: Fix ToolsIntegrationTests to correctly handle "content_and_artifact" tools #29391

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

rectalogic
Copy link
Contributor

Description:

The response from tool.invoke() is always a ToolMessage, with content and artifact fields, not a tuple.
The tuple is converted to a ToolMessage here

output = _format_output(content, artifact, tool_call_id, self.name, status)

Issue:

Currently ToolsIntegrationTests requires invoke() to return a tuple and so standard tests fail for "content_and_artifact" tools. This fixes that to check the returned ToolMessage.

This PR also adds a test that now passes.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 23, 2025
Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jan 27, 2025 4:36pm

@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Jan 23, 2025
…t_and_artifact" tools

The response from tool.invoke is always a ToolMessage, with content and artifact fields, not a tuple.

Add a test that now passes.
@rectalogic rectalogic force-pushed the content_and_artifact branch from 62b3da8 to 7d67464 Compare January 27, 2025 16:35
@rectalogic
Copy link
Contributor Author

@efriis could you take a look at this when you get a chance? Currently ToolsIntegrationTests don't seem usable for "content_and_artifact" tools.

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Feb 6, 2025
@ccurme ccurme merged commit 22aa5e0 into langchain-ai:master Feb 6, 2025
112 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature lgtm PR looks good. Use to confirm that a PR is ready for merging. size:M This PR changes 30-99 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants