diff --git a/examples/function-calling/function-calling-anthropic-async-stream.py b/examples/function-calling/function-calling-anthropic-async-stream.py index 953855da0..e96a56442 100644 --- a/examples/function-calling/function-calling-anthropic-async-stream.py +++ b/examples/function-calling/function-calling-anthropic-async-stream.py @@ -118,6 +118,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): llm = AnthropicLLMService( api_key=os.getenv("ANTHROPIC_API_KEY"), + enable_async_tool_cancellation=True, settings=AnthropicLLMService.Settings( system_instruction=( "You are a helpful assistant in a voice conversation. " @@ -139,10 +140,6 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): timeout_secs=30, ) - @llm.event_handler("on_function_calls_started") - async def on_function_calls_started(service, function_calls): - await tts.queue_frame(TTSSpeakFrame("Sure, tracking your location now.")) - location_function = FunctionSchema( name="track_current_location", description="Start tracking the user's current GPS location, reporting position updates until the user reaches their destination.",