Merge pull request #147 from Madhuvod/travel-error

fix: updated travel agent code
This commit is contained in:
Shubham Saboo 2025-03-17 21:10:53 -05:00 committed by GitHub
commit 262355eb71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,7 +61,21 @@ if openai_api_key and serp_api_key:
num_days = st.number_input("How many days do you want to travel for?", min_value=1, max_value=30, value=7)
if st.button("Generate Itinerary"):
with st.spinner("Processing..."):
# Get the response from the assistant
response = planner.run(f"{destination} for {num_days} days", stream=False)
with st.spinner("Researching your destination..."):
# First get research results
research_results = researcher.run(f"Research {destination} for a {num_days} day trip", stream=False)
# Show research progress
st.write("✓ Research completed")
with st.spinner("Creating your personalized itinerary..."):
# Pass research results to planner
prompt = f"""
Destination: {destination}
Duration: {num_days} days
Research Results: {research_results.content}
Please create a detailed itinerary based on this research.
"""
response = planner.run(prompt, stream=False)
st.write(response.content)