1.0.0b7 (2025-01-15)
Features Added
- Added a client for Image Embeddings, named
ImageEmbeddingsClient
. See package README.md and new samples. - Added support for Chat Completions response message in JSON format that adheres to a given JSON schema. Also known
as "structured output". See new samplessample_chat_completions_with_structured_output.py
and
sample_chat_completions_with_structured_output_pydantic.py
. - Made input argument
content
a positional argument (in addition to keyword argument), in the constructors of
UserMessage
,SystemMessage
,AssistantMessage
andToolMessage
. For example, you no longer need to write
UserMessage(content="my message")
. Simply writeUserMessage("my message")
. All samples were updated accordingly.
Breaking Changes
- If you previously configured your
ChatCompletionClient.complete()
call to output JSON format without a scheme, you have this in your code:response_format=ChatCompletionsResponseFormatJSON()
. To maintain the same functionality, replace this withresponse_format="json-object"
. We however recommend that you now switch to output JSON format with a provided schema if your AI model supports it:response_format=JsonSchemaFormat(...)
.
Bugs Fixed
- Fix a bug that would cause an error when tracing was enabled and azure-core-tracing-opentelemetry was not installed and asynchronous chat completion was used.
- Enforce distinct timestamps on prompt and completion tracing events to preserve the order for chat history.