language_model: Denote the availability of language models (#15660)
This PR updates the `LanguageModel` trait with a new method for denoting the availability of a model. Right now we have two variants: - `Public` for models that have no additional restrictions (other than their respective setup/authentication requirements) - `RequiresPlan` for models that require a specific Zed plan Release Notes: - N/A
This commit is contained in:
parent
906d9736d5
commit
5e011ab029
4 changed files with 73 additions and 13 deletions
|
@ -18,7 +18,7 @@ use std::{future, sync::Arc};
|
|||
use strum::IntoEnumIterator;
|
||||
use ui::prelude::*;
|
||||
|
||||
use crate::LanguageModelProvider;
|
||||
use crate::{LanguageModelAvailability, LanguageModelProvider};
|
||||
|
||||
use super::anthropic::count_anthropic_tokens;
|
||||
|
||||
|
@ -236,6 +236,10 @@ impl LanguageModel for CloudLanguageModel {
|
|||
format!("zed.dev/{}", self.model.id())
|
||||
}
|
||||
|
||||
fn availability(&self) -> LanguageModelAvailability {
|
||||
self.model.availability()
|
||||
}
|
||||
|
||||
fn max_token_count(&self) -> usize {
|
||||
self.model.max_token_count()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue