feat: add reasoning output types to OpenAI Responses API spec#5357
feat: add reasoning output types to OpenAI Responses API spec#5357leseb merged 4 commits intollamastack:mainfrom
Conversation
✱ Stainless preview buildsThis PR will update the
|
|
@cdoern To let you know, the stainless job is still failing |
cdoern
left a comment
There was a problem hiding this comment.
this will help an actual implementation PR like #5206 pass, the reason that other one is failing is because we don't have a way to both re-record AND test a new llama-stack-client in the same PR. lets get this in to unblock other PRs.
|
is ConversationItem in conversations/models.py kept in sync with OpenAIResponseOutput manually? it looks like it doesn't include ReasoningItem yet. is that intentional for Stage 1, or should it be updated here too? |
|
convert_response_input_to_chat_messages() in utils.py has no branch for ReasoningItem and no exhaustive fallback raise. once Stage 2 emits reasoning items, feeding a previous_response_id into a new turn will silently drop them. worth adding the branch now (even as a pass-through or explicit skip), plus an else: raise on unknown types so future union growth doesn't fail silently. |
skamenan7
left a comment
There was a problem hiding this comment.
LGTM apart from few comments. Thanks.
@skamenan7 Yeah addressed them. Makes sense to raise the exception |
For scope this PR, I have only considered case when user would supply conversation history manually.
I opened #5308 PR along that same line of fix. |
| # skip as these have been extracted and inserted in order | ||
| pass | ||
| elif isinstance(input_item, OpenAIResponseOutputMessageReasoningItem): | ||
| # skip for now — reasoning items will be handled in Stage 2 |
There was a problem hiding this comment.
what's stage 2? is there an issue for this?
Splitting #5206 into two stages. CI integration tests and recordings are causing issues when API Spec and core implementation changes are pushed together.
Stage 1 (this PR): Introduce API types required for reasoning support in the Responses API:
ReasoningItem,ReasoningContent,ReasoningSummaryoutput typesAssistantMessageWithReasoningtypeStage 2: After this PR is merged, will create a clean version of #5206 with core implementation for reasoning propagation.