Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from agent import agent_run_config
from fastapi import FastAPI
from fastmcp import FastMCP

from google.adk.a2a.utils.agent_card_builder import AgentCardBuilder
from veadk.a2a.ve_a2a_server import init_app
from veadk.runner import Runner
from veadk.tracing.telemetry.exporters.apmplus_exporter import APMPlusExporter
Expand All @@ -39,6 +39,8 @@
agent = agent_run_config.agent
short_term_memory = agent_run_config.short_term_memory

agent_card_builder = AgentCardBuilder(agent=agent)


def load_tracer() -> None:
EXPORTER_REGISTRY = {
Expand Down Expand Up @@ -104,18 +106,25 @@ async def run_agent(
return run_agent


async def agent_card() -> dict:
agent_card = await agent_card_builder.build()
return agent_card.model_dump()


load_tracer()

# Build a run_agent function for building MCP server
run_agent_func = build_mcp_run_agent_func()

a2a_app = init_app(
server_url="0.0.0.0",
app_name=app_name,
agent=agent,
short_term_memory=short_term_memory,
)

# Build a run_agent function for building MCP server
run_agent_func = build_mcp_run_agent_func()
a2a_app.post("/run_agent", operation_id="run_agent", tags=["mcp"])(run_agent_func)
a2a_app.get("/agent_card", operation_id="agent_card", tags=["mcp"])(agent_card)


# === Build mcp server ===
Expand Down