fix: env var overrides for campaign settings (hf_token, ollama_host etc)
Some checks failed
Build and Push / build (push) Has been cancelled
Some checks failed
Build and Push / build (push) Has been cancelled
This commit is contained in:
@@ -2,6 +2,7 @@ import requests
|
||||
from fastapi import APIRouter, Query
|
||||
|
||||
from .. import database as db
|
||||
from ..config import merge_campaign_settings_with_env
|
||||
|
||||
router = APIRouter(prefix="/api/models", tags=["models"])
|
||||
|
||||
@@ -10,7 +11,7 @@ router = APIRouter(prefix="/api/models", tags=["models"])
|
||||
def list_ollama_models(campaign_id: str = Query("default")):
|
||||
"""List models already pulled on the configured Ollama host, so the setup
|
||||
wizard can offer a dropdown instead of asking the user to type a tag blind."""
|
||||
settings = db.get_campaign_settings(campaign_id)
|
||||
settings = merge_campaign_settings_with_env(db.get_campaign_settings(campaign_id))
|
||||
host = settings.get("ollama_host", "http://host.docker.internal:11434")
|
||||
try:
|
||||
resp = requests.get(f"{host.rstrip('/')}/api/tags", timeout=5)
|
||||
|
||||
Reference in New Issue
Block a user