Map Thinking Budget to Reasoning Effort for OpenAI Models
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend-api-design
Direzione di ricerca
Start by locating the OpenAI adapter and the sibling issue's isReasoning branch, then read how it builds bodyPayload and accesses the model sampling profile. Add the specified thinkingBudget mapping and cover numeric thresholds, string values, absent budgets, and standard models in tests. Done when those tests and the listed typecheck, test, and lint commands pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Goal
Add reasoning_effort parameter support to the OpenAI adapter for reasoning models that accept it (o3, o3-mini, o4-mini, gpt-6).
Background
OpenAI's reasoning models accept a reasoning_effort parameter with values "low", "medium", or "high" that controls how many internal thinking tokens the model uses. Currently Codra sends no such parameter and cannot tune the cost/quality tradeoff for reasoning model calls.
This sub-issue is part of the parent issue: OpenAI adapter incompatible with reasoning models.
What to Build
After the isReasoning branch is in place (see sibling sub-issue), read the thinkingBudget from the model's sampling profile and map it to reasoning_effort:
if (isReasoning && sampling?.thinkingBudget) {
let effort: "low" | "medium" | "high" | undefined;
if (typeof sampling.thinkingBudget === "number") {
effort =
sampling.thinkingBudget > 10000 ? "high"
: sampling.thinkingBudget > 3000 ? "medium"
: "low";
} else if (
sampling.thinkingBudget === "low" ||
sampling.thinkingBudget === "medium" ||
sampling.thinkingBudget === "high"
) {
effort = sampling.thinkingBudget;
}
if (effort) {
bodyPayload.reasoning_effort = effort;
}
}
Done When
-
reasoning_effortis included in requests to supported reasoning models when a thinking budget is configured - Numeric budgets are mapped to low/medium/high correctly
- String values low/medium/high are passed through directly
- The parameter is omitted when no thinking budget is configured
- Standard (non-reasoning) models are not affected
- Tests cover all mapping cases and the absent-budget case
-
npm run typecheck,npm test, andnpm run lintall pass
- Lingua principale
- TypeScript
- Stelle
- 125
- Fork
- 23
- Merge medio
- 2g 13h
- PR unite (30g)
- 12
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di devarshishimpi/codra
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
devarshishimpi/codra#178 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
devarshishimpi/codra#176 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
devarshishimpi/codra#186 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
devarshishimpi/codra#185 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
devarshishimpi/codra#184 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di devarshishimpi/codra
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
gofish-graphics/gofish-graphics#1384 ·
I maintainer di solito rispondono entro 1 giorno
-
adapter bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Olanetsoft/agent-lookout#353 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
vicharanashala/vibe#1542 ·
I maintainer di solito rispondono entro 1 giorno
-
bug chore P2 size:XS
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
josephfung/curia#2666 ·
I maintainer di solito rispondono entro 1 giorno
-
area: batch
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
inabagumi/shinju-date#7294 ·
I maintainer di solito rispondono entro 1 giorno