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-21
API version brings GA AOAI support for streaming token usage in chat completions;Usage
is now automatically populated inStreamingChatCompletionUpdate
instances.- 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
ChatMessageContentPart
ofKind
Image
)
- Note 1: this feature is not yet compatible when using On Your Data features (after invoking the
- [GA] The
AllowParalllelToolCalls
property onChatCompletionOptions
, which can be set tofalse
to 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-preview
ando1-mini
models,max_completion_tokens
may 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_tokens
property
- 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 ofFileClient
that supports uploading files withFileUploadPurpose.Batch
. This can be used to upload the contents of a valid.jsonl
file for batch processing.AzureOpenAIClient
'sGetBatchClient()
will now return a valid, configured instance ofBatchClient
that can produce aCreateBatchOperation
given an uploaded file ID using protocol methods.- Strongly typed convenience surfaces for
BatchClient
will 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)
onAzureOpenAIClient
is 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]
theUri
property of typeSystem.Uri
inChatCitation
andChatRetrivedDocument
has been replaced by aUrl
property of typestring
. This contains the same information but properly handles document paths that don't conform to a valid RFC 3986 identifier.