Add multiple messages to assistants at one request

Mohamed Hussein 570 Reputation points
2024-12-19T12:29:03.7233333+00:00

Good Day,

Is that possible to add Multiple messages to the AOAI assistant something like

{
  "messages":[
  {
    "role": "user",
    "content": "How are you?"  
   },
   {
    "role": "assistant",
    "content": "I'm fine"  
   }
 ]
}



User's image

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,537 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 48,496 Reputation points Microsoft Employee
    2024-12-19T13:40:13.2566667+00:00

    @Mohamed Hussein As per the reference it looks like it could only be either of one that can be used.

    User's image

    The API spec for the above is here.

    I think you should add another role with assistant in the corresponding message on the thread.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.