Update app.py
Browse files
app.py
CHANGED
|
@@ -210,15 +210,9 @@ def wechatai():
|
|
| 210 |
for tool_call in gpt_response.tool_calls:
|
| 211 |
function_result = process_function_call(tool_call)
|
| 212 |
session['messages'].append({
|
| 213 |
-
"role": "
|
| 214 |
-
"
|
| 215 |
-
"
|
| 216 |
-
"tool_calls": [tool_call]
|
| 217 |
-
})
|
| 218 |
-
session['messages'].append({
|
| 219 |
-
"role": "tool",
|
| 220 |
-
"content": json.dumps(function_result),
|
| 221 |
-
"tool_call_id": tool_call.id
|
| 222 |
})
|
| 223 |
|
| 224 |
final_response = get_openai_response(session['messages'])
|
|
|
|
| 210 |
for tool_call in gpt_response.tool_calls:
|
| 211 |
function_result = process_function_call(tool_call)
|
| 212 |
session['messages'].append({
|
| 213 |
+
"role": "function",
|
| 214 |
+
"name": tool_call.function.name,
|
| 215 |
+
"content": json.dumps(function_result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 216 |
})
|
| 217 |
|
| 218 |
final_response = get_openai_response(session['messages'])
|