-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
Update tool callbacks to send the actual response from the tool #18760
Comments
This is a bug in the astream_events API and an enhancement for existing tool callback handlers |
@eyurtsev I am taking this and working on it. |
@keenborder786 thanks for taking a look at this! The fix is actually more involved since it needs to be backwards compatible with existing callback handlers. I'm going to scope it out today |
@eyurtsev oh okay. Can you please explain a little about the backwards compatibility in this case so I can help you as well. All the existing handlers that are using |
Any code that relies on the output from the handlers should not break |
Okay.
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Eugene Yurtsev ***@***.***>
Sent: Friday, March 8, 2024 8:59:08 PM
To: langchain-ai/langchain ***@***.***>
Cc: Mohammad Mohtashim Khan ***@***.***>; Mention ***@***.***>
Subject: Re: [langchain-ai/langchain] Update tool callbacks to send the actual response from the tool (Issue #18760)
CAUTION: This email has originated from outside of LUMS. Do not click links or open attachments unless you recognize sender’s email address and know the content is safe.
Any code that relies on the output from the handlers should not break
—
Reply to this email directly, view it on GitHub<#18760 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKZFN65Z4NUICCEXMS3C6ITYXHN4ZAVCNFSM6AAAAABELY4UW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVHE2TAMZVHE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'm looking through to figure out what can be affected. For example, one thing is BaseTracer which is used to power both astream_log and astream_events. If we change the output of the it's a bit tricky in some of these cases to figure out whether to make a breaking change (and keep the code simple) or make a more involved change so that we don't break user code |
OK @keenborder786 I think we can proceed with the PR that you made! I'm going to outline a few places to propagate information to so that we break the minimum amount of code |
This PR updates the on_tool_end handlers to return the raw output from the tool instead of casting it to a string. This is technically a breaking change, though it's impact is expected to be somewhat minimal. It will fix behavior in `astream_events` as well. Fixes the following issue #18760 raised by @eyurtsev --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
PR merged will be available in next release |
@eyurtsev I don't see this issue (#18760) referenced in the latest release: https://github.com/langchain-ai/langchain/releases/tag/v0.1.12 When I test the original code that output a str(Document), I still see the same problematic output: Can you confirm that this issue was not fixed by the latest release? |
It looks like this PR might have to be merged before this issue can actually be corrected in a release. Is that correct? |
This PR updates the on_tool_end handlers to return the raw output from the tool instead of casting it to a string. This is technically a breaking change, though it's impact is expected to be somewhat minimal. It will fix behavior in `astream_events` as well. Fixes the following issue langchain-ai#18760 raised by @eyurtsev --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This PR updates the on_tool_end handlers to return the raw output from the tool instead of casting it to a string. This is technically a breaking change, though it's impact is expected to be somewhat minimal. It will fix behavior in `astream_events` as well. Fixes the following issue langchain-ai#18760 raised by @eyurtsev --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This PR updates the on_tool_end handlers to return the raw output from the tool instead of casting it to a string. This is technically a breaking change, though it's impact is expected to be somewhat minimal. It will fix behavior in `astream_events` as well. Fixes the following issue #18760 raised by @eyurtsev --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
Privileged issue
Issue Content
Reproducible issue. on_tool_end logs the string representation of the tool. All tool callbacks need to be updated to accommodate
The text was updated successfully, but these errors were encountered: