Skip to content

Commit 990c135

Browse files
Merge pull request #248787 from dereklegenzoff/functions-updates
updating function calling code sample
2 parents e9fa402 + 6c23e11 commit 990c135

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

articles/ai-services/openai/how-to/function-calling.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ if response_message.get("function_call"):
134134
messages.append( # adding assistant response to messages
135135
{
136136
"role": response_message["role"],
137-
"name": response_message["function_call"]["name"],
138-
"content": response_message["function_call"]["arguments"],
137+
"function_call": {
138+
"name": response_message["function_call"]["name"],
139+
"arguments": response_message["function_call"]["arguments"],
140+
},
141+
"content": None
139142
}
140143
)
141144
messages.append( # adding function response to messages

0 commit comments

Comments
 (0)