Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "patch",
"description": "Allow non-OpenAI service_tier values in LLMCompletionResponse so indexing does not fail with LiteLLM-routed providers (e.g. Gemini via OpenRouter)."
}
6 changes: 6 additions & 0 deletions packages/graphrag-llm/graphrag_llm/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class LLMCompletionResponse(ChatCompletion, Generic[ResponseFormat]):
provided ResponseFormat model.
"""

# Widen OpenAI's strict `service_tier` literal. Non-OpenAI providers routed
# through LiteLLM (e.g. Gemini via OpenRouter) return values outside OpenAI's
# enum, which would otherwise fail pydantic validation when constructing this
# model. graphrag-llm does not use this field. See issue #2389.
service_tier: str | None = None # type: ignore

formatted_response: ResponseFormat | None = None # type: ignore
"""Formatted response according to the specified response_format json schema."""

Expand Down