File size: 1,410 Bytes
c64ef12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c2900fe
c64ef12
432418f
 
c64ef12
 
 
 
 
 
 
 
432418f
c64ef12
 
549454e
432418f
1
2
3
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
# from pydantic import BaseModel, Field
# from typing   import List

# class RealEstateListing(BaseModel):
#     neighborhood            : str   = Field(..., description="Neighborhood name")
#     price                   : str   = Field(..., description="Property price (formatted as $X,XXX,XXX)")
#     bedrooms                : int   = Field(..., description="Number of bedrooms")
#     bathrooms               : float = Field(..., description="Number of bathrooms")
#     house_size              : str   = Field(..., description="House size in square feet")
#     property_type           : str   = Field(..., description="Type of property (house, condo, etc.)")
#     description             : str   = Field(..., description="Detailed property description")
#     neighborhood_description: str   = Field(..., description="Description of the neighborhood")

#     class Config:
#         # Updated config keys for Pydantic v2.x
#         str_min_length = 1
#         str_strip_whitespace = True
from pydantic import BaseModel, Field
from typing import List

class RealEstateListing(BaseModel):
    neighborhood: str
    price: str
    bedrooms: int
    bathrooms: float
    house_size: str
    property_type: str
    description: str
    neighborhood_description: str

class ListingCollection(BaseModel):
    listings: List[RealEstateListing] = Field(..., description="Collection of real estate listings")