Cap OpenAI default output tokens using model metadata

This commit is contained in:
Andreas Haida
2026-05-03 18:46:04 +02:00
parent 6ac13ffdad
commit 9a512633a5
2 changed files with 84 additions and 17 deletions

View File

@@ -148,11 +148,7 @@ impl ModelProvenance {
}
fn max_tokens_for_model(model: &str) -> u32 {
if model.contains("opus") {
32_000
} else {
64_000
}
api::max_tokens_for_model(model)
}
// Build-time constants injected by build.rs (fall back to static values when
// build.rs hasn't run, e.g. in doc-test or unusual toolchain environments).