Skip to content

Add StructuredInputItem; patch version bump to 1.6.4#125

Merged
jiwon-oai merged 5 commits into
mainfrom
structured-input-item
May 14, 2026
Merged

Add StructuredInputItem; patch version bump to 1.6.4#125
jiwon-oai merged 5 commits into
mainfrom
structured-input-item

Conversation

@jiwon-oai
Copy link
Copy Markdown
Collaborator

@jiwon-oai jiwon-oai commented May 11, 2026

  • Add StructuredInputItem
  • Add default ThreadItemConverter method for the new item type
  • Add handling for new request type: threads.add_structured_input

Screenshot of updated docs:

Screenshot 2026-05-13 at 1 28 36 PM

Screen recording of local chatkit studio:

Screen.Recording.2026-05-13.at.1.32.26.PM.mov

@jiwon-oai jiwon-oai changed the title Support StructuredInputItem Add StructuredInputItem May 11, 2026
@jiwon-oai jiwon-oai force-pushed the structured-input-item branch from 5b877ce to d8ac929 Compare May 12, 2026 16:43
@jiwon-oai jiwon-oai force-pushed the structured-input-item branch from d8ac929 to 8b263fa Compare May 13, 2026 20:29
Comment thread chatkit/agents.py
Comment on lines +556 to +568
if event.type == "tool_call_item":
raw_item = event.raw_item
if isinstance(raw_item, dict):
if raw_item.get("type") == "function_call":
current_tool_call = event.call_id
current_item_id = raw_item.get("id")
assert current_item_id
produced_items.add(current_item_id)
elif raw_item.type == "function_call":
current_tool_call = event.call_id
current_item_id = raw_item.id
assert current_item_id
produced_items.add(current_item_id)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Newer versions of openai-agents allow the raw item to be a dict, so handling that here (pyright caught it).

Comment thread pyproject.toml
[project]
name = "openai-chatkit"
version = "1.6.3"
version = "1.6.4"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Patch version bump according to chatkit-python release rules, since this is a backwards-compatible change.

@jiwon-oai jiwon-oai changed the title Add StructuredInputItem Add StructuredInputItem; patch version bump to 1.6.4 May 13, 2026
@jiwon-oai jiwon-oai requested a review from weedon-openai May 13, 2026 21:14
@jiwon-oai jiwon-oai marked this pull request as ready for review May 13, 2026 21:14
Comment thread chatkit/types.py Outdated
"""Structured input answered by choosing one or more options."""

type: Literal["multiple_choice"] = "multiple_choice"
options: list[str]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@weedon-openai should we preemptively make these options typed objects instead of str to future-proof per-option additions such as icons, whether it's recommended, tooltips?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated!

Comment thread chatkit/agents.py
current_item_id = event.raw_item.id
assert current_item_id
produced_items.add(current_item_id)
if event.type == "tool_call_item":
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.

why these changes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Newer versions of openai-agents allow the raw item to be a dict, so handling that here (pyright caught it)!

@jiwon-oai jiwon-oai added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit db800b5 May 14, 2026
1 check passed
@jiwon-oai jiwon-oai deleted the structured-input-item branch May 14, 2026 21:07
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