Spaces:
Runtime error
Runtime error
select box
Browse files
app.py
CHANGED
|
@@ -8,16 +8,24 @@ import random
|
|
| 8 |
|
| 9 |
random_number = random.randint(3000, 10000)
|
| 10 |
model = GroqModel('llama-3.1-70b-versatile', api_key='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')
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
f"imagine the year is {random_number} and space travel is normal",
|
| 13 |
"Mankind has discovered aliens some are more advance then us some are not",
|
| 14 |
-
"You are a travel agent and depending on the
|
| 15 |
-
|
| 16 |
-
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
async def main():
|
| 19 |
|
| 20 |
-
result_1 = agent.run_sync("for space travel which planet is the best")
|
| 21 |
##The Zorvath
|
| 22 |
|
| 23 |
|
|
@@ -28,7 +36,14 @@ async def main():
|
|
| 28 |
#print(result_2.data)
|
| 29 |
|
| 30 |
|
| 31 |
-
st.markdown(result_1.data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
if __name__ == '__main__':
|
| 34 |
import asyncio
|
|
|
|
| 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 |
|
| 28 |
+
#result_1 = agent.run_sync("for space travel which planet is the best")
|
| 29 |
##The Zorvath
|
| 30 |
|
| 31 |
|
|
|
|
| 36 |
#print(result_2.data)
|
| 37 |
|
| 38 |
|
| 39 |
+
#st.markdown(result_1.data)
|
| 40 |
+
#st.button(label="Search",type="primary",on_click=onClick)
|
| 41 |
+
|
| 42 |
+
vacationType = st.selectbox(label="Select Vacation type",options=("Budget","Mid-budget","High-end"))
|
| 43 |
+
family = st.selectbox(label="Select Family type",options=("Solo","Small family","Large family","Destination weeding"))
|
| 44 |
+
|
| 45 |
+
if st.button("Search"):
|
| 46 |
+
asyncOnClick(vacationType,family)
|
| 47 |
|
| 48 |
if __name__ == '__main__':
|
| 49 |
import asyncio
|