cleanup: remove model name string matching
model_context_window() now reads from config.api_context_window instead of guessing from model name strings. is_anthropic_model() replaced with backend == "anthropic" checks. Dead model field removed from AgentDef/AgentHeader. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
47c6694b10
commit
078dcf22d0
5 changed files with 15 additions and 32 deletions
|
|
@ -6,15 +6,8 @@ use crate::agent::types::*;
|
|||
use tiktoken_rs::CoreBPE;
|
||||
|
||||
/// Look up a model's context window size in tokens.
|
||||
pub fn model_context_window(model: &str) -> usize {
|
||||
let m = model.to_lowercase();
|
||||
if m.contains("opus") || m.contains("sonnet") {
|
||||
200_000
|
||||
} else if m.contains("qwen") {
|
||||
131_072
|
||||
} else {
|
||||
128_000
|
||||
}
|
||||
pub fn model_context_window(_model: &str) -> usize {
|
||||
crate::config::get().api_context_window
|
||||
}
|
||||
|
||||
/// Context budget in tokens: 60% of the model's context window.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue