Spaces:
Running
Running
Update utils.py
Browse files
utils.py
CHANGED
@@ -142,7 +142,7 @@ def create_base_notebook(messages):
|
|
142 |
"source": text
|
143 |
})
|
144 |
|
145 |
-
elif message["role"] == "assistant" and "
|
146 |
base_notebook["cells"].append({
|
147 |
"cell_type": "code",
|
148 |
"execution_count": None,
|
@@ -156,7 +156,7 @@ def create_base_notebook(messages):
|
|
156 |
base_notebook["cells"][-1]["outputs"].append(message["content"])
|
157 |
base_notebook["cells"][-1]["execution_count"] = code_cell_counter
|
158 |
|
159 |
-
elif message["role"] == "assistant" and "
|
160 |
base_notebook["cells"].append({
|
161 |
"cell_type": "markdown",
|
162 |
"metadata": {},
|
|
|
142 |
"source": text
|
143 |
})
|
144 |
|
145 |
+
elif message["role"] == "assistant" and "tool_calls" in message:
|
146 |
base_notebook["cells"].append({
|
147 |
"cell_type": "code",
|
148 |
"execution_count": None,
|
|
|
156 |
base_notebook["cells"][-1]["outputs"].append(message["content"])
|
157 |
base_notebook["cells"][-1]["execution_count"] = code_cell_counter
|
158 |
|
159 |
+
elif message["role"] == "assistant" and "tool_calls" not in message:
|
160 |
base_notebook["cells"].append({
|
161 |
"cell_type": "markdown",
|
162 |
"metadata": {},
|