Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,7 +118,7 @@ def completion(history, model, system_prompt: str, tools=None):
|
|
| 118 |
def llm_in_loop(history, system_prompt, recursive):
|
| 119 |
try:
|
| 120 |
models = client.models.list()
|
| 121 |
-
model = models.data[0].id
|
| 122 |
except Exception as err:
|
| 123 |
gr.Warning("The model is initializing. Please wait; this may take 5 to 10 minutes β³.", duration=20)
|
| 124 |
raise err
|
|
@@ -163,9 +163,9 @@ def llm_in_loop(history, system_prompt, recursive):
|
|
| 163 |
if name:
|
| 164 |
try:
|
| 165 |
result = str(tools[name].invoke(input=arguments))
|
| 166 |
-
result = get_summary(result).choices[0].message.content
|
| 167 |
except Exception as err:
|
| 168 |
-
result = f"π₯ Error: {err}"
|
| 169 |
# msg = ChatMessage(
|
| 170 |
# role="assistant",
|
| 171 |
# content="",
|
|
|
|
| 118 |
def llm_in_loop(history, system_prompt, recursive):
|
| 119 |
try:
|
| 120 |
models = client.models.list()
|
| 121 |
+
model = models.data[0].id
|
| 122 |
except Exception as err:
|
| 123 |
gr.Warning("The model is initializing. Please wait; this may take 5 to 10 minutes β³.", duration=20)
|
| 124 |
raise err
|
|
|
|
| 163 |
if name:
|
| 164 |
try:
|
| 165 |
result = str(tools[name].invoke(input=arguments))
|
| 166 |
+
result = get_summary(models, result).choices[0].message.content
|
| 167 |
except Exception as err:
|
| 168 |
+
result = f"π₯ Error: {err}"
|
| 169 |
# msg = ChatMessage(
|
| 170 |
# role="assistant",
|
| 171 |
# content="",
|