Skip to content

Commit cf2b38d

Browse files
authored
Fix: ensure all functions have been called before running chat generator (#364)
1 parent 063ad43 commit cf2b38d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tutorials/40_Building_Chat_Application_with_Function_Calling.ipynb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,9 @@
11271127
"\n",
11281128
" ## Append function response to the messages list using `ChatMessage.from_function`\n",
11291129
" messages.append(ChatMessage.from_function(content=json.dumps(function_response), name=function_name))\n",
1130-
" response = chat_generator.run(messages=messages, generation_kwargs={\"tools\": tools})\n",
1130+
"\n",
1131+
" # After processing all function calls, call `chat_generator.run` once\n",
1132+
" response = chat_generator.run(messages=messages, generation_kwargs={\"tools\": tools})\n",
11311133
"\n",
11321134
" # Regular Conversation\n",
11331135
" else:\n",

0 commit comments

Comments
 (0)