File tree 2 files changed +10
-0
lines changed
livekit-agents/livekit/agents/pipeline
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " livekit-agents " : patch
3
+ ---
4
+
5
+ fix context when functions have been called
Original file line number Diff line number Diff line change @@ -702,6 +702,11 @@ async def _synthesize_answer_task(
702
702
not playing_speech .user_question or playing_speech .user_committed
703
703
) and not playing_speech .speech_committed :
704
704
# the speech is playing but not committed yet, add it to the chat context for this new reply synthesis
705
+ # First add the previous function call message if any
706
+ if playing_speech .extra_tools_messages :
707
+ copied_ctx .messages .extend (playing_speech .extra_tools_messages )
708
+
709
+ # Then add the previous assistant message
705
710
copied_ctx .messages .append (
706
711
ChatMessage .create (
707
712
text = playing_speech .synthesis_handle .tts_forwarder .played_text ,
You can’t perform that action at this time.
0 commit comments