I’m trying to generate an out-of-band response in Realtime OpenAI using response.create without appending to the default conversation. I want to summarize the conversation and output the client’s sentiment, but every time I send:
prompt = “”"
Analyze the conversation so far. Provide a 20-word summary and classify the client’s sentiment into: neutral, negative, or positive.
Format:
summary: {summary}
sentiment: {sentiment}
“”"
event = {
“type”: “response.create”,
“response”: {
“conversation”: “none”,
“metadata”: {“topic”: “sentiment_update”},
“output_modalities”: [“text”],
“instructions”: prompt,
},
}
ws.send(json.dumps(event))
I always get the next assistant next message instead of the expected summary/sentiment. I have tried more than 10 times.
This is an example of my response:
{
“type”: “response.done”,
“event_id”: “event_XXXXX”,
“response”: {
“object”: “realtime.response”,
“id”: “resp_YYYYY”,
“status”: “completed”,
“status_details”: null,
“output”: [
{
“id”: “item_ZZZZZ”,
“type”: “message”,
“status”: “completed”,
“role”: “assistant”,
“content”: [
{
“type”: “output_text”,
“text”: “I’d like to know if you placed an order within the last 3 months.”
....
“metadata”: {
“topic”: “sentiment_update”
}
}
Which was exaclty what the assitant turn was saying. How can someone retrive information like this? without having to store the history on the data on disk on our code?
I suspect the model isn’t accessing the conversation history properly. How can I correctly reference prior messages to produce a proper out-of-band summary using response.create?
Documentation reference: https://platform.openai.com/docs/guides/realtime-conversations#create-responses-outside-the-default-conversation