Spaces:
Sleeping
Sleeping
Update models.py
Browse files
models.py
CHANGED
|
@@ -1,39 +1,66 @@
|
|
| 1 |
-
# models.py
|
| 2 |
-
from pydantic import BaseModel, Field
|
| 3 |
-
from typing import List, Dict, Optional
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# models.py
|
| 2 |
+
from pydantic import BaseModel, Field
|
| 3 |
+
from typing import List, Dict, Optional
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class TravelDataInput(BaseModel):
|
| 7 |
+
destination: Optional[str] = Field(None, description="e.g., Neelum Valley")
|
| 8 |
+
location_type: str = Field(..., description="City, Beach, Mountain, etc.")
|
| 9 |
+
province: str = Field(..., description="Punjab, Sindh, etc.")
|
| 10 |
+
starting_location: str = Field(..., description="e.g., Islamabad")
|
| 11 |
+
gender: str = Field(..., description="Male, Female, Mixed")
|
| 12 |
+
num_people: int = Field(..., gt=0, description="Number of people")
|
| 13 |
+
has_children: bool = Field(False, description="Whether children are present")
|
| 14 |
+
activity_type: str = Field(..., description="Adventure, Sightseeing, Both")
|
| 15 |
+
travel_group: str = Field(..., description="Solo, With partner, etc.")
|
| 16 |
+
preferences: List[str] = Field([], description="Cultural Experience, Food, etc.")
|
| 17 |
+
budget: int = Field(0, ge=0, description="Budget in PKR")
|
| 18 |
+
num_days: int = Field(..., gt=0, description="Number of days")
|
| 19 |
+
additional_preferences: Optional[str] = Field(None, description="Any other requests")
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class PlanResponse(BaseModel):
|
| 23 |
+
plan_text: str
|
| 24 |
+
destination_used: str
|
| 25 |
+
images: List[Dict]
|
| 26 |
+
image_queries_used: List[str]
|
| 27 |
+
source: str
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class ExtractionInput(BaseModel):
|
| 31 |
+
plan_text: str
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
class PackageData(BaseModel):
|
| 35 |
+
packageName: str
|
| 36 |
+
packageDescription: str
|
| 37 |
+
packageDestination: str
|
| 38 |
+
packageDays: int
|
| 39 |
+
packageNights: int
|
| 40 |
+
packageAccommodation: str
|
| 41 |
+
packageTransportation: str
|
| 42 |
+
packageMeals: str
|
| 43 |
+
packageActivities: str
|
| 44 |
+
packagePrice: Optional[float]
|
| 45 |
+
packageDiscountPrice: Optional[float]
|
| 46 |
+
packageOffer: bool
|
| 47 |
+
packageRating: int
|
| 48 |
+
packageTotalRatings: int
|
| 49 |
+
packageImages: Optional[List[Dict]] = None
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
class ChatMessage(BaseModel):
|
| 53 |
+
role: str # user or assistant
|
| 54 |
+
content: str
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
class ChatInput(BaseModel):
|
| 58 |
+
plan_text: str
|
| 59 |
+
destination: str
|
| 60 |
+
num_days: int
|
| 61 |
+
chat_history: List[ChatMessage]
|
| 62 |
+
user_input: str
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
class ChatResponse(BaseModel):
|
| 66 |
+
assistant_response: str
|