github Azure/azure-sdk-for-python azure-ai-inference_1.0.0b7

pre-release16 hours ago

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 samples sample_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 and ToolMessage. For example, you no longer need to write
    UserMessage(content="my message"). Simply write UserMessage("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 with response_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.

Don't miss a new azure-sdk-for-python release

NewReleases is sending notifications on new releases.