sarim commited on
Commit
5417c06
·
1 Parent(s): 12c0550

custom result

Browse files
Files changed (2) hide show
  1. app.py +8 -7
  2. planet_model.py +16 -0
app.py CHANGED
@@ -3,6 +3,7 @@ from pydantic_ai import Agent
3
  from pydantic_ai.models.groq import GroqModel
4
  import nest_asyncio
5
  import random
 
6
 
7
 
8
 
@@ -18,11 +19,11 @@ async def onClick(vacationType,familyType,duration,purpose,interests):
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
  "Be creative made-up different kinds of planets, aliens, atmosphere",
21
- "Each recommendation should include:",
22
- "1. The planet's name and description of its atmosphere.",
23
- "2. Details about the local alien species and their culinary traditions.",
24
- "3. A signature dish or food experience.",
25
- "4. Key activities or attractions for a traveler interested in food and culture."
26
  "Draw inspiration from sources like No Man’s Sky, Hitchhiker’s Guide to the Galaxy, and original creative ideas. Be imaginative, and ensure variety in your suggestions to cater to different tastes.",
27
  "Cosmic Myths: Stories from Norse (Yggdrasil), Hindu (Churning of the Ocean), or Aboriginal (Dreamtime) traditions.",
28
  "Alien Archetypes: Trickster gods, celestial guardians, or ancient interstellar ruins.",
@@ -35,7 +36,7 @@ async def onClick(vacationType,familyType,duration,purpose,interests):
35
  "Visual Arts: Imagery from H.R. Giger (Alien) or Moebius (The Incal).",
36
  "Graphic Novels: Saga, Transmetropolitan."
37
  ),
38
-
39
  )
40
  result_1 = agent.run_sync(user_prompt="for space travel which planet is the best")
41
  result = result_1
@@ -65,7 +66,7 @@ async def main():
65
  vacationType = st.selectbox(label="Travel Style",options=("Budget","Mid-budget","High-end"))
66
  family = st.selectbox(label="Group Size",options=("Solo","Small family","Large family","Destination weeding"))
67
  duration = st.selectbox(label="Duration of Trip",options=("5 days","2 weeks","1 month","more then 1 month"))
68
- purpose = st.selectbox(label="Purpose of Travel",options=("Honeymoon","anniversary","family vacation","corporate retreat","vacation"))
69
  interests = st.selectbox(label="Special Interestl",options=("Photography","gastronomy","wildlife","art"))
70
 
71
 
 
3
  from pydantic_ai.models.groq import GroqModel
4
  import nest_asyncio
5
  import random
6
+ import planet_model as customModel
7
 
8
 
9
 
 
19
  "You are a travel agent and depending on the" + vacationType +"you will list down some destinations",
20
  "Also answer based on "+familyType+ "," + duration +","+purpose + "and"+interests,
21
  "Be creative made-up different kinds of planets, aliens, atmosphere",
22
+ # "Each recommendation should include:",
23
+ # "1. The planet's name and description of its atmosphere.",
24
+ # "2. Details about the local alien species and their culinary traditions.",
25
+ # "3. A signature dish or food experience.",
26
+ # "4. Key activities or attractions for a traveler interested in food and culture."
27
  "Draw inspiration from sources like No Man’s Sky, Hitchhiker’s Guide to the Galaxy, and original creative ideas. Be imaginative, and ensure variety in your suggestions to cater to different tastes.",
28
  "Cosmic Myths: Stories from Norse (Yggdrasil), Hindu (Churning of the Ocean), or Aboriginal (Dreamtime) traditions.",
29
  "Alien Archetypes: Trickster gods, celestial guardians, or ancient interstellar ruins.",
 
36
  "Visual Arts: Imagery from H.R. Giger (Alien) or Moebius (The Incal).",
37
  "Graphic Novels: Saga, Transmetropolitan."
38
  ),
39
+ result_type = customModel.Planet
40
  )
41
  result_1 = agent.run_sync(user_prompt="for space travel which planet is the best")
42
  result = result_1
 
66
  vacationType = st.selectbox(label="Travel Style",options=("Budget","Mid-budget","High-end"))
67
  family = st.selectbox(label="Group Size",options=("Solo","Small family","Large family","Destination weeding"))
68
  duration = st.selectbox(label="Duration of Trip",options=("5 days","2 weeks","1 month","more then 1 month"))
69
+ purpose = st.selectbox(label="Purpose of Travel",options=("Honeymoon","anniversary","family vacation","corporate retreat","vacation","Food tour"))
70
  interests = st.selectbox(label="Special Interestl",options=("Photography","gastronomy","wildlife","art"))
71
 
72
 
planet_model.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pydantic import BaseModel
2
+
3
+ class Planet(BaseModel):
4
+ def __init__(self, name, atmosphere, species, signature_dish, activities):
5
+ self.name = name
6
+ self.atmosphere = atmosphere
7
+ self.species = species
8
+ self.signature_dish = signature_dish
9
+ self.activities = activities
10
+
11
+ def describe(self):
12
+ return f"Planet: {self.name}\n" \
13
+ f"Atmosphere: {self.atmosphere}\n" \
14
+ f"Species: {self.species}\n" \
15
+ f"Signature Dish: {self.signature_dish}\n" \
16
+ f"Activities: {', '.join(self.activities)}"