Files
Stirling-PDF/engine/src/stirling/api/dependencies.py
T
James BruntonandGitHub e10c5f6283 Redesign Python AI engine (#5991)
# Description of Changes
Redesign the Python AI engine to be properly agentic and make use of
`pydantic-ai` instead of `langchain` for correctness and ergonomics.
This should be a good foundation for us to build our AI engine on going
forwards.
2026-03-26 10:35:47 +00:00

31 lines
889 B
Python

from __future__ import annotations
from fastapi import Request
from stirling.agents import ExecutionPlanningAgent, OrchestratorAgent, PdfEditAgent, PdfQuestionAgent, UserSpecAgent
from stirling.services import AppRuntime
def get_runtime(request: Request) -> AppRuntime:
return request.app.state.runtime
def get_orchestrator_agent(request: Request) -> OrchestratorAgent:
return request.app.state.orchestrator_agent
def get_pdf_edit_agent(request: Request) -> PdfEditAgent:
return request.app.state.pdf_edit_agent
def get_pdf_question_agent(request: Request) -> PdfQuestionAgent:
return request.app.state.pdf_question_agent
def get_user_spec_agent(request: Request) -> UserSpecAgent:
return request.app.state.user_spec_agent
def get_execution_planning_agent(request: Request) -> ExecutionPlanningAgent:
return request.app.state.execution_planning_agent