late-businessperson-58140
08/19/2025, 5:04 AMtall-airline-16756
08/19/2025, 5:05 AMtall-airline-16756
08/19/2025, 5:05 AMlate-businessperson-58140
08/19/2025, 5:05 AMtall-airline-16756
08/19/2025, 5:06 AMlate-businessperson-58140
08/19/2025, 5:49 AMtall-airline-16756
08/19/2025, 5:49 AMLLM.with_azure()
method doesn’t recognize a parameter called max_tokens
. Instead, you’ll want to use max_completion_tokens
to set how long the response should be.
Here’s a quick example to show you how to set it up properly:
from livekit.plugins.openai import LLM
azure_llm = LLM.with_azure(
model="gpt-4o",
max_completion_tokens=1000, # Use this instead of max_tokens
temperature=0.8,
)
Just update your code like this, and it should fix the problem. If you run into any other issues or have questions, feel free to ask—I’m here to help!
Sources: livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/stt.py | LLM | LiveKit Agentslate-businessperson-58140
08/19/2025, 5:51 AMtall-airline-16756
08/19/2025, 5:51 AM