Skip to content

Commit f4f076d

Browse files
committed
Update agent and tool names
Signed-off-by: Prasad Mujumdar <prasad@okahu.ai>
1 parent fe82ab0 commit f4f076d

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

python/adk-travel-agent/adk_travel_agent.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from monocle_apptrace import setup_monocle_telemetry
1919
setup_monocle_telemetry(workflow_name = 'examples', monocle_exporters_list = 'file')
2020

21-
def adk_book_flight_5(from_airport: str, to_airport: str) -> dict:
21+
def adk_book_flight(from_airport: str, to_airport: str) -> dict:
2222
"""Books a flight from one airport to another.
2323
2424
Args:
@@ -30,11 +30,11 @@ def adk_book_flight_5(from_airport: str, to_airport: str) -> dict:
3030
dict: status and message.
3131
"""
3232
return {
33-
"status": "error",
34-
"message": f"Technical problem occurred while booking flight from {from_airport} to {to_airport}."
33+
"status": "success",
34+
"message": f"Booked the flight from {from_airport} to {to_airport}."
3535
}
3636

37-
def adk_book_hotel_5(hotel_name: str, city: str) -> dict:
37+
def adk_book_hotel(hotel_name: str, city: str) -> dict:
3838
"""Books a hotel for a stay.
3939
4040
Args:
@@ -55,27 +55,27 @@ def adk_book_hotel_5(hotel_name: str, city: str) -> dict:
5555
contentConfig: types.GenerateContentConfig = types.GenerateContentConfig(max_output_tokens=MAX_OUTPUT_TOKENS)
5656

5757
flight_booking_agent = LlmAgent(
58-
name="adk_flight_booking_agent_5",
58+
name="adk_flight_booking_agent",
5959
model="gemini-2.0-flash",
6060
description= "Agent to book flights based on user queries.",
6161
# instruction= "You are a helpful agent who can assist users in booking flights. If you are asked about flight bookings, provide the relevant information.",
6262
instruction= "You are a helpful agent who can assist users in booking flights. You only handle flight booking. Just handle that part from what the user says, ignore other parts of the requests.",
6363
generate_content_config=contentConfig,
64-
tools=[adk_book_flight_5] # Define flight booking tools here
64+
tools=[adk_book_flight] # Define flight booking tools here
6565
)
6666

6767
hotel_booking_agent = LlmAgent(
68-
name="adk_hotel_booking_agent_5",
68+
name="adk_hotel_booking_agent",
6969
model="gemini-2.0-flash",
7070
description= "Agent to book hotels based on user queries.",
7171
# instruction= "You are a helpful agent who can assist users in booking hotels. If you are asked about hotel bookings, provide the relevant information. If not, then just stay silent.",
7272
instruction= "You are a helpful agent who can assist users in booking hotels. When you receive a request containing both hotel and non-hotel bookings, focus on processing the hotel booking portion while gracefully ignoring non-hotel parts. Always try to identify and process any hotel booking requests present in the user's message.",
7373
generate_content_config=contentConfig,
74-
tools=[adk_book_hotel_5] # Define hotel booking tools here
74+
tools=[adk_book_hotel] # Define hotel booking tools here
7575
)
7676

7777
trip_summary_agent = LlmAgent(
78-
name="adk_trip_summary_agent_5",
78+
name="adk_trip_summary_agent",
7979
model="gemini-2.0-flash",
8080
description= "Summarize the travel details from hotel bookings and flight bookings agents.",
8181
instruction= "Summarize the travel details from hotel bookings and flight bookings agents. Be concise in response and provide a single sentence summary.",
@@ -84,7 +84,7 @@ def adk_book_hotel_5(hotel_name: str, city: str) -> dict:
8484
)
8585

8686
root_agent = SequentialAgent(
87-
name="adk_supervisor_agent_5",
87+
name="adk_supervisor_agent",
8888
description=
8989
"""
9090
You are the supervisor agent that coordinates the flight booking and hotel booking.

python/adk-travel-agent/test_adk_travel_agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
{
3030
"span_type": "agentic.tool.invocation",
3131
"entities": [
32-
{"type": "tool", "name": "adk_book_flight_5"},
33-
{"type": "agent", "name": "adk_flight_booking_agent_5"}
32+
{"type": "tool", "name": "adk_book_flight"},
33+
{"type": "agent", "name": "adk_flight_booking_agent"}
3434
],
3535
"expect_errors": True,
3636
}
@@ -57,7 +57,7 @@
5757
# "test_input": ["Book a flight from San Francisco to Mumbai for 26th Nov 2025."],
5858
# "mock_tools": [
5959
# {
60-
# "name": "adk_book_flight_5",
60+
# "name": "adk_book_flight",
6161
# "type": "tool.adk",
6262
# "response": {
6363
# "status": "success",
@@ -69,7 +69,7 @@
6969
# {
7070
# "span_type": "agentic.tool.invocation",
7171
# "entities": [
72-
# {"type": "tool", "name": "adk_book_flight_5"},
72+
# {"type": "tool", "name": "adk_book_flight"},
7373
# ],
7474
# "output": "Successfully booked a flight from San Francisco to Mumbai.",
7575
# "comparer": "similarity",

