fixed a few bug - travel agent working perfect now

This commit is contained in:
Madhu 2025-03-17 19:19:11 +05:30
parent fc02a7f3dd
commit 634ab02171

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)