Add Notification Backend Protocol
All checks were successful
CI / ci (pull_request) Successful in 18s

This commit is contained in:
2026-03-05 06:41:28 +00:00
parent ba6fde1b15
commit 2370d7de96
4 changed files with 30 additions and 82 deletions

View File

@@ -1,5 +1,7 @@
"""ADK agent with vector search RAG tool."""
from functools import partial
from google import genai
from google.adk.agents.llm_agent import Agent
from google.adk.runners import Runner
@@ -10,8 +12,9 @@ from google.genai.types import Content, Part
from va_agent.auth import auth_headers_provider
from va_agent.config import settings
from va_agent.dynamic_instruction import provide_dynamic_instruction
from va_agent.governance import GovernancePlugin
from va_agent.notifications import NotificationService
from va_agent.notifications import FirestoreNotificationBackend
from va_agent.session import FirestoreSessionService
# MCP Toolset for RAG knowledge search
@@ -32,7 +35,7 @@ session_service = FirestoreSessionService(
)
# Notification service
notification_service = NotificationService(
notification_service = FirestoreNotificationBackend(
db=firestore_db,
collection_path=settings.notifications_collection_path,
max_to_notify=settings.notifications_max_to_notify,
@@ -43,11 +46,11 @@ governance = GovernancePlugin()
agent = Agent(
model=settings.agent_model,
name=settings.agent_name,
instruction=partial(provide_dynamic_instruction, notification_service),
static_instruction=Content(
role="user",
parts=[Part(text=settings.agent_instructions)],
),
instruction=settings.agent_instructions,
tools=[toolset],
after_model_callback=governance.after_model_callback,
)