Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -160,11 +160,11 @@ async def chat(input_data: ChatInput):
|
|
160 |
tool_output_json = match.group(1).strip()
|
161 |
try:
|
162 |
tool_output = json.loads(tool_output_json)
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
except Exception as e:
|
169 |
print(e)
|
170 |
print("Error parsing tool output as json: ", tool_output)
|
|
|
160 |
tool_output_json = match.group(1).strip()
|
161 |
try:
|
162 |
tool_output = json.loads(tool_output_json)
|
163 |
+
if "artifacts" in tool_output:
|
164 |
+
for artifact in tool_output["artifacts"]:
|
165 |
+
artifact_content = requests.get(f"{API_URL}/artifact/{artifact['artifact_id']}").content
|
166 |
+
print(artifact_content)
|
167 |
+
tool_output["artifacts"][artifact["artifact_id"]] = artifact_content
|
168 |
except Exception as e:
|
169 |
print(e)
|
170 |
print("Error parsing tool output as json: ", tool_output)
|