Skip to content

Commit e2fdb58

Browse files
committed
Do not set status if it's None
1 parent 029bf82 commit e2fdb58

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

python/packages/core/agent_framework/openai/_responses_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,14 +1159,17 @@ def _prepare_content_for_openai(
11591159
# OpenAI Responses API requires IDs to start with `fc_`
11601160
if not fc_id.startswith("fc_"):
11611161
fc_id = f"fc_{fc_id}"
1162-
return {
1162+
1163+
function_call_obj = {
11631164
"call_id": content.call_id,
11641165
"id": fc_id,
11651166
"type": "function_call",
11661167
"name": content.name,
11671168
"arguments": content.arguments,
1168-
"status": content.additional_properties.get("status"),
11691169
}
1170+
if status := content.additional_properties.get("status"):
1171+
function_call_obj["status"] = status
1172+
return function_call_obj
11701173
case "function_result":
11711174
shell_output_type = (
11721175
content.additional_properties.get(OPENAI_SHELL_OUTPUT_TYPE_KEY)

0 commit comments

Comments
 (0)