Skip to content

[DRAFT] FIX: send images with oai targets notebook and gui#2038

Draft
jbolor21 wants to merge 1 commit into
microsoft:mainfrom
jbolor21:bjagdagdorj/oai_response
Draft

[DRAFT] FIX: send images with oai targets notebook and gui#2038
jbolor21 wants to merge 1 commit into
microsoft:mainfrom
jbolor21:bjagdagdorj/oai_response

Conversation

@jbolor21

Copy link
Copy Markdown
Contributor

Description

[WIP]
OAI API needs images sent as a string not an object. this draft PR keeps both versions for temporary backward compatibility while we decide better design or if we need to support both versions

Tests and Documentation

ran all tests
ran gui manually
ran notebooks manually

@jbolor21 jbolor21 marked this pull request as draft June 17, 2026 21:52
@jbolor21 jbolor21 force-pushed the bjagdagdorj/oai_response branch from 4ff7a0b to f6af98c Compare June 18, 2026 05:15
@@ -242,7 +243,8 @@ async def _construct_input_item_from_piece_async(self, piece: MessagePiece) -> d
}
if piece.converted_value_data_type == "image_path":
data_url = await convert_local_image_to_data_url_async(piece.converted_value)
return {"type": "input_image", "image_url": {"url": data_url}}
image_url: Any = data_url if self._image_url_as_string else {"url": data_url}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do an analysis of the API docs by OpenAI, then try both with all the OpenAI response targets we have and see what works. I would prefer not to support both if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants