Files
adk-python/contributing/samples/a2a_root/agent.py
T
Google Team Member fa64545a9d fix: Fix the path for agent card in A2A demo
`AGENT_CARD_WELL_KNOWN_PATH` already contains a leading slash so is not needed in the `agent_card` URL.

PiperOrigin-RevId: 796543208
2025-08-18 13:04:38 -07:00

25 lines
947 B
Python
Executable File

# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from google.adk.agents.remote_a2a_agent import AGENT_CARD_WELL_KNOWN_PATH
from google.adk.agents.remote_a2a_agent import RemoteA2aAgent
root_agent = RemoteA2aAgent(
name="hello_world_agent",
description=(
"Helpful assistant that can roll dice and check if numbers are prime."
),
agent_card=f"http://localhost:8001/{AGENT_CARD_WELL_KNOWN_PATH}",
)