Skip to content

Commit dcd9348

Browse files
fix: add on chat start callback impl (#662)
1 parent 7c037ac commit dcd9348

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/rai_core/rai/agents/integrations/streamlit.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ def on_llm_new_token(self, token: str, **kwargs) -> None:
7474
self.text += token # Append the new token to the existing text
7575
self.token_placeholder.write(self.text)
7676

77+
def on_chat_model_start(
78+
self,
79+
serialized: Dict[str, Any],
80+
messages: List[List[BaseMessage]],
81+
**kwargs: Any,
82+
) -> None:
83+
"""
84+
Run when the chat model starts.
85+
Args:
86+
serialized (Dict[str, Any]): The serialized model.
87+
messages (List[List[BaseMessage]]): The messages.
88+
**kwargs: Additional keyword arguments.
89+
"""
90+
pass # No specific action needed for chat model start
91+
7792
def on_tool_start(
7893
self, serialized: Dict[str, Any], input_str: str, **kwargs: Any
7994
) -> None:

0 commit comments

Comments
 (0)