mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-12 08:05:44 +00:00
fix: make api key optional (#7726)
This commit is contained in:
@@ -163,7 +163,7 @@ pub enum AnthropicPlatform {
|
||||
#[derive(Deserialize, Debug)]
|
||||
pub struct ProviderResource {
|
||||
#[serde(alias = "apiKey")]
|
||||
pub api_key: String,
|
||||
pub api_key: Option<String>,
|
||||
#[serde(alias = "baseUrl")]
|
||||
pub base_url: Option<String>,
|
||||
#[allow(dead_code)]
|
||||
@@ -187,8 +187,8 @@ pub struct ProviderWithResource {
|
||||
}
|
||||
|
||||
impl ProviderWithResource {
|
||||
pub fn get_api_key(&self) -> &str {
|
||||
&self.resource.api_key
|
||||
pub fn get_api_key(&self) -> Option<&str> {
|
||||
self.resource.api_key.as_deref()
|
||||
}
|
||||
|
||||
pub fn get_model(&self) -> &str {
|
||||
|
||||
@@ -411,7 +411,7 @@ pub async fn run_agent(
|
||||
) -> error::Result<Box<RawValue>> {
|
||||
let output_type = args.output_type.as_ref().unwrap_or(&OutputType::Text);
|
||||
let base_url = args.provider.get_base_url(db).await?;
|
||||
let api_key = args.provider.get_api_key();
|
||||
let api_key = args.provider.get_api_key().unwrap_or("");
|
||||
|
||||
// Create the query builder for the provider
|
||||
let query_builder = create_query_builder(&args.provider);
|
||||
|
||||
Reference in New Issue
Block a user