helpful-holiday-17530
06/05/2025, 11:46 AMFunctionCall and FunctionCallOutput to history and immediately continue the call?
For context:
• raise agents.StopResponse() stops the bot’s speech, so it doesn’t work for me
• return "", return None, or return self — all behave the same and still log FunctionCallOutput with output='', which I don’t wanttall-airline-16756
06/05/2025, 11:46 AMtall-airline-16756
06/05/2025, 11:46 AMFunctionCall and FunctionCallOutput to history during tool execution, you can use the copy() method of the ChatContext class with the exclude_function_call parameter set to True. This will filter out items of type "function_call" and "function_call_output" from the copied context. Here's an example:
def copy(
self,
*,
exclude_function_call: bool = False,
exclude_instructions: bool = False,
tools: NotGivenOr[list[FunctionTool | RawFunctionTool | str | Any]] = NOT_GIVEN,
) -> ChatContext:
When you set exclude_function_call=True, it ensures these items are not included in the copied context.
Sources: Tree View: | dse-workbenchhelpful-holiday-17530
06/05/2025, 11:47 AMtall-airline-16756
06/05/2025, 11:48 AMhelpful-holiday-17530
06/05/2025, 11:48 AM