Realtime Websocket Confusion

Hey everyone! I’m working on adding a real-time ChatGPT integration for my project Homeway. But I’m hitting some odd issues I don’t think the docs explain very well.

For context, I’m using the official c# SDK and have followed the real-time example in the repo. I’m using 4o-mini and text only.

Occasionally, the real-time response will have no items created in the response.

I logged every event sent back and saw ResponseStarted and then ResponseFinished with no other events. In the working scenario, I see the item-created events, delta streaming, etc. I also checked the ResponseFinished object; its created items array is empty. I’m sure I added a user message and then sent the start reply message, so I have no idea why it’s responding with nothing.

Proper Use Of The Websocket API

I assumed since I created a session and the WebSocket is active, I wouldn’t have to resend all of the past messages as I do with the chat completion REST API. But it seems that’s not the case. It looks like the instructions are applied to every message, but it seems unless I write each user and assistant message every time, the response has no memory of the past conversation.

Is that expected? I can’t find anything about the expected behavior on the website API docs or in the SDK.

If anyone has any insight, I would love to hear it!

1 Like

Hi and welcome!

There is a github repo here that has a working example in code with WebRTC

Also one in python and websockerts here

2 Likes

Thanks for the reply! I looked at those two repo, and they are helpful, but they aren’t quite the same thing. I have found a few voice demos, but none just text. What I’m really looking for is what the expected event flow is for a text-only conversation over the real-time web socket.

In the open AI docs they document the web socket endpoint and the events, but there’s nothing I can find on the expected even flow etc.

1 Like

Thanks for sharing this problem, i am also facing this same issue.

1 Like

I’m also seeing random error messages returning with no context beyond “Kind”:28. I looked at the docs but don’t see error definitions.

I know it’s just a beta API, and it’s nice for what it is. I hope this feedback helps build the docs to make them more useful.