Fix interaction with Anthropic models when using it via zed.dev (#15009)
Release Notes: - N/A --------- Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
co-authored by
Bennet
parent
dde9d37cf9
commit
728650f94a
@@ -1,4 +1,3 @@
|
||||
use crate::LanguageModelRequest;
|
||||
pub use anthropic::Model as AnthropicModel;
|
||||
pub use ollama::Model as OllamaModel;
|
||||
pub use open_ai::Model as OpenAiModel;
|
||||
@@ -88,19 +87,4 @@ impl CloudModel {
|
||||
Self::Custom { max_tokens, .. } => max_tokens.unwrap_or(200_000),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn preprocess_request(&self, request: &mut LanguageModelRequest) {
|
||||
match self {
|
||||
Self::Claude3Opus
|
||||
| Self::Claude3Sonnet
|
||||
| Self::Claude3Haiku
|
||||
| Self::Claude3_5Sonnet => {
|
||||
request.preprocess_anthropic();
|
||||
}
|
||||
Self::Custom { name, .. } if name.starts_with("anthropic/") => {
|
||||
request.preprocess_anthropic();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user