azure-rest-api-specs icon indicating copy to clipboard operation
azure-rest-api-specs copied to clipboard

Azure OpenAI Typespec definition for v2024-09-01-preview and v2024-10-01-preview service releases

Open jpalvarezl opened this issue 1 year ago • 7 comments

[!IMPORTANT] This PR is introducing changes for both v2024-09-01-preview and v2024-10-01-preview

v2024-09-01-preview changes

OpenAI.Inference

  • stream_options was re-added for Completions and ChatCompletions
  • new field max_completion_tokens for ChatCompletions. Existing nax_tokens is deprecated.
  • new field completion_tokens_details in CompletionUsage (tokens used for OAI reasoning purposes it seems)
  • parallel_tool_calls for CreateChatCompletionRequest was re-added as well (seems to be a change only for Assistants)

OpenAI.Assistants

  • parallel_tool_calls for RunObject, CreateRunRequest and CreateRunAndThreadRequest was re-added as well (seems to be a change only for Assistants)

v2024-10-01-preview changes

OpenAI.Inference

  • Updating documentation for embeddings POST endpoint
  • Adding model contentFilterCompletionTextSpan and contentFilterDetectedWithCompletionTextSpansResult
  • Adding optional property ungrounded_material of the type mentioned above to contentFilterChoiceResults model
  • details property in contentFilterChoiceResults is mandatory from now on
  • Updating documentation for chatCompletionsRequest members: max_tokens and max_completion_tokens
  • Adding prompt_token_details property to completionDetails model

jpalvarezl avatar Oct 08 '24 11:10 jpalvarezl

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This is the public specs repo main branch which is not intended for iterative development.
    You must acknowledge that you understand that after this PR is merged, you won't be able to stop your changes from being published to Azure customers.
    If this is what you intend, add PublishToCustomers label to your PR.
    Otherwise, retarget this PR onto a feature branch, i.e. with prefix release- (see aka.ms/azsdk/api-versions#release--branches).
  • ❌ Your PR requires an API stewardship board review as it introduces a new API version (label: new-api-version). Schedule the review by following aka.ms/azsdk/onboarding/restapischedule.
  • ❌ This PR has at least one change violating Azure versioning policy (label: VersioningReviewRequired).
    To unblock this PR, either a) introduce a new API version with these changes instead of modifying an existing API version, or b) follow the process at aka.ms/brch.
  • ❌ The required check named Swagger LintDiff has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide

Why does parallel_tool_calls show as required here? https://github.com/Azure/azure-rest-api-specs/blob/4d8ea51f1b2400a8c5840a13eec1dd8c16f6c564/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-09-01-preview/assistants_generated.yaml#L3633

For that to be the case, there needs to be an associated entry in inference.yaml, right? (I don't see it there, so it makes me think I'm missing a step)

brandom-msft avatar Oct 10 '24 23:10 brandom-msft

Why does parallel_tool_calls show as required here?

https://github.com/Azure/azure-rest-api-specs/blob/4d8ea51f1b2400a8c5840a13eec1dd8c16f6c564/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-09-01-preview/assistants_generated.yaml#L3633

For that to be the case, there needs to be an associated entry in inference.yaml, right? (I don't see it there, so it makes me think I'm missing a step)

It's defined in the TypeSpec as required (hence why it reflects that way here):

  @added(ServiceApiVersions.v2024_09_01_preview)
  @encodedName("application/json", "parallel_tool_calls")
  parallelToolCalls: boolean = true;

Interestingly, the published inference.* files in the data-plane folder (the hand-maintained ones from the service team) do not include parallel_tool_calls in the required properties of runObject (line 5619 in the 2024-09-01-preview .yaml) -- but I'm almost certain that it actually is required. It is in OpenAI's spec, too.

trrwilson avatar Oct 11 '24 20:10 trrwilson

PR validation pipeline can not start as the pull request is not merged or mergeable - most likely it has merge conflicts.

@trrwilson , I will resolve this comment: https://github.com/Azure/azure-rest-api-specs/pull/30909#discussion_r1797414167

But this remains an issues that I understand will be addressed as code customization at the client library level. Let's re-open this discussion if we see that there is something smart that can be done in the spec side of things.

jpalvarezl avatar Oct 22 '24 12:10 jpalvarezl

Added changes for v2024_10_01_preview in 65f854e

jpalvarezl avatar Oct 24 '24 15:10 jpalvarezl

Discussed offline that CI breakage can't be fixed

lmazuel avatar Nov 14 '24 19:11 lmazuel