Skip to content

Conversation

needs
Copy link

@needs needs commented Oct 17, 2025

Extend TurnOptions with an optional images field. This new field is an array of strings that is fed to the CLI through the --image parameter.

await thread.run("describe the images", { 
  images: ["foo.png", "bar.png"] 
});

Ends up launching the CLI with:

codex exec --image foo.png --image bar.png "describe the images" 

This brings the Codex SDK closer to feature parity with the CLI. Adresses #5280 .

Copy link

github-actions bot commented Oct 17, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@needs
Copy link
Author

needs commented Oct 17, 2025

I have read the CLA Document and I hereby sign the CLA

@needs needs force-pushed the feat/support-images-sdk branch from b57a499 to 2f82c67 Compare October 17, 2025 13:08
github-actions bot added a commit that referenced this pull request Oct 17, 2025
@pakrym-oai
Copy link
Collaborator

pakrym-oai commented Oct 17, 2025

Hi! Thank you for the contribution.

If you don't mind let's implement this by changing input: string on run and runStreamed to be of string | UserInput[] type.

where UserInput is

type UserInput = {
   type: "text",
   text: string,
} | {
   type: "local_image",
   path: string
}

We combine all text parts into the prompt and turn all images into --image parameter.

@needs
Copy link
Author

needs commented Oct 18, 2025

Hi! Thanks for your feedback.

The Input type has been extended the suggested way. Texts parts are combined with two newlines. This is done through the new normalizeInput function which returns a combined prompt and a list of image paths.

Added a second test that make sure text parts are combined the expected way.

Available for any follow ups!

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