mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-09 21:26:14 +03:00
Pass through Anthropic cache configuration when using Zed provider (#16685)
This PR makes it so the model's cache configuration gets passed through from the base model when using the Zed provider. Release Notes: - Fixed caching for Anthropic models when using the Zed provider.
This commit is contained in:
parent
25cdd2ad25
commit
93642c9c51
@ -445,6 +445,21 @@ impl LanguageModel for CloudLanguageModel {
|
|||||||
self.model.max_token_count()
|
self.model.max_token_count()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn cache_configuration(&self) -> Option<LanguageModelCacheConfiguration> {
|
||||||
|
match &self.model {
|
||||||
|
CloudModel::Anthropic(model) => {
|
||||||
|
model
|
||||||
|
.cache_configuration()
|
||||||
|
.map(|cache| LanguageModelCacheConfiguration {
|
||||||
|
max_cache_anchors: cache.max_cache_anchors,
|
||||||
|
should_speculate: cache.should_speculate,
|
||||||
|
min_total_token: cache.min_total_token,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
CloudModel::OpenAi(_) | CloudModel::Google(_) | CloudModel::Zed(_) => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn count_tokens(
|
fn count_tokens(
|
||||||
&self,
|
&self,
|
||||||
request: LanguageModelRequest,
|
request: LanguageModelRequest,
|
||||||
|
Loading…
Reference in New Issue
Block a user