Фиксация изменений

This commit is contained in:
2026-03-05 11:03:17 +03:00
parent 1ef0b4d68c
commit 417b8b6f72
261 changed files with 8215 additions and 332 deletions

View File

@@ -0,0 +1,25 @@
from __future__ import annotations
import logging
from app.modules.rag.intent_router_v2.models import ConversationState, IntentRouterResult, RepoContext
from app.modules.rag.intent_router_v2.router import IntentRouterV2
LOGGER = logging.getLogger(__name__)
class IntentRouterScenarioRunner:
def __init__(self, router: IntentRouterV2) -> None:
self._router = router
def run(self, queries: list[str], repo_context: RepoContext | None = None) -> list[IntentRouterResult]:
state = ConversationState()
context = repo_context or RepoContext()
results: list[IntentRouterResult] = []
for index, user_query in enumerate(queries, start=1):
LOGGER.warning("intent router local input: turn=%s user_query=%s", index, user_query)
result = self._router.route(user_query, state, context)
LOGGER.warning("intent router local output: turn=%s result=%s", index, result.model_dump_json(ensure_ascii=False))
results.append(result)
state = state.advance(result)
return results