List Input Items from the Response API does not return enough data

I find it incredible that the endpoint to retrieve previous responses does not include a responseId

https://platform.openai.com/docs/api-reference/responses/input-items

In our case, we use the metadata to store certain information about how we processed a tool call, this allows a user to swipe through history and see data about how we processed the function call. Since the Assistants API List endpoint returned full messages, this worked really well

However since the ResponseAPI returns weird sub objects that don’t really represent any other output format, it seems our strategy no longer works. At first I thought this was just a weird move but I could circumvent an issue by just retrieving the full response whenever I see a function call output item. But then I realized there is no responseId anywhere in this API call. ItemId is either a msg_id. or a fco_id (function output). And there doesnt appear to be a deterministic way to determine a responseId from another id.

This kind of makes the whole “fork conversation” concept moot since the responseIds are not exposed in the API.

Has anyone found a solution for this? I’d rather not keep a copy of the responseID mapping to messageIds in the database

1 Like

If anyone is looking for a solution. I’m now storing a map of messageId → responseId map in the metadata of each message I send. I add an entry for each time a tool call is used.

So now I just keep on adding that map to the meta data (up to 16) down the list until the chat is over.

When pulling out the list items, I now have a map of messageIds → responseIds that I can use to call the actual response to get the metadata I need

A weird and annoying workaround. I hope OpenAI adds more fields to the input list response

1 Like