Better search paths and handling of CLI providers (#5554)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use super::errors::ProviderError;
|
||||
use super::retry::RetryConfig;
|
||||
use crate::config::base::ConfigValue;
|
||||
use crate::conversation::message::Message;
|
||||
use crate::conversation::Conversation;
|
||||
use crate::model::ModelConfig;
|
||||
@@ -200,6 +201,16 @@ impl ConfigKey {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_value_type<T: ConfigValue>(required: bool, secret: bool) -> Self {
|
||||
Self {
|
||||
name: T::KEY.to_string(),
|
||||
required,
|
||||
secret,
|
||||
default: Some(T::DEFAULT.to_string()),
|
||||
oauth_flow: false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new ConfigKey that uses OAuth device code flow for configuration
|
||||
///
|
||||
/// This is used for providers that support OAuth authentication instead of manual API key entry.
|
||||
|
||||
Reference in New Issue
Block a user