chore: return model with metedata (#1208)
* chore: return model with metedata * chore: add error code
This commit is contained in:
parent
82409199f8
commit
4ed5b367ea
|
|
@ -433,6 +433,7 @@ pub enum ErrorCode {
|
||||||
AIImageResponseLimitExceeded = 1058,
|
AIImageResponseLimitExceeded = 1058,
|
||||||
MailerError = 1059,
|
MailerError = 1059,
|
||||||
LicenseError = 1060,
|
LicenseError = 1060,
|
||||||
|
AIMaxRequired = 1061,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ErrorCode {
|
impl ErrorCode {
|
||||||
|
|
|
||||||
|
|
@ -374,9 +374,16 @@ pub struct LocalAIConfig {
|
||||||
pub plugin: AppFlowyOfflineAI,
|
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)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
pub struct ModelList {
|
pub struct ModelList {
|
||||||
pub models: Vec<String>,
|
pub models: Vec<AvailableModel>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue