from veadk import Agent, Runner
from veadk.a2a.agent_card import get_agent_card
from veadk.prompts.agent_default_prompt import DEFAULT_DESCRIPTION, DEFAULT_INSTRUCTION
from google.adk.a2a.executor.a2a_agent_executor import A2aAgentExecutor
from agentkit.apps import AgentkitA2aApp
logger = logging.getLogger(__name__)
a2a_app = AgentkitA2aApp()
def query_it_policy(topic: str) -> dict[str, str]:
"""Query the internal IT service policy for a topic."""
"vpn": "Open the company VPN client, sign in with SSO, and complete MFA verification.",
"password": "Open the account portal and select Reset password. Complete identity verification before setting a new password.",
"software": "Submit a software installation request in the IT service portal and wait for approval.",
normalized_topic = topic.lower().strip()
if "vpn" in normalized_topic:
elif any(keyword in normalized_topic for keyword in ("password", "passwd", "reset", "account", "credential")):
elif any(keyword in normalized_topic for keyword in ("software", "install", "installation", "app", "application", "program")):
"result": "No matching policy was found. Contact the IT service desk for assistance."
return {"result": policies[key]}
agent_name = "it_support_agent"
description = "An enterprise IT service assistant."
"You are an enterprise IT service assistant. "
"Use query_it_policy when the user asks about VPN, passwords, or software installation. "
"Do not invent policies that are not returned by the tool."
tools = [query_it_policy]
description=description,
instruction=system_prompt,
runner = Runner(agent=agent)
@a2a_app.agent_executor(runner=runner)
class MyAgentExecutor(A2aAgentExecutor):
if __name__ == "__main__":
from a2a.types import AgentCard, AgentProvider, AgentSkill, AgentCapabilities
capabilities=AgentCapabilities(streaming=True),
description=agent.description,
default_input_modes=["text"],
default_output_modes=["text"],
provider=AgentProvider(organization="veadk", url=""),
skills=[AgentSkill(id="0", name="chat", description="Chat", tags=["chat"])],
url="http://0.0.0.0:8000",