python/lg-travel-agent/lg_travel_agent.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
from monocle_apptrace import setup_monocle_telemetry
2121
setup_monocle_telemetry(workflow_name = 'examples', monocle_exporters_list = 'file')
2222

23-
@tool("okahu-demo-lg-tool_book_hotel", description="Book a hotel for a stay")
23+
@tool("lg-tool_book_hotel", description="Book a hotel for a stay")
2424
def book_hotel(hotel_name: str):
2525
"""Book a hotel"""
2626
return f"Successfully booked a stay at {hotel_name}."
2727

28-
@tool("okahu-demo-lg-tool_book_flight", description="Book a flight from one airport to another")
28+
@tool("lg-tool_book_flight", description="Book a flight from one airport to another")
2929
def book_flight(from_airport: str, to_airport: str):
3030
"""Book a flight"""
3131
return f"Successfully booked a flight from {from_airport} to {to_airport}."
@@ -54,24 +54,24 @@ async def setup_agents():
5454
model="openai:gpt-4o",
5555
tools=[book_flight],
5656
prompt="You are a flight booking assistant",
57-
name="okahu-demo-lg-agent-air_travel_assistant"
57+
name="lg-agent-air_travel_assistant"
5858
)
5959

6060
hotel_assistant = create_react_agent(
6161
model="openai:gpt-4o",
6262
tools=[book_hotel],
6363
prompt="You are a hotel booking assistant",
64-
name="okahu-demo-lg-agent-lodging_assistant"
64+
name="lg-agent-lodging_assistant"
6565
)
6666

6767
weather_agent = create_react_agent(
6868
model="openai:gpt-4o",
6969
tools=weather_tools,
7070
prompt="You are a weather information assistant. Please use the tool available to you for checking weather. Extract city name from the user query and pass it to the weather tool.",
71-
name="okahu-demo-lg-agent-weather_assistant"
71+
name="lg-agent-weather_assistant"
7272
)
7373
supervisor = create_supervisor(
74-
supervisor_name="okahu-demo-lg-agent-travel_supervisor",
74+
supervisor_name="lg-agent-travel_supervisor",
7575
agents=[flight_assistant, hotel_assistant, weather_agent],
7676
model=ChatOpenAI(model="gpt-4o", max_completion_tokens=MAX_OUTPUT_TOKENS),
7777
prompt=(

python/lg-travel-agent/test_lg_travel_agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
# {
1919
# "span_type": "agentic.tool.invocation",
2020
# "entities": [
21-
# {"type": "tool", "name": "okahu-demo-lg-tool_book_flight"},
22-
# {"type": "agent", "name": "okahu-demo-lg-agent-air_travel_assistant"}
21+
# {"type": "tool", "name": "-lg-tool_book_flight"},
22+
# {"type": "agent", "name": "-lg-agent-air_travel_assistant"}
2323
# ],
2424
# }
2525
# ]
@@ -30,7 +30,7 @@
3030
# {
3131
# "span_type": "agentic.invocation",
3232
# "entities": [
33-
# {"type": "agent", "name": "okahu-demo-lg-agent-travel_supervisor"}
33+
# {"type": "agent", "name": "-lg-agent-travel_supervisor"}
3434
# ],
3535
# "expect_errors": True,
3636
# }
@@ -40,7 +40,7 @@
4040
"test_input": ["Book a flight from San Francisco to Mumbai for 26th Nov 2025."],
4141
# "mock_tools": [
4242
# {
43-
# "name": "okahu-demo-lg-tool_book_flight",
43+
# "name": "-lg-tool_book_flight",
4444
# "type": "tool.adk",
4545
# "response": {
4646
# "status": "success",
@@ -52,7 +52,7 @@
5252
{
5353
"span_type": "agentic.tool.invocation",
5454
"entities": [
55-
{"type": "tool", "name": "okahu-demo-lg-tool_book_flight"},
55+
{"type": "tool", "name": "-lg-tool_book_flight"},
5656
],
5757
"output": "Successfully booked a flight from San Francisco to Mumbai.",
5858
"comparer": "similarity",

0 commit comments

Comments
 (0)