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.
This commit is contained in:
James Brunton
2026-03-26 10:35:47 +00:00
committed by GitHub
parent 9500acd69f
commit e10c5f6283
211 changed files with 3891 additions and 27744 deletions

View File

@@ -378,7 +378,7 @@ def write_models_module(out_path: Path, specs: list[ToolModelSpec]) -> None:
"from __future__ import annotations\n\n",
"from enum import StrEnum\n",
"from typing import Any, Literal\n\n",
"from models.base import ApiModel\n",
"from stirling.models.base import ApiModel\n",
]
class_names: dict[str, str] = {spec.tool_id: _to_class_name(spec.tool_id) for spec in specs}
@@ -500,7 +500,7 @@ def main() -> None:
repo_root = Path(__file__).resolve().parents[3]
specs = discover_tool_specs(repo_root)
output_path = Path(args.output) if args.output else (repo_root / "docgen/backend/models/tool_models.py")
output_path = Path(args.output) if args.output else (repo_root / "src/stirling/models/tool_models.py")
write_models_module(output_path, specs)
print(f"Wrote {len(specs)} tool model specs")