Spaces:
Running
Running
Ankush Rana
commited on
Commit
·
216f293
1
Parent(s):
963adbe
change temp
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def completion(history, model, system_prompt: str, tools=None):
|
|
60 |
"messages": messages,
|
61 |
"stream": True,
|
62 |
"max_tokens": 1000,
|
63 |
-
"temperature": 0.
|
64 |
"frequency_penalty": 1,
|
65 |
"extra_body": {"repetition_penalty": 1.1},
|
66 |
}
|
@@ -107,10 +107,11 @@ def llm_in_loop(history, system_prompt, recursive):
|
|
107 |
history[-1].content += chunk.choices[0].delta.content
|
108 |
yield history[recursive:]
|
109 |
|
110 |
-
print("Before:", name, arguments)
|
111 |
arguments = clean_json_string(arguments) if arguments else "{}"
|
112 |
print(name, arguments)
|
113 |
arguments = json.loads(arguments)
|
|
|
|
|
114 |
if appended:
|
115 |
recursive -= 1
|
116 |
if name:
|
|
|
60 |
"messages": messages,
|
61 |
"stream": True,
|
62 |
"max_tokens": 1000,
|
63 |
+
"temperature": 0.2,
|
64 |
"frequency_penalty": 1,
|
65 |
"extra_body": {"repetition_penalty": 1.1},
|
66 |
}
|
|
|
107 |
history[-1].content += chunk.choices[0].delta.content
|
108 |
yield history[recursive:]
|
109 |
|
|
|
110 |
arguments = clean_json_string(arguments) if arguments else "{}"
|
111 |
print(name, arguments)
|
112 |
arguments = json.loads(arguments)
|
113 |
+
print(name, arguments)
|
114 |
+
print("====================")
|
115 |
if appended:
|
116 |
recursive -= 1
|
117 |
if name:
|
tools.py
CHANGED
@@ -201,7 +201,7 @@ class restaurant_details(ToolBase):
|
|
201 |
@tool_register
|
202 |
class rooms_information(ToolBase):
|
203 |
"""
|
204 |
-
|
205 |
"""
|
206 |
@classmethod
|
207 |
def invoke(cls, input: Dict) -> str:
|
@@ -213,7 +213,7 @@ class check_room_availability(ToolBase):
|
|
213 |
"""
|
214 |
Checks if a specified room type is available between the provided check-in and check-out dates for a given number of guests.
|
215 |
"""
|
216 |
-
room_type: str = Field(default=list(json_data["room_types"].keys()), description="The type of room
|
217 |
reservation_start_date: str = Field(description="The check-in date for the reservation, formatted as 'YYYY-MM-DD' (e.g., '2025-04-01')")
|
218 |
reservation_end_date: str = Field(description="The check-out date for the reservation, formatted as 'YYYY-MM-DD' (e.g., '2025-04-05')")
|
219 |
guests: int = Field(description="The number of guests that will occupy the room.")
|
|
|
201 |
@tool_register
|
202 |
class rooms_information(ToolBase):
|
203 |
"""
|
204 |
+
Provides a list of available hotel rooms, including brief descriptions of each room type.
|
205 |
"""
|
206 |
@classmethod
|
207 |
def invoke(cls, input: Dict) -> str:
|
|
|
213 |
"""
|
214 |
Checks if a specified room type is available between the provided check-in and check-out dates for a given number of guests.
|
215 |
"""
|
216 |
+
room_type: str = Field(default=list(json_data["room_types"].keys()), description="The type of room to check for availability.")
|
217 |
reservation_start_date: str = Field(description="The check-in date for the reservation, formatted as 'YYYY-MM-DD' (e.g., '2025-04-01')")
|
218 |
reservation_end_date: str = Field(description="The check-out date for the reservation, formatted as 'YYYY-MM-DD' (e.g., '2025-04-05')")
|
219 |
guests: int = Field(description="The number of guests that will occupy the room.")
|