Pijush2023 commited on
Commit
4624ca2
·
verified ·
1 Parent(s): 4305e2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -45,6 +45,12 @@ from langchain_core.output_parsers import StrOutputParser
45
  from langchain_core.runnables import RunnableBranch, RunnableLambda, RunnableParallel, RunnablePassthrough
46
  from serpapi.google_search import GoogleSearch
47
 
 
 
 
 
 
 
48
 
49
 
50
 
@@ -910,7 +916,7 @@ def format_hotel_info(name, link, location, rate_per_night, total_rate, descript
910
  - Description: {description}
911
  """
912
 
913
- def fetch_google_hotels(query="Birmingham Hotel", check_in="2024-08-16", check_out="2024-08-20", adults=2):
914
  # Introductory prompt for hotels
915
  intro_prompt = "Here are some of the best hotels in Birmingham, Alabama, for your stay. Each of these options offers a unique experience, whether you're looking for luxury, comfort, or convenience:"
916
 
@@ -972,7 +978,7 @@ def format_flight_info(flight_number, departure_airport, departure_time, arrival
972
  - Airplane: {airplane}
973
  """
974
 
975
- def fetch_google_flights(departure_id="JFK", arrival_id="BHM", outbound_date="2024-08-16", return_date="2024-08-20"):
976
  # Introductory prompt for flights
977
  intro_prompt = "Here are some available flights from JFK to Birmingham, Alabama. These options provide a range of times and durations to fit your travel needs:"
978
 
 
45
  from langchain_core.runnables import RunnableBranch, RunnableLambda, RunnableParallel, RunnablePassthrough
46
  from serpapi.google_search import GoogleSearch
47
 
48
+ #API AutoDate Fix Up
49
+ def get_current_date1():
50
+ return datetime.now().strftime("%Y-%m-%d")
51
+
52
+ # Usage
53
+ current_date1 = get_current_date1()
54
 
55
 
56
 
 
916
  - Description: {description}
917
  """
918
 
919
+ def fetch_google_hotels(query="Birmingham Hotel", check_in=current_date1, check_out="2024-08-20", adults=2):
920
  # Introductory prompt for hotels
921
  intro_prompt = "Here are some of the best hotels in Birmingham, Alabama, for your stay. Each of these options offers a unique experience, whether you're looking for luxury, comfort, or convenience:"
922
 
 
978
  - Airplane: {airplane}
979
  """
980
 
981
+ def fetch_google_flights(departure_id="JFK", arrival_id="BHM", outbound_date=current_date1, return_date="2024-08-20"):
982
  # Introductory prompt for flights
983
  intro_prompt = "Here are some available flights from JFK to Birmingham, Alabama. These options provide a range of times and durations to fit your travel needs:"
984