Finished dockerization
This commit is contained in:
+15
-2
@@ -9,6 +9,7 @@ from typing import Any
|
||||
|
||||
from fastapi import FastAPI, HTTPException
|
||||
from fastapi.responses import JSONResponse, StreamingResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from pydantic import BaseModel, Field, validator
|
||||
|
||||
from agent.agent import Agent
|
||||
@@ -29,9 +30,21 @@ app = FastAPI(
|
||||
version="0.2.0",
|
||||
)
|
||||
|
||||
# TODO: Make a variable
|
||||
manifests = "manifests"
|
||||
# Sécurité : on vérifie que le dossier existe pour ne pas faire planter l'app au démarrage
|
||||
if os.path.exists(manifests):
|
||||
app.mount("/manifests", StaticFiles(directory=manifests), name="manifests")
|
||||
else:
|
||||
print(
|
||||
f"⚠️ ATTENTION : Le dossier '{manifests}' est introuvable. Le plugin ne marchera pas."
|
||||
)
|
||||
|
||||
# Initialize memory context at startup
|
||||
init_memory(storage_dir="memory_data")
|
||||
logger.info("Memory context initialized")
|
||||
# Use /data/memory in Docker, fallback to memory_data for local dev
|
||||
storage_dir = os.getenv("MEMORY_STORAGE_DIR", "memory_data")
|
||||
init_memory(storage_dir=storage_dir)
|
||||
logger.info(f"Memory context initialized (storage: {storage_dir})")
|
||||
|
||||
# Initialize LLM based on environment variable
|
||||
llm_provider = os.getenv("LLM_PROVIDER", "deepseek").lower()
|
||||
|
||||
Reference in New Issue
Block a user