Set tool schema format for zed.dev language model (#27788)

Release Notes:

- N/A
This commit is contained in:
Bennet Bo Fenner 2025-03-31 18:49:59 +02:00 committed by GitHub
parent fc269dfaf9
commit 01a2c8eb01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 3 deletions

View file

@ -14,7 +14,7 @@ use smol::lock::{RwLock, RwLockUpgradableReadGuard, RwLockWriteGuard};
use strum::EnumIter;
use thiserror::Error;
use crate::LanguageModelAvailability;
use crate::{LanguageModelAvailability, LanguageModelToolSchemaFormat};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, JsonSchema)]
#[serde(tag = "provider", rename_all = "lowercase")]
@ -113,6 +113,13 @@ impl CloudModel {
},
}
}
pub fn tool_input_format(&self) -> LanguageModelToolSchemaFormat {
match self {
Self::Anthropic(_) | Self::OpenAi(_) => LanguageModelToolSchemaFormat::JsonSchema,
Self::Google(_) => LanguageModelToolSchemaFormat::JsonSchemaSubset,
}
}
}
#[derive(Error, Debug)]