mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-17 14:39:45 +02:00
feat: customizable data storage path
This commit is contained in:
@@ -41,10 +41,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
async_openai::config::OpenAIConfig::new().with_api_key(&config.openai_api_key),
|
||||
));
|
||||
|
||||
let html_state = HtmlState::new_with_resources(db, openai_client, session_store)?;
|
||||
let html_state =
|
||||
HtmlState::new_with_resources(db, openai_client, session_store, config.clone())?;
|
||||
|
||||
let api_state = ApiState {
|
||||
db: html_state.db.clone(),
|
||||
config: config.clone(),
|
||||
};
|
||||
|
||||
// Create Axum router
|
||||
@@ -93,7 +95,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Initialize worker components
|
||||
let openai_client = Arc::new(async_openai::Client::new());
|
||||
let ingestion_pipeline = Arc::new(
|
||||
IngestionPipeline::new(worker_db.clone(), openai_client.clone())
|
||||
IngestionPipeline::new(worker_db.clone(), openai_client.clone(), config.clone())
|
||||
.await
|
||||
.unwrap(),
|
||||
);
|
||||
|
||||
@@ -39,10 +39,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
async_openai::config::OpenAIConfig::new().with_api_key(&config.openai_api_key),
|
||||
));
|
||||
|
||||
let html_state = HtmlState::new_with_resources(db, openai_client, session_store)?;
|
||||
let html_state =
|
||||
HtmlState::new_with_resources(db, openai_client, session_store, config.clone())?;
|
||||
|
||||
let api_state = ApiState {
|
||||
db: html_state.db.clone(),
|
||||
config: config.clone(),
|
||||
};
|
||||
|
||||
// Create Axum router
|
||||
|
||||
@@ -29,7 +29,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let openai_client = Arc::new(async_openai::Client::new());
|
||||
|
||||
let ingestion_pipeline =
|
||||
Arc::new(IngestionPipeline::new(db.clone(), openai_client.clone()).await?);
|
||||
Arc::new(IngestionPipeline::new(db.clone(), openai_client.clone(), config).await?);
|
||||
|
||||
run_worker_loop(db, ingestion_pipeline).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user