Skip to content

local_travel_agent: researcher agent is never invoked; SerpAPI key is dead-config #950

Description

@thejesh23

Where

starter_ai_agents/ai_travel_agent/local_travel_agent.py.

What

The local variant defines two agents — a researcher (with SerpApiTools) and a planner — but the button handler only calls the planner:

# lines 74–93: researcher = Agent(..., tools=[SerpApiTools(api_key=serp_api_key)], ...)
# lines 94–113: planner = Agent(...)  # no tools

if st.button("Generate Itinerary"):
    with st.spinner("Processing..."):
        # Get the response from the assistant
        response: RunOutput = planner.run(f"{destination} for {num_days} days", stream=False)

researcher is never called anywhere. That means:

  1. The SerpAPI key the user is prompted for (line 71) is collected but never used — no web search ever runs.
  2. The "AI Travel Planner" for the local Llama-3.2 variant produces an itinerary purely from the model's own weights, with none of the web research that the online variant (travel_agent.py) actually does.
  3. The prompt handed to planner is also just f"{destination} for {num_days} days" — no research context at all.

Compare with the online travel_agent.py (lines 127–141) which correctly runs the researcher first, then feeds research_results.content into the planner.

Additional bug in the same file (fixed in the same PR)

Same file, lines 87–88 — the researcher's instructions list is missing a comma between two items:

instructions=[
    "Given a travel destination and the number of days the user wants to travel for, first generate a list of 3 search terms related to that destination and the number of days.",
    "For each search term, `search_google` and analyze the results."   # <-- missing comma
    "From the results of all searches, return the 10 most relevant results to the user's preferences.",
    "Remember: the quality of the results is important.",
],

Python silently concatenates the two adjacent string literals, so the list contains 3 items instead of the intended 4, with two instructions run-on into a single string with no separator ("…analyze the results.From the results…"). The same bug exists in travel_agent.py at lines 89–90.

Fix

Mirror the researcher→planner flow from travel_agent.py in local_travel_agent.py, and add the missing commas in both files. PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions