Azure.AI.OpenAI_2.1.0
2.1.0 (2024-12-05)
This GA library release aligns functionality with the latest 2024-10-21 stable service API label.
Note
For consistency and reliability, GA releases of the Azure.AI.OpenAI library will always map to stable Azure OpenAI service API versions. Because stable service API versions omit volatile surfaces such as beta features, GA library releases will also not contain the full set of preview functionality. To use beta and preview features, please use the latest prerelease version of the library.
Features Added
Chat
- [GA] The
2024-10-21API version brings GA AOAI support for streaming token usage in chat completions;Usageis now automatically populated inStreamingChatCompletionUpdateinstances.- Note 1: this feature is not yet compatible when using On Your Data features (after invoking the
.AddDataSource()extension method onChatCompletionOptions) - Note 2: this feature is not yet compatible when using image input (a
ChatMessageContentPartofKindImage)
- Note 1: this feature is not yet compatible when using On Your Data features (after invoking the
- [GA] The
AllowParalllelToolCallsproperty onChatCompletionOptions, which can be set tofalseto disable the invocation of multiple tools on a single chat completion response, is now supported. - [GA] Structured outputs, via the use of
ChatResponseFormat.CreateJsonSchemaFormat(), is now supported. - When using
o1-previewando1-minimodels,max_completion_tokensmay now be configured by calling the[Experimental] SetNewMaxCompletionTokensPropertyEnabled()extension method onChatCompletionOptions.- This extension method will be removed in a future service API version, when it becomes unnecessary once all models support the
max_completion_tokensproperty
- This extension method will be removed in a future service API version, when it becomes unnecessary once all models support the
Batch
The 2024-10-21 service API label introduces stable support for batch chat completions to Azure OpenAI. This library release exposes low-level support for batch:
AzureOpenAIClient'sGetOpenAIFileClient()will now return a valid, configured instance ofFileClientthat supports uploading files withFileUploadPurpose.Batch. This can be used to upload the contents of a valid.jsonlfile for batch processing.AzureOpenAIClient'sGetBatchClient()will now return a valid, configured instance ofBatchClientthat can produce aCreateBatchOperationgiven an uploaded file ID using protocol methods.- Strongly typed convenience surfaces for
BatchClientwill arrive in a future update.
Breaking Changes
Note
GA library releases only permit breaking changes to items marked with an [Experimental] attribute and these changes will be minimized whenever possible.
[Experimental]GetBatchClient(string deploymentName)onAzureOpenAIClientis removed, as the Azure OpenAI batch API now aligns with OpenAI's in not using a deployment-based request URI path. Please useGetBatchClient(), instead.[Expermental]theUriproperty of typeSystem.UriinChatCitationandChatRetrivedDocumenthas been replaced by aUrlproperty of typestring. This contains the same information but properly handles document paths that don't conform to a valid RFC 3986 identifier.