feat: migrate agent core to pydantic-ai framework

This commit is contained in:
Michael
2026-08-02 17:04:44 +02:00
parent 4f7059788d
commit be0d8dc24b
10 changed files with 109 additions and 117 deletions
+4 -2
View File
@@ -1,8 +1,11 @@
import logging
from typing import Any, Callable
from pydantic_ai import Agent, RunContext
from pydantic_ai.exceptions import ModelRetry
from core.agent import BaseAgent
from core.prompts import NOTIFICATION_READER_SYSTEM_PROMPT
from core.notification_tools import NotificationTools
from core.schemas import NotificationDecision
logger: logging.Logger = logging.getLogger("agent-notification-reader")
@@ -13,13 +16,12 @@ class NotificationNoToolCalledError(Exception):
class NotificationReaderAgent(BaseAgent):
"""AI agent that reviews Gitea notifications and decides how to route them."""
"""AI agent that reviews Gitea notifications and decides how to route them using Pydantic AI."""
def __init__(self, model_name: str) -> None:
super().__init__(model_name)
self.system_prompt: str = NOTIFICATION_READER_SYSTEM_PROMPT
async def decide_notification(
self,
mission: str,