forked from nicknochnack/ACPWalkthrough
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy patha2a_research_agent.py
More file actions
33 lines (24 loc) · 1.13 KB
/
a2a_research_agent.py
File metadata and controls
33 lines (24 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import uvicorn
from google.adk.a2a.utils.agent_to_a2a import to_a2a
from google.adk.agents.llm_agent import LlmAgent
from google.adk.tools import google_search
from helpers import setup_env
setup_env()
PORT = int(os.getenv("RESEARCH_AGENT_PORT"))
HOST = os.getenv("AGENT_HOST")
def main() -> None:
# Create the Agent
root_agent = LlmAgent(
model="gemini-3.1-pro-preview",
name="HealthResearchAgent",
tools=[google_search],
description="Provides healthcare information about symptoms, health conditions, treatments, and procedures using up-to-date web resources.",
instruction="You are a healthcare research agent tasked with providing information about health conditions. Use the google_search tool to find information on the web about options, symptoms, treatments, and procedures. Cite your sources in your responses. Output all of the information you find.",
)
# Make the agent A2A-compatible
a2a_app = to_a2a(root_agent, host=HOST, port=PORT)
print("Running Health Research Agent")
uvicorn.run(a2a_app, host=HOST, port=PORT)
if __name__ == "__main__":
main()