Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix issue where message is none (#5307)

Robert Brennan3ac57a61a7d9
diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py
index 49f8df364f..700c3827fd 100644
--- a/openhands/llm/llm.py
+++ b/openhands/llm/llm.py
@@ -245,7 +245,7 @@ class LLM(RetryMixin, DebugMixin):
with open(log_file, 'w') as f:
f.write(json.dumps(_d))
- message_back: str = resp['choices'][0]['message']['content']
+ message_back: str = resp['choices'][0]['message']['content'] or ''
tool_calls = resp['choices'][0]['message'].get('tool_calls', [])
if tool_calls:
for tool_call in tool_calls: