Skip to content

Commit c802b24

Browse files
committed
fix: without instruction bug
1 parent d3132ec commit c802b24

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

veadk/models/ark_transform.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ def ark_field_reorganization(request_data: dict) -> dict:
125125
# If a system prompt is needed, it should be placed in the system role message within the input, instead of using the instructions parameter.
126126
# https://www.volcengine.com/docs/82379/1585128
127127
instructions = request_data.pop("instructions", None)
128-
request_data["input"] = [
129-
{
130-
"content": [{"text": instructions, "type": "input_text"}],
131-
"role": "system",
132-
"type": "message",
133-
}
134-
] + request_data["input"]
128+
if instructions:
129+
request_data["input"] = [
130+
{
131+
"content": [{"text": instructions, "type": "input_text"}],
132+
"role": "system",
133+
"type": "message",
134+
}
135+
] + request_data["input"]
135136

136137
return request_data
137138

0 commit comments

Comments
 (0)