The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Improvement[Community] Improve `streamlit_callback_handler` (#26373)
ZhangShenao1a8e9023de31
diff --git a/libs/community/langchain_community/callbacks/streamlit/streamlit_callback_handler.py b/libs/community/langchain_community/callbacks/streamlit/streamlit_callback_handler.pyindex 0d065e95dd..5d5985c039 100644--- a/libs/community/langchain_community/callbacks/streamlit/streamlit_callback_handler.py+++ b/libs/community/langchain_community/callbacks/streamlit/streamlit_callback_handler.py@@ -53,13 +53,15 @@ class LLMThoughtLabeler:labeling logic."""- def get_initial_label(self) -> str:+ @staticmethod+ def get_initial_label() -> str:"""Return the markdown label for a new LLMThought that doesn't havean associated tool yet."""return f"{THINKING_EMOJI} **Thinking...**"- def get_tool_label(self, tool: ToolRecord, is_complete: bool) -> str:+ @staticmethod+ def get_tool_label(tool: ToolRecord, is_complete: bool) -> str:"""Return the label for an LLMThought that has an associatedtool.@@ -91,13 +93,15 @@ class LLMThoughtLabeler:label = f"{emoji} **{name}:** {input}"return label- def get_history_label(self) -> str:+ @staticmethod+ def get_history_label() -> str:"""Return a markdown label for the special 'history' containerthat contains overflow thoughts."""return f"{HISTORY_EMOJI} **History**"- def get_final_agent_thought_label(self) -> str:+ @staticmethod+ def get_final_agent_thought_label() -> str:"""Return the markdown label for the agent's final thought -the "Now I have the answer" thought, that doesn't involvea tool.