mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-27 11:51:37 +01:00
refactor: merge new storage backend into main
This is in preparation for s3 storage support
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
use config::{Config, ConfigError, Environment, File};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Clone, Deserialize, Debug)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum StorageKind {
|
||||
Local,
|
||||
}
|
||||
|
||||
fn default_storage_kind() -> StorageKind {
|
||||
StorageKind::Local
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Debug)]
|
||||
pub struct AppConfig {
|
||||
pub openai_api_key: String,
|
||||
@@ -14,6 +24,8 @@ pub struct AppConfig {
|
||||
pub http_port: u16,
|
||||
#[serde(default = "default_base_url")]
|
||||
pub openai_base_url: String,
|
||||
#[serde(default = "default_storage_kind")]
|
||||
pub storage: StorageKind,
|
||||
}
|
||||
|
||||
fn default_data_dir() -> String {
|
||||
|
||||
Reference in New Issue
Block a user