What mwssages I will get when retrieve messages with a run_id as a parameter?

Hi,

After sending a user message, a run should be created, and when this run status is “completed”, a list of messages should be returned with a run_id (optional) as a parameter.

So in this case, the role of all retrieved messages is “assistant”?
And in this case, can the messages be more than one message?

The completions AI that is powering assistants has a stop sequence of a special token that it generates at the end of an assistant role response. This is detected by the endpoint backend and terminates the language generation. The stop sequence thus prevents multiple assistant responses, and prevents the AI from continuing into writing another user’s question by itself.

You can expect only the latest response to be new and be the response from the AI as “assistant” if you poll status and wait until the response is done. If it is still “user”, that is typically a problem in waiting for the run to finish.

If you were to continue to run again after an assistant message has been created, the AI may create another.