Skip to content

Multi-turn Responses API with Reasoning #492

@logan-markewich

Description

@logan-markewich

Typically, if I was using the responses API in python, I would add all output items from the responses API into some ongoing history list.

response = client.responses.create(
    model="gpt-5",
    tools=tools,
    input=input_list,
)

# Save function call outputs for subsequent requests
input_list += response.output

This ensures critical fields like reasoning stay in model input and allow caching to work.

However, none of the examples of the responses API really show how to do this, and I'm hitting a lot of type compability issues between InputItem and OutputItem, and its causing the model history to drop important fields like reasoning.

The existing examples of the responses API only show manually constructing function call items and appending to the history list, but it'd be much nicer if there was a way to do something like history.extend(response.output.into()) to convert vec[OutputItem] into vec[InputItem]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions