test: add scenario eval runner, recorded fixtures, and baseline comparison
This commit is contained in:
parent
3dc1af5f0c
commit
0664cc2d27
38 changed files with 6986 additions and 5 deletions
|
|
@ -4,6 +4,7 @@ from collections.abc import AsyncIterator
|
|||
from contextlib import asynccontextmanager
|
||||
from pathlib import Path
|
||||
|
||||
import httpx
|
||||
import httpx2
|
||||
import structlog
|
||||
from anthropic import AsyncAnthropic
|
||||
|
|
@ -28,6 +29,7 @@ FRONTEND_DIST = Path(__file__).parent / "static"
|
|||
def create_app(
|
||||
application_settings: Settings | None = None,
|
||||
http_transport: httpx2.AsyncBaseTransport | None = None,
|
||||
anthropic_http_client: httpx.AsyncClient | None = None,
|
||||
) -> FastAPI:
|
||||
"""Build the FastAPI app: API routes plus the built SPA on one port."""
|
||||
active_settings = application_settings or settings
|
||||
|
|
@ -48,6 +50,7 @@ def create_app(
|
|||
anthropic_client = AsyncAnthropic(
|
||||
api_key=active_settings.anthropic_api_key or "unused-demo-key",
|
||||
timeout=active_settings.llm_timeout_seconds,
|
||||
http_client=anthropic_http_client,
|
||||
)
|
||||
application.state.anthropic = anthropic_client
|
||||
application.state.recommendation_pipeline = RecommendationPipeline(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue