Spaces:
Sleeping
Sleeping
client.textgeneration
Browse files
app.py
CHANGED
|
@@ -127,7 +127,7 @@ def respond(destination, transportation, date, preference, include_options, mino
|
|
| 127 |
|
| 128 |
prompt = f"""
|
| 129 |
**Travel Plan Details:**
|
| 130 |
-
|
| 131 |
- **Transportation:** {transportation}
|
| 132 |
- **Travel Date:** {date}
|
| 133 |
- **Budget Preference:** {preference}
|
|
@@ -137,7 +137,7 @@ def respond(destination, transportation, date, preference, include_options, mino
|
|
| 137 |
"""
|
| 138 |
|
| 139 |
try:
|
| 140 |
-
response = client.
|
| 141 |
travel_guide_output = response.text
|
| 142 |
return response.text
|
| 143 |
except Exception as e:
|
|
@@ -159,7 +159,7 @@ def chatbot_respond(message, chat_history):
|
|
| 159 |
"""
|
| 160 |
|
| 161 |
try:
|
| 162 |
-
response = client.
|
| 163 |
return response.text
|
| 164 |
except Exception as e:
|
| 165 |
return f"An error occurred: {e}"
|
|
|
|
| 127 |
|
| 128 |
prompt = f"""
|
| 129 |
**Travel Plan Details:**
|
| 130 |
+
- **To:** {destination}
|
| 131 |
- **Transportation:** {transportation}
|
| 132 |
- **Travel Date:** {date}
|
| 133 |
- **Budget Preference:** {preference}
|
|
|
|
| 137 |
"""
|
| 138 |
|
| 139 |
try:
|
| 140 |
+
response = client.text_generation([{"role": "user", "parts": [{"text": prompt}]}])
|
| 141 |
travel_guide_output = response.text
|
| 142 |
return response.text
|
| 143 |
except Exception as e:
|
|
|
|
| 159 |
"""
|
| 160 |
|
| 161 |
try:
|
| 162 |
+
response = client.text_generation([{"role": "user", "parts": [{"text": prompt}]}])
|
| 163 |
return response.text
|
| 164 |
except Exception as e:
|
| 165 |
return f"An error occurred: {e}"
|