We’re using some Assistants to prompt and retrieve different responses using “/v1/threads/runs” for initial runs and “/v1/threads/{ thread_id }/runs” for subsequent runs on the existing thread.
The stream includes a dozen events of which I have no interest. I’m only interested in “event: thread.message.completed”. Everything before and after is wasted bandwidth. I don’t need to see each word of the response as a separate event. Not do I need to see the instructions for the assistant. I know what they are… I typed them.
Is there any way to subscribe to the events I want?
Can you add a request parameter called subscribed_events which is a string array so I can request “event: thread.message.completed” or other events and you ONLY return those events?
That would be splendid.
1 Like
Welcome to the community!
Receiving text through HTTP is pretty cheap.
The practical way to only listen to specific events is typically to use an observer pattern (wikipedia), and apply a filter operation to your pipe. (which is conveniently implemented in ReactiveX - Filter operator, but it’s also good practice to DIY sometimes.)
1 Like
Thanks for the reply, but that’s not a solution. I’m already filtering the undesirable events. The issue is that they are streamed at all. Receiving text on a vessel at sea via cellular or satellite is not cheap. I don’t need to download 1 MB of text when I only want a few sentences.