mistpe commited on
Commit
9be5101
1 Parent(s): 1823fe5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
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": "assistant",
214
- "content": None,
215
- "tool_call_id": tool_call.id,
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'])