Spaces:
Running
Running
Update tools.py
Browse files
tools.py
CHANGED
@@ -83,7 +83,7 @@ def tool_register(cls: BaseModel):
|
|
83 |
tools[oaitool["function"]["name"]] = cls
|
84 |
|
85 |
@tool_register
|
86 |
-
class
|
87 |
"""Retrieves basic information about the hotel, such as its name, address, contact details, and overall description."""
|
88 |
|
89 |
@classmethod
|
@@ -103,8 +103,8 @@ class hotel_facilities(ToolBase):
|
|
103 |
return json_data["general_facilities"]
|
104 |
|
105 |
@tool_register
|
106 |
-
class
|
107 |
-
"""Provides a list of available restaurants with their
|
108 |
|
109 |
@classmethod
|
110 |
def invoke(cls, input: Dict) -> str:
|
@@ -138,16 +138,16 @@ class restaurants_info(ToolBase):
|
|
138 |
|
139 |
|
140 |
@tool_register
|
141 |
-
class
|
142 |
"""
|
143 |
-
Returns a list
|
144 |
"""
|
145 |
@classmethod
|
146 |
def invoke(cls, input: Dict) -> str:
|
147 |
return json_data["room_types"]
|
148 |
|
149 |
|
150 |
-
|
151 |
class check_room_availability(ToolBase):
|
152 |
"""
|
153 |
Checks if a specified room type is available between the provided check-in and check-out dates for a given number of guests.
|
@@ -203,7 +203,7 @@ class make_reservation(ToolBase):
|
|
203 |
Creates a new reservation for the hotel by booking a room of the specified type for the desired dates, and associating the booking with a user.
|
204 |
"""
|
205 |
|
206 |
-
user_name:
|
207 |
room_type: str = Field(default=list(json_data["room_types"].keys()), description="The type of room being reserved.")
|
208 |
check_in_date: str = Field(description="The starting date of the reservation (e.g., \"2025-04-01\")")
|
209 |
check_out_date: str = Field(description="The ending date of the reservation (e.g., \"2025-04-05\").")
|
|
|
83 |
tools[oaitool["function"]["name"]] = cls
|
84 |
|
85 |
@tool_register
|
86 |
+
class hotel_description(ToolBase):
|
87 |
"""Retrieves basic information about the hotel, such as its name, address, contact details, and overall description."""
|
88 |
|
89 |
@classmethod
|
|
|
103 |
return json_data["general_facilities"]
|
104 |
|
105 |
@tool_register
|
106 |
+
class restaurants_details(ToolBase):
|
107 |
+
"""Provides a list of available restaurants with their details."""
|
108 |
|
109 |
@classmethod
|
110 |
def invoke(cls, input: Dict) -> str:
|
|
|
138 |
|
139 |
|
140 |
@tool_register
|
141 |
+
class rooms_information(ToolBase):
|
142 |
"""
|
143 |
+
Returns a list information about rooms available at the hotel along with brief descriptions of each type.
|
144 |
"""
|
145 |
@classmethod
|
146 |
def invoke(cls, input: Dict) -> str:
|
147 |
return json_data["room_types"]
|
148 |
|
149 |
|
150 |
+
#@tool_register
|
151 |
class check_room_availability(ToolBase):
|
152 |
"""
|
153 |
Checks if a specified room type is available between the provided check-in and check-out dates for a given number of guests.
|
|
|
203 |
Creates a new reservation for the hotel by booking a room of the specified type for the desired dates, and associating the booking with a user.
|
204 |
"""
|
205 |
|
206 |
+
user_name: str = Field(description="The name of user who is doing the reservation.")
|
207 |
room_type: str = Field(default=list(json_data["room_types"].keys()), description="The type of room being reserved.")
|
208 |
check_in_date: str = Field(description="The starting date of the reservation (e.g., \"2025-04-01\")")
|
209 |
check_out_date: str = Field(description="The ending date of the reservation (e.g., \"2025-04-05\").")
|