agent: Don't render usage callouts when not using the Zed provider (#30025)
This PR makes it so we don't render the usage callouts when not using the Zed provider. Release Notes: - Agent Beta: Changed usage callouts to only be displayed when using a model through the Zed provider.
This commit is contained in:
parent
80236d0bb9
commit
7a9165d5ce
1 changed files with 15 additions and 1 deletions
|
@ -26,7 +26,10 @@ use gpui::{
|
|||
Task, TextStyle, WeakEntity, linear_color_stop, linear_gradient, point, pulsating_between,
|
||||
};
|
||||
use language::{Buffer, Language};
|
||||
use language_model::{ConfiguredModel, LanguageModelRequestMessage, MessageContent, RequestUsage};
|
||||
use language_model::{
|
||||
ConfiguredModel, LanguageModelRequestMessage, MessageContent, RequestUsage,
|
||||
ZED_CLOUD_PROVIDER_ID,
|
||||
};
|
||||
use language_model_selector::ToggleModelSelector;
|
||||
use multi_buffer;
|
||||
use project::Project;
|
||||
|
@ -1071,6 +1074,17 @@ impl MessageEditor {
|
|||
return None;
|
||||
}
|
||||
|
||||
let is_using_zed_provider = self
|
||||
.thread
|
||||
.read(cx)
|
||||
.configured_model()
|
||||
.map_or(false, |model| {
|
||||
model.provider.id().0 == ZED_CLOUD_PROVIDER_ID
|
||||
});
|
||||
if !is_using_zed_provider {
|
||||
return None;
|
||||
}
|
||||
|
||||
let user_store = self.user_store.read(cx);
|
||||
|
||||
let ubb_enable = user_store
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue