core[major]: On Tool End Observation Casting Fix (#18798)

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>
This commit is contained in:
Mohammad Mohtashim
2024-03-11 19:59:04 +05:00
committed by GitHub
parent a96a6e0f2c
commit 43db4cd20e
20 changed files with 42 additions and 34 deletions

View File

@@ -196,7 +196,7 @@ class ArizeCallbackHandler(BaseCallbackHandler):
def on_tool_end(
self,
output: str,
output: Any,
observation_prefix: Optional[str] = None,
llm_prefix: Optional[str] = None,
**kwargs: Any,