Spaces:
Runtime error
Runtime error
add more option
Browse files
app.py
CHANGED
|
@@ -7,21 +7,23 @@ import random
|
|
| 7 |
|
| 8 |
|
| 9 |
random_number = random.randint(3000, 10000)
|
|
|
|
| 10 |
model = GroqModel('llama-3.1-70b-versatile', api_key='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')
|
| 11 |
|
| 12 |
|
| 13 |
-
async def onClick(vacationType,familyType):
|
| 14 |
agent = Agent(model,system_prompt=(
|
| 15 |
f"imagine the year is {random_number} and space travel is normal",
|
| 16 |
"Mankind has discovered aliens some are more advance then us some are not",
|
| 17 |
"You are a travel agent and depending on the" + vacationType +"you will list down some destinations",
|
| 18 |
-
"Also answer based on "+familyType+ ""
|
| 19 |
))
|
| 20 |
result_1 = agent.run_sync("for space travel which planet is the best")
|
|
|
|
| 21 |
print(result_1)
|
| 22 |
|
| 23 |
-
def asyncOnClick(vacationType,familyType):
|
| 24 |
-
asyncio.run(onClick(vacationType,familyType))
|
| 25 |
|
| 26 |
async def main():
|
| 27 |
|
|
@@ -38,12 +40,18 @@ async def main():
|
|
| 38 |
|
| 39 |
#st.markdown(result_1.data)
|
| 40 |
#st.button(label="Search",type="primary",on_click=onClick)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
if st.button("Search"):
|
| 46 |
-
asyncOnClick(vacationType,family)
|
| 47 |
|
| 48 |
if __name__ == '__main__':
|
| 49 |
import asyncio
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
random_number = random.randint(3000, 10000)
|
| 10 |
+
body = ""
|
| 11 |
model = GroqModel('llama-3.1-70b-versatile', api_key='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')
|
| 12 |
|
| 13 |
|
| 14 |
+
async def onClick(vacationType,familyType,duration,purpose,interests):
|
| 15 |
agent = Agent(model,system_prompt=(
|
| 16 |
f"imagine the year is {random_number} and space travel is normal",
|
| 17 |
"Mankind has discovered aliens some are more advance then us some are not",
|
| 18 |
"You are a travel agent and depending on the" + vacationType +"you will list down some destinations",
|
| 19 |
+
"Also answer based on "+familyType+ "," + duration +","+purpose + "and"+interests
|
| 20 |
))
|
| 21 |
result_1 = agent.run_sync("for space travel which planet is the best")
|
| 22 |
+
body = result_1
|
| 23 |
print(result_1)
|
| 24 |
|
| 25 |
+
def asyncOnClick(vacationType,familyType,duration,purpose,interests):
|
| 26 |
+
asyncio.run(onClick(vacationType,familyType,duration,purpose,interests))
|
| 27 |
|
| 28 |
async def main():
|
| 29 |
|
|
|
|
| 40 |
|
| 41 |
#st.markdown(result_1.data)
|
| 42 |
#st.button(label="Search",type="primary",on_click=onClick)
|
| 43 |
+
st.subheader("Travel Preferences")
|
| 44 |
+
vacationType = st.selectbox(label="Travel Style",options=("Budget","Mid-budget","High-end"))
|
| 45 |
+
family = st.selectbox(label="Group Size",options=("Solo","Small family","Large family","Destination weeding"))
|
| 46 |
+
duration = st.selectbox(label="Duration of Trip",options=("5 days","2 weeks","1 month","more then 1 month"))
|
| 47 |
+
purpose = st.selectbox(label="Purpose of Travel",options=("Honeymoon","anniversary","family vacation","corporate retreat"))
|
| 48 |
+
interests = st.selectbox(label="Special Interestl",options=("Photography","gastronomy","wildlife","art"))
|
| 49 |
|
| 50 |
+
st.subheader("Answer")
|
| 51 |
+
st.caption(body)
|
| 52 |
|
| 53 |
if st.button("Search"):
|
| 54 |
+
asyncOnClick(vacationType,family,duration,purpose,interests)
|
| 55 |
|
| 56 |
if __name__ == '__main__':
|
| 57 |
import asyncio
|