MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.26k stars 21.43k forks source link

Create Message Error #122953

Closed edkopka closed 4 months ago

edkopka commented 4 months ago

In the Create message section I tried the following request:

POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/threads/{thread_id}/messages?api-version=2024-05-01-preview

to create a message on a thread with an attached file. The request body table shows the property file_ids image I provided a list with a file id I had previously uploaded and I received this error message:

{
    "error": {
        "message": "Unknown parameter: 'file_ids'.",
        "type": "invalid_request_error",
        "param": "file_ids",
        "code": "unknown_parameter"
    }
}

Is this documentation accurate? It seems like the request body parameters needs to be updated for the api version api-version=2024-05-01-preview


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

PesalaPavan commented 4 months ago

@edkopka Thanks for your feedback! We will investigate and update as appropriate.

mrbullwinkle commented 4 months ago

edkopka - Thanks for your question, yes you are correct it looks like the properties are still showing what would be needed for the 2024-02-15-preview API.

If I look at the 2024-05-01-preview spec the parameters are now:

Create - Message

POST https://{endpoint}/openai/threads/{thread_id}/messages?api-version=2024-05-01-preview

Create a message.


URI Parameters

Name In Required Type Description
endpoint path Yes string
url
Supported Azure OpenAI endpoints (protocol and hostname, for example: https://aoairesource.openai.azure.com. Replace "aoairesource" with your Azure OpenAI resource name). https://{your-resource-name}.openai.azure.com
thread_id path Yes string
api-version query Yes string api version

Request Body

Content-Type: application/json

Name Type Description Required Default
role string The role of the entity that is creating the message. Allowed values include:
- user: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
- assistant: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
Yes
content string The content of the message. Yes
attachments array A list of files attached to the message, and the tools they should be added to. No
metadata object Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maximum of 512 characters long.
No

@aahill for awareness

AjayBathini-MSFT commented 4 months ago

@edkopka We are going to close this thread as resolved but if there are any further questions regarding the documentation, please tag me in your reply and we will be happy to continue the conversation.