CreateRunAsync Get Event Type from streamEvent "event: thread.run.created" #260
-
Get event from stream "event: thread.run.created" RunResponse run = await thread.CreateRunAsync(assistant, async streamEvent =>
{
switch (streamEvent)
{
case ThreadResponse threadEvent:
switch (threadEvent.Object)
{
case "thread.run.created":
Debug.Log($">>>>{threadEvent.Object}<<<<");
break;
}
break;
}
await Task.CompletedTask;
}
);
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Is this a question? I'm not really sure what information you're looking for. All of the event messages are already parsed and put into response objects for you. |
Beta Was this translation helpful? Give feedback.
-
I apologize I might not be understanding how OpenAi's format in the stream, I'm looking to identify "event: thread.run.created" I am only getting back "thread.run" not "thread.run.created" for example from below: case RunResponse runEvent:
switch (runEvent.Object)
{
case "thread.run.created":
break;
}
break; |
Beta Was this translation helpful? Give feedback.
-
I'm using "CreateRunAsync" are you able to add the event string to those functions?
|
Beta Was this translation helpful? Give feedback.
@JBlakeMCAA I added an overload in 8.1.1 to get the event name: