use pydantic
All checks were successful
Build and Push Agent Docker Image / build (push) Successful in 2m10s
Build and Push Web Docker Image / build (push) Successful in 3m33s

This commit is contained in:
2025-12-13 01:39:31 +01:00
parent bad9a4e547
commit 79fc89a7f4
8 changed files with 1459 additions and 609 deletions

View File

@@ -1,35 +1,18 @@
"""
Self-hosted LangGraph agent server using AG-UI protocol.
Self-hosted PydanticAI agent server using AG-UI protocol.
"""
import os
from fastapi import FastAPI
import uvicorn
from dotenv import load_dotenv
from copilotkit import LangGraphAGUIAgent
from ag_ui_langgraph import add_langgraph_fastapi_endpoint
from main import graph
from pydantic_ai.ui.ag_ui.app import AGUIApp
from main import agent
load_dotenv()
app = FastAPI(title="Cavepedia Agent")
add_langgraph_fastapi_endpoint(
app=app,
agent=LangGraphAGUIAgent(
name="vpi_1000",
description="AI assistant with access to cave-related information through the Cavepedia MCP server",
graph=graph,
),
path="/",
)
@app.get("/health")
def health():
"""Health check."""
return {"status": "ok"}
# Convert PydanticAI agent to ASGI app with AG-UI protocol
app = AGUIApp(agent)
if __name__ == "__main__":