We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f91a19 commit f43956eCopy full SHA for f43956e
1 file changed
camel/agents/chat_agent.py
@@ -2855,6 +2855,20 @@ def step(
2855
2856
stream = self.model_backend.model_config_dict.get("stream", False)
2857
2858
+ if input_message is None or (
2859
+ isinstance(input_message, str) and not input_message.strip()
2860
+ ):
2861
+ return ChatAgentResponse(
2862
+ msgs=[
2863
+ BaseMessage.make_assistant_message(
2864
+ role_name="assistant",
2865
+ content="Please provide a valid input."
2866
+ )
2867
+ ],
2868
+ terminated=False,
2869
+ info={"error": "empty_input"}
2870
2871
+
2872
if stream:
2873
# Return wrapped generator that has ChatAgentResponse interface
2874
generator = self._stream(input_message, response_format)
0 commit comments