chore: return model with metedata (#1208)

* chore: return model with metedata

* chore: add error code
This commit is contained in:
Nathan.fooo 2025-02-03 17:05:15 +08:00 committed by GitHub
parent 82409199f8
commit 4ed5b367ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -433,6 +433,7 @@ pub enum ErrorCode {
AIImageResponseLimitExceeded = 1058,
MailerError = 1059,
LicenseError = 1060,
AIMaxRequired = 1061,
}
impl ErrorCode {

View File

@ -374,9 +374,16 @@ pub struct LocalAIConfig {
pub plugin: AppFlowyOfflineAI,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct AvailableModel {
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<serde_json::Value>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ModelList {
pub models: Vec<String>,
pub models: Vec<AvailableModel>,
}
#[derive(Clone, Debug, Serialize, Deserialize)]