use pydantic

This commit is contained in:
2025-12-13 04:35:40 +01:00
parent 79fc89a7f4
commit 955f992f8e
23 changed files with 1340 additions and 5363 deletions

32
web/agent/src/main.py Normal file
View File

@@ -0,0 +1,32 @@
"""
Self-hosted PydanticAI agent server using AG-UI protocol.
"""
import os
import logging
from dotenv import load_dotenv
# Set up logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
# Load environment variables BEFORE importing agent
load_dotenv()
import uvicorn
from src.agent import agent
logger.info("Creating AG-UI app...")
# Convert PydanticAI agent to ASGI app with AG-UI protocol
app = agent.to_ag_ui(debug=True)
logger.info("AG-UI app created successfully")
if __name__ == "__main__":
port = int(os.getenv("PORT", "8000"))
uvicorn.run(app, host="127.0.0.1", port=port)