Esha Manideep

Results comments of Esha Manideep

@krrishdholakia this PR could help us a lot too - would be awesome if we can get this approved :)

Yeah this happens because livekit just sets fnc_ctx = None when they dont want the LLM to not call a tool instead of setting tool_choice

Removing fnc_ctx is fine if its an OpenAI LLM we are making the request to - since anthropic fails if you remove fnc_ctx (anthropic fails if tool calls in chat_ctx,...

In our current pipeline, we just set it to 10 or something if its anthropic LLM

Livekit sets fnc_ctx = None when max_nested_fnc_calls is reached [here](https://github.com/livekit/agents/blob/84c2e90d6be288862a51b40329333b96179bb136/livekit-agents/livekit/agents/pipeline/pipeline_agent.py#L993). Since this is set **after** some tool calls by anthropic, it fails because anthropic's API doesn't allow tools = []...