is there a exclude_function_call argument inside t...
# ask-ai
i
is there a exclude_function_call argument inside the .copy() for the chat_ctx?
t
Thanks for reaching out, Peter. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Yes, there is an
exclude_function_call
argument in the
.copy()
method for
chat_ctx
in LiveKit. The method signature is:
Copy code
def copy(
    self,
    *,
    exclude_function_call: bool = False,
    exclude_instructions: bool = False,
    exclude_empty_message: bool = False,
    tools: NotGivenOr[Sequence[FunctionTool | RawFunctionTool | str | Any]] = NOT_GIVEN,
) -> ChatContext:
When
exclude_function_call=True
, the method excludes items with type "function_call" and "function_call_output" from the copied context. By default, this parameter is set to
False
, meaning function calls are included unless explicitly excluded. This parameter is often used in scenarios like: • Excluding function calls when reconnecting in the OpenAI Realtime API. • Copying chat context between agents while excluding function call history. Sources: livekit-agents/livekit/agents/voice/generation.py