Skip to content

Commit

Permalink
Better input/output visibility in Langchain callback (streamlit#7478)
Browse files Browse the repository at this point in the history
* Better input/output visibility in Langchain callback

* Update streamlit_callback_handler.py

* Update streamlit_callback_handler.py

* Update streamlit_callback_handler.py

* Update streamlit_callback_handler.py
  • Loading branch information
pokidyshev authored and eric-skydio committed Dec 20, 2023
1 parent d99d14f commit 619006e
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ def on_tool_start(
label=self._labeler.get_tool_label(self._last_tool, is_complete=False),
state="running",
)
if len(input_str) > MAX_TOOL_INPUT_STR_LENGTH:
# output is printed later in on_tool_end
self._container.markdown(f"**Input:**\n\n{input_str}\n\n**Output:**")

def on_tool_end(
self,
Expand Down

0 comments on commit 619006e

Please sign in to comment.