Skip to content

Commit

Permalink
only warn if there are multiple functions involved
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzhao committed Dec 31, 2024
1 parent b8e2cf7 commit 4a92288
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions livekit-agents/livekit/agents/pipeline/pipeline_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,15 +963,17 @@ async def _execute_function_calls() -> None:
fnc_ctx = self.fnc_ctx
if (
fnc_ctx
and new_speech_handle.fnc_nested_depth > self._opts.max_nested_fnc_calls
and new_speech_handle.fnc_nested_depth
>= self._opts.max_nested_fnc_calls
):
logger.warning(
"max function calls nested depth reached, not propagating fnc ctx",
extra={
"speech_id": speech_handle.id,
"fnc_nested_depth": speech_handle.fnc_nested_depth,
},
)
if len(fnc_ctx.ai_functions) > 1:
logger.warning(
"max function calls nested depth reached, not propagating fnc ctx",
extra={
"speech_id": speech_handle.id,
"fnc_nested_depth": speech_handle.fnc_nested_depth,
},
)
fnc_ctx = None
answer_llm_stream = self._llm.chat(
chat_ctx=chat_ctx,
Expand Down

0 comments on commit 4a92288

Please sign in to comment.