Switched from plugin to LK inference. STT and TTS ...
# inference
m
Switched from plugin to LK inference. STT and TTS work fine (Deepgram and Elevenlabs respectively). However, I get the following error with
llm="openai/gpt-4.1-mini"
:
livekit.agents._exceptions.APIStatusError: Error proxying completions: provider: azure model: gpt-4.1-mini-provisioned, message: POST "<https://agent-gateway.cognitiveservices.azure.com/openai/v1/chat/completions>": 400 Bad Request {
"message": "Missing required parameter: 'response_format.json_schema'.",
"type": "invalid_request_error",
"param": "response_format.json_schema",
"code": "missing_required_parameter"
}
Ah, this is likely because I overwrote the LLM node to use structured outputs. I guess the interaction is different for plugins vs inference?
Yeah, seems to be an issue when I try to use structured outputs with LK inference.
d
ah thanks for the report. we will take a look. CC @fancy-lifeguard-70250
f
On it. I will take a look. @many-forest-60185 would you be able to send the request JSON? I suspect I know what the problem is but I would to confirm with the JSON. You can redact the messages field if needed. Also, feel free to DM me the JSON if that’s better for you.
m
Sure thing. JSON here.
{
"model": "gpt-4.1-mini",
"messages": [/* redacted */],
"tool_choice": "none",
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "ResponseStructure",
"strict": true,
"schema": {
"type": "object",
"properties": {
"message_type": { "type": "string" },
"output": { "type": "string" },
"input_language": { "type": "string" }
},
"required": ["message_type", "output", "input_language"],
"additionalProperties": false
}
}
}
}
f
Wonderful. I’ll look into this and report back. Thank @many-forest-60185
👍 1
Ok, I found the issue, i'll let you know when I have a fix.
🎉 1
@many-forest-60185 I haven't forgotten about you, fix should be going out today. I will let you know.
m
Sounds good
f
@many-forest-60185 Fix is live. Let me know if you experience anything unexpected.
m
@fancy-lifeguard-70250 Works like a charm. Didn’t even need to update! Thanks for taking care of it so quickly. Eager to see how LK Inference impacts average production latency.. especially on the LLM piece.
f
Sick!!! Happy to help and apologies for the inconvenience.
🙌 1