AI providers: review follow-ups to 0060ccd
Replay usage key gemini_usage -> llm_usage (backend + ReplayTab), re-price the correction/correlation estimates for gpt-4o-mini, no temperature for o-series or gpt-5 models, and refresh comments still naming Gemini. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0060ccde75
commit
4fab959ddb
@@ -79,11 +79,15 @@ def generate_json(model: str, prompt: str, *, purpose: str,
|
||||
from app.internal.ai_clients import openai_client
|
||||
# JSON mode requires the word "JSON" in the prompt; both prompts say
|
||||
# "Return JSON" / "Respond with JSON only".
|
||||
kwargs = {}
|
||||
# Reasoning models (o-series, gpt-5) reject a temperature; chat models get 0.
|
||||
if not model.startswith(("o1", "o3", "o4", "gpt-5")):
|
||||
kwargs["temperature"] = 0
|
||||
resp = openai_client().chat.completions.create(
|
||||
model=model,
|
||||
messages=[{"role": "user", "content": prompt}],
|
||||
response_format={"type": "json_object"},
|
||||
temperature=0,
|
||||
**kwargs,
|
||||
)
|
||||
usage = getattr(resp, "usage", None)
|
||||
record_usage(purpose, model,
|
||||
|
||||
Reference in New Issue
Block a user