Skip to content

Commit cfc9b4c

Browse files
committed
Small fix
1 parent 5c8dfd7 commit cfc9b4c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/agentex/lib/core/temporal/plugins/openai_agents/streaming_model.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,18 @@ def _prepare_response_input(self, input: Union[str, list[TResponseInputItem]]) -
116116
for content_item in content_list:
117117
if isinstance(content_item, dict):
118118
if content_item.get("type") == "output_text":
119-
content_array.append({
120-
"type": "input_text",
121-
"text": content_item.get("text", "")
122-
})
119+
# For assistant messages, keep as output_text
120+
# For user messages, convert to input_text
121+
if role == "user":
122+
content_array.append({
123+
"type": "input_text",
124+
"text": content_item.get("text", "")
125+
})
126+
else:
127+
content_array.append({
128+
"type": "output_text",
129+
"text": content_item.get("text", "")
130+
})
123131
else:
124132
content_array.append(content_item)
125133

0 commit comments

Comments
 (0)