Skip to main content

Microsoft Azure Azure AI control plane SDK Client Library for Python

Project description

Azure AI Resources Package client library for Python

The Azure AI Resources package is part of the Azure AI SDK for Python and contains functionality for connecting to and managing your Azure AI resources and projects. Within your Azure AI projects it provides control plane operations for creating and managing data, indexes, models and deployments.

Source code | Package (PyPI) | API reference documentation | Product documentation | Samples

This package has been tested with Python 3.8, 3.9, 3.10, 3.11 and 3.12.

For a more complete set of Azure libraries, see https://aka.ms/azsdk/python/all.

Getting started

Prerequisites

Install the package

Install the Azure AI generative package for Python with pip:

pip install azure-ai-resources
pip install azure-identity

Authenticate the client

from azure.ai.resources.client import AIClient
from azure.identity import DefaultAzureCredential

ai_client = AIClient(credential=DefaultAzureCredential(), subscription_id='subscription_id',
                     resource_group_name='resource_group', project_name='project_name')

Key concepts

Use this library within your Azure AI projects to provide control plane operations for creating and managing data, indexes, models and deployments.

Examples

View our samples repository on GitHub for examples demonstrating how to use the Azure AI Generative Python SDK.

Troubleshooting

General

Azure AI clients raise exceptions defined in Azure Core.

from azure.core.exceptions import HttpResponseError

try:
    ai_client.compute.get("cpu-cluster")
except HttpResponseError as error:
    print("Request failed: {}".format(error.message))

Logging

This library uses the standard logging library for logging. Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO level.

Detailed DEBUG level logging, including request/response bodies and unredacted headers, can be enabled on a client with the logging_enable argument.

See full SDK logging documentation with examples here.

Telemetry

The Azure AI Generative Python SDK includes a telemetry feature that collects usage and failure data about the SDK and sends it to Microsoft when you use the SDK in a Jupyter Notebook only. Telemetry will not be collected for any use of the Python SDK outside of a Jupyter Notebook.

Telemetry data helps the SDK team understand how the SDK is used so it can be improved and the information about failures helps the team resolve problems and fix bugs. The SDK telemetry feature is enabled by default for Jupyter Notebook usage and cannot be enabled for non-Jupyter scenarios. To opt out of the telemetry feature in a Jupyter scenario, set the environment variable "AZURE_AI_RESOURCES_ENABLE_LOGGING" to "False".

Next steps

View our samples repository on GitHub for examples demonstrating how to use the Azure AI Generative Python SDK.

Contributing

If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.

Impressions

Release History

1.0.0b8 (2024-03-27)

Features Added

  • Connections LIST operation now supports returning data connections via new optional flag: include_data_connections.
  • Connections have read-only support for 3 new connection types: gen 2, data lake, and azure blob.

Bugs Fixed

  • Connections docstrings now discuss scope field.

Other Changes

  • Bug fixes

1.0.0b7 (2024-02-07)

Other Changes

  • Bug fixes

1.0.0b6 (2024-02-06)

Other Changes

  • Bug fixes

1.0.0b5 (2024-02-01)

Other Changes

  • Duplicate cleanup

1.0.0b4 (2024-02-01)

Other Changes

  • Use openai v1 environment variable

1.0.0b3 (2024-01-30)

Features Added

  • AzureOpenAIConnection.set_current_environment supports openai 1.0 and above.

Other Changes

  • Support for Python 3.12

1.0.0b2 (2023-11-30)

Other Changes

  • Dependency improvements.

1.0.0b1 (2023-11-10)

Features Added

  • First preview.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure-ai-resources-1.0.0b8.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

azure_ai_resources-1.0.0b8-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

Details for the file azure-ai-resources-1.0.0b8.tar.gz.

File metadata

File hashes

Hashes for azure-ai-resources-1.0.0b8.tar.gz
Algorithm Hash digest
SHA256 643e562f41359f3805259aec5e37ff645c90aec1b60c338d999ad02a07c0ed0e
MD5 71274301e4d9825f0b35454b9c0239cb
BLAKE2b-256 d71a233b131e75ae76f7b81b7f93f05cc58e25ccadc79092a1095bb16bcb80da

See more details on using hashes here.

File details

Details for the file azure_ai_resources-1.0.0b8-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_ai_resources-1.0.0b8-py3-none-any.whl
Algorithm Hash digest
SHA256 1dec87ef6d049f2b042bceb4ff9b508c800b942aff94ed8eb14eee25ff9e8444
MD5 dc19dd6cc8a87f816f4fcf963a869680
BLAKE2b-256 df450820bc29f823d2f226fb0fd1a3c24f47e0806e71e1815adc84180d01b223

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page