What is the "past_message" parameter in Azure OpenAI

Gin 45 Reputation points
2024-10-15T04:37:10.5233333+00:00

Hello,

Now I'm devloping completion API using Azure OpenAI

I find this code in the Azure OpenAI playground to use completion create function.

completion = client.chat.completions.create(
16    model=deployment,
17    messages= [
18    {
19        "role": "system",
20        "content": ""
21    }
22],
23    past_messages=11,
24    max_tokens=800,
25    temperature=0.7,
26    top_p=0.95,
27    frequency_penalty=0,
28    presence_penalty=0,
29    stop=None,
30    stream=False
31)
32

I could not found "past message" parameter in Learn page

But also azure library occured a error with this parameter. (It might be a library version issue ? )

https://learn.microsoft.com/en-us/azure/ai-services/openai/reference

I'd like to know information of "past_messages" parameter.

Best Regards,

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

Accepted answer
  1. navba-MSFT 27,540 Reputation points Microsoft Employee Moderator
    2024-10-15T09:50:40.17+00:00

    @Gin @Gin Thanks for getting back. The past_messages parameter is no longer part of the official Azure OpenAI SDK or API specification as of the latest available versions. The same is removed from the REST API specifications also.

    .

    Azure OpenAI's chat completions typically rely on the messages array to pass the full conversation history, including both user inputs and assistant responses. There is no separate past_messages parameter. Instead, the conversation context is maintained by including previous messages directly in the messages array. You can either rely on the above environment variable AZURE_OPENAI_SYSTEM_MESSAGE which I have shared in my above comment OR you should ensure that past messages are included manually in the messages array when making requests.

    Hope this answers.

    **

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.