Hello! Thank you for taking a look at this! I’m testing it out now and there’s two different bugs I’m seeing with by just switching to background: true and combining the conversations id.
- Duplicate item
If I let the stream finish, it inserts a duplicate conversational item in the list conversation items endpoint. This blocks follow up responses with the same conversational id.
LIST:
{
"object": "list",
"data": [
{
"id": "msg_68c360b3180481949ecb04875a722f6c0b177e8dd89b18ed",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "Hello! How can I assist you today?"
}
],
"role": "assistant"
},
{
"id": "msg_68c360b0fa74819480747fed468fc66b0b177e8dd89b18ed",
"type": "message",
"status": "completed",
"content": [
{
"type": "input_text",
"text": "hello"
}
],
"role": "user"
},
{
"id": "msg_68c360b3180481949ecb04875a722f6c0b177e8dd89b18ed",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "Hello! How can I assist you today?"
}
],
"role": "assistant"
}
],
"first_id": "msg_68c360b3180481949ecb04875a722f6c0b177e8dd89b18ed",
"has_more": false,
"last_id": "msg_68c360b3180481949ecb04875a722f6c0b177e8dd89b18ed"
}
Follow up response:
{
"error": {
"message": "Duplicate item found with id msg_68c360b3180481949ecb04875a722f6c0b177e8dd89b18ed. Remove duplicate items from your input and try again.",
"type": "invalid_request_error",
"param": "input",
"code": null
}
}
- If you do NOT let the stream finish in the original response, the background storing does work (thanks!), however it doesn’t persist the original user message:
{
"object": "list",
"data": [
{
"id": "msg_68c361b5c3848197b33695a8fb0061c30044df19232d9ce9",
"type": "message",
"status": "completed",
"content": [
{
"type": "output_text",
"annotations": [],
"logprobs": [],
"text": "Sure! Here's a short story for you:..."
}
],
"role": "assistant"
}
],
"first_id": "msg_68c361b5c3848197b33695a8fb0061c30044df19232d9ce9",
"has_more": false,
"last_id": "msg_68c361b5c3848197b33695a8fb0061c30044df19232d9ce9"
}
It will allow for follow up responses, but it does not have memory of what the user request was. I confirmed that by asking if it remember, so it’s not just a problem with the LIST API.
Thank you for taking a look at this.