tech-envision commited on
Commit
09df150
·
unverified ·
2 Parent(s): c22c463 fc0265f

Merge pull request #33 from EnvisionMindCa/codex/fix-discord-bot-response-for-llm-without-tools

Browse files
Files changed (1) hide show
  1. src/chat.py +6 -0
src/chat.py CHANGED
@@ -141,6 +141,12 @@ class ChatSession:
141
  conversation: Conversation,
142
  depth: int = 0,
143
  ) -> AsyncIterator[ChatResponse]:
 
 
 
 
 
 
144
  while depth < MAX_TOOL_CALL_DEPTH and response.message.tool_calls:
145
  for call in response.message.tool_calls:
146
  if call.function.name != "execute_terminal":
 
141
  conversation: Conversation,
142
  depth: int = 0,
143
  ) -> AsyncIterator[ChatResponse]:
144
+ if not response.message.tool_calls:
145
+ if response.message.content:
146
+ yield response
147
+ async with self._lock:
148
+ self._state = "idle"
149
+ return
150
  while depth < MAX_TOOL_CALL_DEPTH and response.message.tool_calls:
151
  for call in response.message.tool_calls:
152
  if call.function.name != "execute_terminal":