fix: prevent agent debug from blocking chat
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
@@ -93,6 +94,11 @@ class ModelClientService:
|
||||
"knowledgeIds": rag_result.knowledge_ids,
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
async def debug_model_async(model: ModelConfig, rag_result: RagResult, overrides: dict[str, Any]) -> dict[str, Any]:
|
||||
"""Run the blocking provider client outside the ASGI event loop."""
|
||||
return await asyncio.to_thread(ModelClientService.debug_model, model, rag_result, overrides)
|
||||
|
||||
|
||||
def _mock_answer(rag_result: RagResult) -> str:
|
||||
if not rag_result.is_hit:
|
||||
|
||||
Reference in New Issue
Block a user