Skip to content

feat: add service_tier parameter to Responses API LLM#5346

Open
piyush-gambhir wants to merge 1 commit intolivekit:mainfrom
piyush-gambhir:feat/responses-service-tier-param
Open

feat: add service_tier parameter to Responses API LLM#5346
piyush-gambhir wants to merge 1 commit intolivekit:mainfrom
piyush-gambhir:feat/responses-service-tier-param

Conversation

@piyush-gambhir
Copy link
Copy Markdown
Contributor

Summary

The Chat Completions LLM (openai.LLM) already supports the service_tier parameter for configuring priority/flex/default processing per-request. The Responses API LLM (openai.responses.LLM) is missing this parameter despite the OpenAI Responses API supporting it.

This PR adds service_tier to the Responses LLM for parity.

Changes

livekit-plugins/livekit-plugins-openai/.../responses/llm.py (1 file):

  • Add service_tier: NotGivenOr[str] to _LLMOptions
  • Add service_tier parameter to LLM.__init__()
  • Pass service_tier through in chat() via extra kwargs

Usage

```python
from livekit.plugins.openai import responses

llm = responses.LLM(
model="gpt-5.4",
service_tier="priority", # now supported
)
```

Backward Compatible

  • Defaults to `NOT_GIVEN` — no impact on existing code
  • Matches the existing pattern used by the Chat Completions LLM (`NotGivenOr[str]`)

The Chat Completions LLM (openai.LLM) already supports the service_tier
parameter for configuring priority/flex/default processing. This adds
the same parameter to the Responses API LLM (openai.responses.LLM) for
parity.

OpenAI's Responses API accepts service_tier in the request body:
https://platform.openai.com/docs/api-reference/responses/create

Changes (responses/llm.py only):
- Add service_tier to _LLMOptions dataclass
- Add service_tier parameter to LLM.__init__()
- Pass service_tier through in chat() via extra kwargs
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant