Handle auth for claude (#36442)
We'll now use the anthropic provider to get credentials for `claude` and embed its configuration view in the panel when they are not present. Release Notes: - N/A
This commit is contained in:
parent
50819a9d20
commit
8b89ea1a80
32 changed files with 400 additions and 124 deletions
|
@ -634,7 +634,12 @@ pub trait LanguageModelProvider: 'static {
|
|||
}
|
||||
fn is_authenticated(&self, cx: &App) -> bool;
|
||||
fn authenticate(&self, cx: &mut App) -> Task<Result<(), AuthenticateError>>;
|
||||
fn configuration_view(&self, window: &mut Window, cx: &mut App) -> AnyView;
|
||||
fn configuration_view(
|
||||
&self,
|
||||
target_agent: ConfigurationViewTargetAgent,
|
||||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
) -> AnyView;
|
||||
fn must_accept_terms(&self, _cx: &App) -> bool {
|
||||
false
|
||||
}
|
||||
|
@ -648,6 +653,13 @@ pub trait LanguageModelProvider: 'static {
|
|||
fn reset_credentials(&self, cx: &mut App) -> Task<Result<()>>;
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Copy)]
|
||||
pub enum ConfigurationViewTargetAgent {
|
||||
#[default]
|
||||
ZedAgent,
|
||||
Other(&'static str),
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
pub enum LanguageModelProviderTosView {
|
||||
/// When there are some past interactions in the Agent Panel.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue