Skip to content

Commit

Permalink
Fix: ensure all functions have been called before running chat genera…
Browse files Browse the repository at this point in the history
…tor (#364)
  • Loading branch information
mpangrazzi authored Nov 26, 2024
1 parent 063ad43 commit cf2b38d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,9 @@
"\n",
" ## Append function response to the messages list using `ChatMessage.from_function`\n",
" messages.append(ChatMessage.from_function(content=json.dumps(function_response), name=function_name))\n",
" response = chat_generator.run(messages=messages, generation_kwargs={\"tools\": tools})\n",
"\n",
" # After processing all function calls, call `chat_generator.run` once\n",
" response = chat_generator.run(messages=messages, generation_kwargs={\"tools\": tools})\n",
"\n",
" # Regular Conversation\n",
" else:\n",
Expand Down

0 comments on commit cf2b38d

Please sign in to comment.