fix: unified_search + ai_proactive get API key from DB, fix model names for Ollama Cloud

- query_understanding.py: get API key/base_url/provider_type from ai_providers DB
- embedding.py: get API key from DB, pass db+tenant_id through call chain
- routes.py: pass db+tenant_id to llm_analyze_query and llm_aggregate_results
- search_engine.py: pass db+tenant_id to generate_embedding
- unified_search/jobs.py: pass db+tenant_id to generate_embedding
- Fix all default model names: ollama/deepseek-v4 -> ollama/deepseek-v4-flash
- Ollama Cloud has no embedding endpoint; embedding calls fail gracefully
This commit is contained in:
Agent Zero
2026-07-19 02:22:25 +02:00
parent ef4f0cc494
commit 4a43745b50
9 changed files with 147 additions and 37 deletions
@@ -51,7 +51,7 @@ async def search(
tenant_id = uuid.UUID(current_user["tenant_id"])
# KI query understanding
query_analysis = await llm_analyze_query(req.query)
query_analysis = await llm_analyze_query(req.query, db=db, tenant_id=tenant_id)
# Hybrid search
results = await hybrid_search(
@@ -63,7 +63,7 @@ async def search(
)
# KI result aggregation
aggregation = await llm_aggregate_results(results, req.query)
aggregation = await llm_aggregate_results(results, req.query, db=db, tenant_id=tenant_id)
search_results = [
SearchResult(