Azure / Azure/azure-rest-api-specs
[BUG] Azure OpenAI API chat/completions/response/object
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
### API Spec link
github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2025-02-01-preview/inference.yaml#L4286-L4293
### API Spec version
2025-02-01-preview
### Describe the bug
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2025-02-01-preview/inference.yaml#L4286-L4293
```yaml
object:
type: string
description: The object type, which is always `chat.completion.chunk`.
enum: [chat.completion.chunk]
required:
- prompt_tokens
- completion_tokens
- total_tokens
```
Unexpected `required` field content for the `object` **string** field.
It seems like the schemas for `object` and `usage` fields were mixed.
### Expected behavior
`required` field is redundant and could be removed
### Actual behavior
`required` is present and confusing since the `object` field is of string type
### Reproduction Steps
Observe https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2025-02-01-preview/inference.yaml#L4286-L4293
### Environment
_No response_
Contributor guide
Research direction
Open specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2025-02-01-preview/inference.yaml and inspect lines 4286-4293, focusing on the chat completion chunk object's schema. Remove the redundant required field from the string object property, then verify that the schema matches the API specification and no longer mixes the object and usage fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100