Skip to content

feat(openai): structured question instructions on OpenAIDecisionsConfig - #3500

Open
yftx293 wants to merge 1 commit into
ag2ai:mainfrom
yftx293:decisions-structured-instructions
Open

yftx293 wants to merge 1 commit into
ag2ai:mainfrom
yftx293:decisions-structured-instructions

Conversation

@yftx293

@yftx293 yftx293 commented Oct 25, 2026

Copy link
Copy Markdown

Why are these changes needed?

Since openai 3.37.0, a Decisions question's instructions accepts a list of parts (input_text, input_image, input_json) next to a plain string, so a question can carry an image or JSON of its own. OpenAIDecisionsConfig could only send a joined string, so those parts could not reach the question.

This adds question_instructions on OpenAIDecisionsConfig: a string or a sequence of DecisionQuestionInputPart. When set, it takes the agent prompt's place as the question's instructions (opt-in; default behavior unchanged); the schema description is still appended — joined in the string case, as a trailing input_text part in the parts case.

It moves the ag2[openai] floor to openai>=3.37.0 for the DecisionQuestionInputPart types, following ADR 0023 §5's precedent; the ADR is updated. If a floor bump is unwanted, ag2-local TypedDicts for the parts are the alternative — happy to switch if preferred.

Related issue number

#3491

Checks

  • uv run pytest test/config/ — 1271 passed, 1 skipped, 1 xfailed
  • ruff check / ruff format --check on changed files — clean
  • uv lock --upgrade-package openai — only openai 3.27.0 → 3.37.0 changed
  • ADR 0023 and decision_models.mdx updated

AI assistance

The code, tests, and docs in this PR were written with AI assistance (ZCode/GLM). I reviewed every line, ran the checks above, and can explain and revise the change in review.

@yftx293
yftx293 requested a review from marklysze as a code owner October 25, 2026 09:09
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T09:09:42.841641Z
We couldn’t complete this review. Comment @codex review to try again.
7b3b02b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@CLAassistant

CLAassistant commented Oct 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions github-actions Bot added area:docs Documentation (website/) area:deps Python dependency updates (pyproject.toml, uv.lock) area:providers LLM provider clients and mappers (ag2/config) labels Oct 25, 2026

This branch has not been deployed

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

Labels

area:deps Python dependency updates (pyproject.toml, uv.lock) area:docs Documentation (website/) area:providers LLM provider clients and mappers (ag2/config)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants