azure.ai.resources.entities package¶
- class azure.ai.resources.entities.AIResource(*, name: str, description: str | None = None, tags: Dict[str, str] | None = None, display_name: str | None = None, location: str | None = None, resource_group: str | None = None, managed_network: ManagedNetwork | None = None, storage_account: str | None = None, customer_managed_key: CustomerManagedKey | None = None, public_network_access: str | None = None, identity: IdentityConfiguration | None = None, container_registry: str | None = None, primary_user_assigned_identity: str | None = None, default_project_resource_group: str | None = None, **kwargs)[source]¶
An AI Resource, which serves as a container for projects and other AI-related objects
- Parameters:
name (str) – The name for the AI resource.
description (Optional[str]) – The description of the AI resource.
tags (Optional[Dict[str, str]]) – The tags for the AI resource.
display_name (Optional[str]) – The display name for the AI resource.
location (Optional[str]) – The location for the AI resource.
resource_group (Optional[str]) – The resource group associated with the AI resource.
managed_network (Optional[ManagedNetwork]) – The managed network associated with the AI resource.
storage_account (Optional[str]) – The storage account associated with the AI resource.
customer_managed_key (Optional[CustomerManagedKey]) – The customer managed key associated with the AI resource.
public_network_access (Optional[str]) – The public network access associated with the AI resource.
identity (Optional[IdentityConfiguration]) – The identity associated with the AI resource.
container_registry (Optional[str]) – The container registry associated with the AI resource.
primary_user_assigned_identity (Optional[str]) – The primary user assigned identity associated with the AI resource.
default_project_resource_group (Optional[str]) – The default project’s resource group.
- property container_registry: str¶
The container registry associated with the workspace hub.
- Returns:
The container registry associated with the workspace hub.
- Return type:
- property customer_managed_key: CustomerManagedKey | None¶
The customer managed key associated with the workspace hub.
- Returns:
The customer managed key associated with the workspace hub.
- Return type:
Optional[CustomerManagedKey]
- property default_project_resource_group: str¶
The default project’s resource group.
- Returns:
The name of the default project’s resource group.
- Return type:
- property description: str¶
The workspace hub description.
- Returns:
The workspace hub description.
- Return type:
- property display_name: str¶
The workspace hub’s display name.
- Returns:
The display name of the workspace hub.
- Return type:
- property enable_data_isolation: bool¶
Whether or not data isolation is enabled for the workspace hub.
- Returns:
Boolean value indicating whether or not data isolation is enabled for the workspace hub.
- Return type:
- property existing_workspaces: List[str]¶
The existing workspaces related to the workspace hub.
- Returns:
The names of the existing workspaces related to the workspace hub.
- Return type:
List[str]
- property id: str¶
The workspace hub ID. Read-only, set by the backend.
- Returns:
The workspace hub ID.
- Return type:
- property identity: IdentityConfiguration | None¶
The identity associated with the workspace hub.
- Returns:
The identity associated with the workspace hub.
- Return type:
Optional[IdentityConfiguration]
- property location: str¶
The workspace hub location.
- Returns:
The location of the workspace hub.
- Return type:
- property managed_network: ManagedNetwork | None¶
The managed network to which the workspace hub is connected.
- Returns:
The name of the managed network associated with the workspace hub.
- Return type:
Optional[ManagedNetwork]
- property primary_user_assigned_identity: str¶
The primary user assigned identity associated with the workspace hub.
- Returns:
The primary user assigned identity associated with the workspace hub.
- Return type:
- property public_network_access: str¶
The public network access to assign to the workspace hub.
- Returns:
The public network access to assign to the workspace hub.
- Return type:
- property resource_group: str¶
The workspace hub’s resource group.
- Returns:
The name of the resource group associated with the workspace hub.
- Return type:
- class azure.ai.resources.entities.ApiKeyConfiguration(*, key: str)[source]¶
Note
This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.
Api Key Credentials.
- Parameters:
key (str) – API key id
- class azure.ai.resources.entities.AzureAISearchConnection(*, target: str, credentials: ApiKeyConfiguration, api_version: str | None = None, **kwargs)[source]¶
A Connection for Azure AI Search
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
api_version (Optional[str]) – The api version that this connection was created for. Only applies to certain connection types.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)[source]¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connetion, pass in a credential object. As a Cognitive Search Connection, this sets two environment variables: AZURE_AI_SEARCH_(ENDPOINT|KEY).
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property api_version: str | None¶
The API version of the connection.
- Returns:
the API version of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.AzureAIServiceConnection(*, target: str, credentials: ApiKeyConfiguration, api_version: str | None = None, kind: str, **kwargs)[source]¶
A Connection for an Azure Cognitive Service. Note: This object usually shouldn’t be created manually by users. To get the default AzureOpenAIConnection for an AI Resource, use an AIClient object to call the ‘get_default_content_safety_connection’ function.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
api_version (Optional[str]) – The api version that this connection was created for.
kind (str) – The kind of ai service that this connection points to. Valid inputs include: “AzureOpenAI”, “ContentSafety”, and “Speech”.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property api_version: str | None¶
The API version of the connection.
- Returns:
The API version of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property kind: str | None¶
The kind of the connection.
- Returns:
the kind of the connection.
- Return type:
Optional[str]
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.AzureBlobStoreConnection(*, target: str, container_name: str, account_name: str, **kwargs)[source]¶
A Connection to an Azure Blob Datastore. Unlike other connection objects, this subclass has no credentials. NOTE: This connection type is currently READ-ONLY via the LIST operation. Attempts to create or update a connection of this type will result in an error.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the resource.
container_name (str) – The container name of the connection.
account_name (str) – The account name of the connection.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property account_name: str | None¶
The account name of the connection.
- Returns:
the account name of the connection.
- Return type:
Optional[str]
- property container_name: str | None¶
The container name of the connection.
- Returns:
the container name of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.AzureOpenAIConnection(*, target: str, credentials: ApiKeyConfiguration, api_version: str | None = None, api_type: str = 'Azure', **kwargs)[source]¶
A Connection for Azure Open AI. Note: This object usually shouldn’t be created manually by users. To get the default AzureOpenAIConnection for an AI Resource, use an AIClient object to call the ‘get_default_aoai_connection’ function.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
api_version (Optional[str]) – The api version that this connection was created for.
api_type (str) – The api type that this connection was created for. Defaults to “Azure” and currently rarely changes.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)[source]¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connetion, pass in a credential object. As an Azure Open AI connection, this sets 4 environment variables: OPEN_API_(TYPE|KEY|BASE|VERSION).
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property api_type: str | None¶
The API type of the connection.
- Returns:
The API type of the connection.
- Return type:
Optional[str]
- property api_version: str | None¶
The API version of the connection.
- Returns:
the API version of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.AzureOpenAIDeployment(*, sku: _models.AzureOpenAISku, properties: _models.AzureOpenAIDeploymentProperties | None = None, **kwargs: Any)[source]¶
Concrete proxy resource types can be created by aliasing this type using a specific property type.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to server.
- Variables:
id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long Required.
type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”. Required.
system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.
properties (AzureOpenAIDeploymentProperties) – The resource-specific properties for this resource.
name (str) – The name of the deployment. Required.
sku (AzureOpenAISku) – SKU information for deployment. Required.
- Keyword Arguments:
id (str) – Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long Required.
type (str) – The type of the resource. E.g. “Microsoft.Compute/virtualMachines” or “Microsoft.Storage/storageAccounts”. Required.
system_data (SystemData) – Azure Resource Manager metadata containing createdBy and modifiedBy information.
properties (AzureOpenAIDeploymentProperties) – The resource-specific properties for this resource.
name (str) – The name of the deployment. Required.
- as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) MutableMapping[str, Any] ¶
Return a dict that can be serialized using json.dump.
Advanced usage might optionally use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters:
key_transformer (function) – A key transformer function.
- Returns:
A dict JSON compatible object
- Return type:
- classmethod deserialize(data: Any, content_type: str | None = None) ModelType ¶
Parse a str using the RestAPI syntax and return a model.
- classmethod from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) ModelType ¶
Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
- class azure.ai.resources.entities.AzureOpenAIDeploymentProperties(*, model: _models.AzureOpenAIModel, **kwargs: Any)[source]¶
Deployment properties.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to server.
- Variables:
- Keyword Arguments:
- as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) MutableMapping[str, Any] ¶
Return a dict that can be serialized using json.dump.
Advanced usage might optionally use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters:
key_transformer (function) – A key transformer function.
- Returns:
A dict JSON compatible object
- Return type:
- classmethod deserialize(data: Any, content_type: str | None = None) ModelType ¶
Parse a str using the RestAPI syntax and return a model.
- classmethod from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) ModelType ¶
Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
- class azure.ai.resources.entities.AzureOpenAIModel(*, name: str, version: str, **kwargs: Any)[source]¶
Model information for Azure OpenAI Deployment.
All required parameters must be populated in order to send to server.
- Variables:
- Keyword Arguments:
- as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) MutableMapping[str, Any] ¶
Return a dict that can be serialized using json.dump.
Advanced usage might optionally use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters:
key_transformer (function) – A key transformer function.
- Returns:
A dict JSON compatible object
- Return type:
- classmethod deserialize(data: Any, content_type: str | None = None) ModelType ¶
Parse a str using the RestAPI syntax and return a model.
- classmethod from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) ModelType ¶
Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
- class azure.ai.resources.entities.AzureOpenAIModelConfiguration(api_base: str, api_key: str, api_version: str | None, model_name: str, deployment_name: str, model_kwargs: Dict[str, Any])[source]¶
Configuration for an Azure OpenAI model.
- Parameters:
api_base (str) – The base URL for the OpenAI API.
api_key (str) – The OpenAI API key.
api_version (Optional[str]) – The OpenAI API version.
model_name (str) – The name of the model.
deployment_name (str) – The name of the deployment.
model_kwargs (Dict[str, Any]) – Additional keyword arguments for the model.
- static from_connection(connection: AzureOpenAIConnection, model_name: str, deployment_name: str, **model_kwargs) AzureOpenAIModelConfiguration [source]¶
Create an Azure OpenAI model configuration from an Azure OpenAI Connection.
- Parameters:
- Returns:
The Azure OpenAI model configuration.
- Return type:
AzureOpenAIModelConfiguration
- Raises:
TypeError – If the connection is not an AzureOpenAIConnection.
ValueError – If the connection does not contain an OpenAI key.
- class azure.ai.resources.entities.AzureOpenAISku(*, capacity: int, **kwargs: Any)[source]¶
Sku informatioin for Azure OpenAI Deployment.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to server.
- Variables:
- Keyword Arguments:
- as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) MutableMapping[str, Any] ¶
Return a dict that can be serialized using json.dump.
Advanced usage might optionally use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters:
key_transformer (function) – A key transformer function.
- Returns:
A dict JSON compatible object
- Return type:
- classmethod deserialize(data: Any, content_type: str | None = None) ModelType ¶
Parse a str using the RestAPI syntax and return a model.
- classmethod from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) ModelType ¶
Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
- class azure.ai.resources.entities.BaseConnection(*, target: str, type: str, credentials: ApiKeyConfiguration, is_shared: bool = True, **kwargs)[source]¶
A connection to a another system or service. This is a base class and should only be directly used to cover the simplest of connection types that don’t merit their own subclass.
- Parameters:
name (str) – The name of the connection
target (str) – The URL or ARM resource ID of the external resource.
type (str) – The type of connection this represents. Acceptable values include: “azure_open_ai”, “cognitive_service”, “cognitive_search”, “git”, “azure_blob”, and “custom”.
credentials (ApiKeyConfiguration) – The credentials for authenticating to the external resource.
description (str) – A description of the connection.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
id (str) – The connection’s resource id.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
- set_current_environment(credential: TokenCredential | None = None)[source]¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.CustomConnection(*, target: str, credentials: ApiKeyConfiguration, **kwargs)[source]¶
A Connection to system that’s not encapsulated by other connection types.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.Data(name: str, path: str, version: str | None = None, type: str = 'folder', description: str | None = None, tags: Dict[str, str] | None = None, properties: Dict[str, str] | None = None)[source]¶
Data asset
- Parameters:
name (str) – The name of the data asset.
path (str) – The path to the data asset.
version (Optional[str]) – The version of the data asset.
type (str) – The type of the data asset. Defaults to ~azure.ai.resources.constants.AssetTypes.FOLDER. Accepted values include: ~azure.ai.resources.constants.AssetTypes.FILE, ~azure.ai.resources.constants.AssetTypes.FOLDER, and ~azure.ai.resources.constants.AssetTypes.TABLE.
description (Optional[str]) – The description of the data asset.
tags (Optional[Dict[str, str]]) – The tags of the data asset.
properties (Optional[Dict[str, str]]) – The properties of the data asset.
- class azure.ai.resources.entities.GitHubConnection(*, target: str, credentials: ApiKeyConfiguration, **kwargs)[source]¶
A Connection to GitHub.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.Index(name: str, path: str | Path, version: str | None = None, description: str | None = None, tags: Dict[str, str] | None = None, properties: Dict[str, str] | None = None)[source]¶
A search index for queries
- Parameters:
name (str) – The name of the index.
path (str) – The path to the index files.
version (Optional[str]) – The version of the index.
description (Optional[str]) – The description of the index.
tags (Optional[Dict[str, str]]) – Tags associated with the index.
properties (Optional[Dict[str, str]]) – The properties of the index.
- override_connections(aoai_connection: AzureOpenAIConnection | None = None, acs_connection: AzureAISearchConnection | None = None) None [source]¶
Override the connections in the index with the provided connections
- Parameters:
aoai_connection (Optional[AzureOpenAIConnection]) – The AzureOpenAIConnection to override the index’s connection with.
acs_connection (Optional[AzureAISearchConnection]) – The AzureAISearchConnection to override the index’s connection with.
- query(text: str) List[Document] [source]¶
Query the index with the provided text
- Parameters:
text (str) – The text to query the index with.
- Returns:
A list of documents relevant to the query.
- Return type:
List[azure.ai.resources._index._langchain.vendor.schema.document.Document]
- Raises:
ImportError – If the azure-ai-generative[index] package is not installed
- class azure.ai.resources.entities.Project(*, name: str, ai_resource: str, description: str | None = None, tags: Dict[str, str] | None = None, display_name: str | None = None, location: str | None = None, resource_group: str | None = None, **kwargs)[source]¶
A Project is a lightweight object for orchestrating AI applications, and is parented by an AI resource.
- Parameters:
name (str) – The name of the project.
ai_resource (str) – The AI resource parent of the project.
description (Optional[str]) – The description of the project.
tags (Optional[Dict[str, str]]) – Tags associated with the project.
display_name (Optional[str]) – The display name of the project.
location (Optional[str]) – The location of the project.
resource_group (Optional[str]) – The project’s resource group name.
- property ai_resource: str¶
The AI resource parent of the project.
- Returns:
Name of the AI resource.
- Return type:
- property description: str¶
The description of the project.
- Returns:
Name of the project.
- Return type:
- property location: str¶
The location of the project.
- Returns:
The location of the project.
- Return type:
- class azure.ai.resources.entities.SystemData(*, created_by: str | None = None, created_by_type: str | _models.CreatedByType | None = None, created_at: str | None = None, last_modified_by: str | None = None, last_modified_by_type: str | _models.CreatedByType | None = None, last_modified_at: str | None = None, **kwargs: Any)[source]¶
Metadata pertaining to creation and last modification of the resource.
Variables are only populated by the server, and will be ignored when sending a request.
- Variables:
created_by (str) – The identity that created the resource.
created_by_type (str or CreatedByType) – The type of identity that created the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.
created_at (str) – The type of identity that created the resource.
last_modified_by (str) – The identity that last modified the resource.
last_modified_by_type (str or CreatedByType) – The type of identity that last modified the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.
last_modified_at (str) – The timestamp of resource last modification (UTC).
- Keyword Arguments:
created_by (str) – The identity that created the resource.
created_by_type (str or CreatedByType) – The type of identity that created the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.
created_at (str) – The type of identity that created the resource.
last_modified_by (str) – The identity that last modified the resource.
last_modified_by_type (str or CreatedByType) – The type of identity that last modified the resource. Known values are: “User”, “Application”, “ManagedIdentity”, and “Key”.
last_modified_at (str) – The timestamp of resource last modification (UTC).
- as_dict(keep_readonly: bool = True, key_transformer: ~typing.Callable[[str, ~typing.Dict[str, ~typing.Any], ~typing.Any], ~typing.Any] = <function attribute_transformer>, **kwargs: ~typing.Any) MutableMapping[str, Any] ¶
Return a dict that can be serialized using json.dump.
Advanced usage might optionally use a callback as parameter:
Key is the attribute name used in Python. Attr_desc is a dict of metadata. Currently contains ‘type’ with the msrest type and ‘key’ with the RestAPI encoded key. Value is the current value in this object.
The string returned will be used to serialize the key. If the return type is a list, this is considered hierarchical result dict.
See the three examples in this file:
attribute_transformer
full_restapi_key_transformer
last_restapi_key_transformer
If you want XML serialization, you can pass the kwargs is_xml=True.
- Parameters:
key_transformer (function) – A key transformer function.
- Returns:
A dict JSON compatible object
- Return type:
- classmethod deserialize(data: Any, content_type: str | None = None) ModelType ¶
Parse a str using the RestAPI syntax and return a model.
- classmethod from_dict(data: Any, key_extractors: Callable[[str, Dict[str, Any], Any], Any] | None = None, content_type: str | None = None) ModelType ¶
Parse a dict using given key extractor return a model.
By default consider key extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor and last_rest_key_case_insensitive_extractor)
Submodules¶
azure.ai.resources.entities.ai_resource module¶
- class azure.ai.resources.entities.ai_resource.AIResource(*, name: str, description: str | None = None, tags: Dict[str, str] | None = None, display_name: str | None = None, location: str | None = None, resource_group: str | None = None, managed_network: ManagedNetwork | None = None, storage_account: str | None = None, customer_managed_key: CustomerManagedKey | None = None, public_network_access: str | None = None, identity: IdentityConfiguration | None = None, container_registry: str | None = None, primary_user_assigned_identity: str | None = None, default_project_resource_group: str | None = None, **kwargs)[source]¶
An AI Resource, which serves as a container for projects and other AI-related objects
- Parameters:
name (str) – The name for the AI resource.
description (Optional[str]) – The description of the AI resource.
tags (Optional[Dict[str, str]]) – The tags for the AI resource.
display_name (Optional[str]) – The display name for the AI resource.
location (Optional[str]) – The location for the AI resource.
resource_group (Optional[str]) – The resource group associated with the AI resource.
managed_network (Optional[ManagedNetwork]) – The managed network associated with the AI resource.
storage_account (Optional[str]) – The storage account associated with the AI resource.
customer_managed_key (Optional[CustomerManagedKey]) – The customer managed key associated with the AI resource.
public_network_access (Optional[str]) – The public network access associated with the AI resource.
identity (Optional[IdentityConfiguration]) – The identity associated with the AI resource.
container_registry (Optional[str]) – The container registry associated with the AI resource.
primary_user_assigned_identity (Optional[str]) – The primary user assigned identity associated with the AI resource.
default_project_resource_group (Optional[str]) – The default project’s resource group.
- property container_registry: str¶
The container registry associated with the workspace hub.
- Returns:
The container registry associated with the workspace hub.
- Return type:
- property customer_managed_key: CustomerManagedKey | None¶
The customer managed key associated with the workspace hub.
- Returns:
The customer managed key associated with the workspace hub.
- Return type:
Optional[CustomerManagedKey]
- property default_project_resource_group: str¶
The default project’s resource group.
- Returns:
The name of the default project’s resource group.
- Return type:
- property description: str¶
The workspace hub description.
- Returns:
The workspace hub description.
- Return type:
- property display_name: str¶
The workspace hub’s display name.
- Returns:
The display name of the workspace hub.
- Return type:
- property enable_data_isolation: bool¶
Whether or not data isolation is enabled for the workspace hub.
- Returns:
Boolean value indicating whether or not data isolation is enabled for the workspace hub.
- Return type:
- property existing_workspaces: List[str]¶
The existing workspaces related to the workspace hub.
- Returns:
The names of the existing workspaces related to the workspace hub.
- Return type:
List[str]
- property id: str¶
The workspace hub ID. Read-only, set by the backend.
- Returns:
The workspace hub ID.
- Return type:
- property identity: IdentityConfiguration | None¶
The identity associated with the workspace hub.
- Returns:
The identity associated with the workspace hub.
- Return type:
Optional[IdentityConfiguration]
- property location: str¶
The workspace hub location.
- Returns:
The location of the workspace hub.
- Return type:
- property managed_network: ManagedNetwork | None¶
The managed network to which the workspace hub is connected.
- Returns:
The name of the managed network associated with the workspace hub.
- Return type:
Optional[ManagedNetwork]
- property primary_user_assigned_identity: str¶
The primary user assigned identity associated with the workspace hub.
- Returns:
The primary user assigned identity associated with the workspace hub.
- Return type:
- property public_network_access: str¶
The public network access to assign to the workspace hub.
- Returns:
The public network access to assign to the workspace hub.
- Return type:
- property resource_group: str¶
The workspace hub’s resource group.
- Returns:
The name of the resource group associated with the workspace hub.
- Return type:
azure.ai.resources.entities.base_connection module¶
- class azure.ai.resources.entities.base_connection.BaseConnection(*, target: str, type: str, credentials: ApiKeyConfiguration, is_shared: bool = True, **kwargs)[source]¶
A connection to a another system or service. This is a base class and should only be directly used to cover the simplest of connection types that don’t merit their own subclass.
- Parameters:
name (str) – The name of the connection
target (str) – The URL or ARM resource ID of the external resource.
type (str) – The type of connection this represents. Acceptable values include: “azure_open_ai”, “cognitive_service”, “cognitive_search”, “git”, “azure_blob”, and “custom”.
credentials (ApiKeyConfiguration) – The credentials for authenticating to the external resource.
description (str) – A description of the connection.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
id (str) – The connection’s resource id.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
- set_current_environment(credential: TokenCredential | None = None)[source]¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
azure.ai.resources.entities.configs module¶
- class azure.ai.resources.entities.configs.AzureOpenAIModelConfiguration(api_base: str, api_key: str, api_version: str | None, model_name: str, deployment_name: str, model_kwargs: Dict[str, Any])[source]¶
Configuration for an Azure OpenAI model.
- Parameters:
api_base (str) – The base URL for the OpenAI API.
api_key (str) – The OpenAI API key.
api_version (Optional[str]) – The OpenAI API version.
model_name (str) – The name of the model.
deployment_name (str) – The name of the deployment.
model_kwargs (Dict[str, Any]) – Additional keyword arguments for the model.
- static from_connection(connection: AzureOpenAIConnection, model_name: str, deployment_name: str, **model_kwargs) AzureOpenAIModelConfiguration [source]¶
Create an Azure OpenAI model configuration from an Azure OpenAI Connection.
- Parameters:
- Returns:
The Azure OpenAI model configuration.
- Return type:
AzureOpenAIModelConfiguration
- Raises:
TypeError – If the connection is not an AzureOpenAIConnection.
ValueError – If the connection does not contain an OpenAI key.
azure.ai.resources.entities.connection_subtypes module¶
- class azure.ai.resources.entities.connection_subtypes.AzureAISearchConnection(*, target: str, credentials: ApiKeyConfiguration, api_version: str | None = None, **kwargs)[source]¶
A Connection for Azure AI Search
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
api_version (Optional[str]) – The api version that this connection was created for. Only applies to certain connection types.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)[source]¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connetion, pass in a credential object. As a Cognitive Search Connection, this sets two environment variables: AZURE_AI_SEARCH_(ENDPOINT|KEY).
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property api_version: str | None¶
The API version of the connection.
- Returns:
the API version of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.connection_subtypes.AzureAIServiceConnection(*, target: str, credentials: ApiKeyConfiguration, api_version: str | None = None, kind: str, **kwargs)[source]¶
A Connection for an Azure Cognitive Service. Note: This object usually shouldn’t be created manually by users. To get the default AzureOpenAIConnection for an AI Resource, use an AIClient object to call the ‘get_default_content_safety_connection’ function.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
api_version (Optional[str]) – The api version that this connection was created for.
kind (str) – The kind of ai service that this connection points to. Valid inputs include: “AzureOpenAI”, “ContentSafety”, and “Speech”.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property api_version: str | None¶
The API version of the connection.
- Returns:
The API version of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property kind: str | None¶
The kind of the connection.
- Returns:
the kind of the connection.
- Return type:
Optional[str]
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.connection_subtypes.AzureBlobStoreConnection(*, target: str, container_name: str, account_name: str, **kwargs)[source]¶
A Connection to an Azure Blob Datastore. Unlike other connection objects, this subclass has no credentials. NOTE: This connection type is currently READ-ONLY via the LIST operation. Attempts to create or update a connection of this type will result in an error.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the resource.
container_name (str) – The container name of the connection.
account_name (str) – The account name of the connection.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property account_name: str | None¶
The account name of the connection.
- Returns:
the account name of the connection.
- Return type:
Optional[str]
- property container_name: str | None¶
The container name of the connection.
- Returns:
the container name of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.connection_subtypes.AzureOpenAIConnection(*, target: str, credentials: ApiKeyConfiguration, api_version: str | None = None, api_type: str = 'Azure', **kwargs)[source]¶
A Connection for Azure Open AI. Note: This object usually shouldn’t be created manually by users. To get the default AzureOpenAIConnection for an AI Resource, use an AIClient object to call the ‘get_default_aoai_connection’ function.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
api_version (Optional[str]) – The api version that this connection was created for.
api_type (str) – The api type that this connection was created for. Defaults to “Azure” and currently rarely changes.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)[source]¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connetion, pass in a credential object. As an Azure Open AI connection, this sets 4 environment variables: OPEN_API_(TYPE|KEY|BASE|VERSION).
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property api_type: str | None¶
The API type of the connection.
- Returns:
The API type of the connection.
- Return type:
Optional[str]
- property api_version: str | None¶
The API version of the connection.
- Returns:
the API version of the connection.
- Return type:
Optional[str]
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.connection_subtypes.CustomConnection(*, target: str, credentials: ApiKeyConfiguration, **kwargs)[source]¶
A Connection to system that’s not encapsulated by other connection types.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
- class azure.ai.resources.entities.connection_subtypes.GitHubConnection(*, target: str, credentials: ApiKeyConfiguration, **kwargs)[source]¶
A Connection to GitHub.
- Parameters:
name (str) – Name of the connection.
target (str) – The URL or ARM resource ID of the external resource.
credentials (ApiKeyConfiguration) – The credentials for authenticating the external resource.
is_shared (bool) – For connections created for a project, this determines if the connection is shared amongst other connections with that project’s parent AI resource. Defaults to True.
tags (dict) – Tag dictionary. Tags can be added, removed, and updated.
- set_current_environment(credential: TokenCredential | None = None)¶
Sets the current environment to use the connection. To use AAD auth for AzureOpenAI connection, pass in a credential object. Only certain types of connections make use of this function. Those that don’t will raise an error if this is called.
- Parameters:
credential (
TokenCredential
) – Optional credential to use for the connection. If not provided, the connection’s credentials will be used.
- property credentials: ApiKeyConfiguration¶
Get the credentials for the connection.
- Returns:
This connection’s credentials.
- Return type:
ApiKeyConfiguration
- property id: str | None¶
The resource ID.
- Returns:
The global ID of the resource, an Azure Resource Manager (ARM) ID.
- Return type:
Optional[str]
Get the Boolean describing if this connection is shared amongst its cohort within a workspace hub. Only applicable for connections that are project-scoped on creation.
- Return type:
- property metadata: Dict[str, Any]¶
Deprecated. Use tags.
- Returns:
This connection’s tags/metadata.
- Return type:
Dict[str, Any]
- property tags: Dict[str, Any]¶
Tags for the connection.
- Returns:
This connection’s tags.
- Return type:
Dict[str, Any]
azure.ai.resources.entities.data module¶
- class azure.ai.resources.entities.data.Data(name: str, path: str, version: str | None = None, type: str = 'folder', description: str | None = None, tags: Dict[str, str] | None = None, properties: Dict[str, str] | None = None)[source]¶
Data asset
- Parameters:
name (str) – The name of the data asset.
path (str) – The path to the data asset.
version (Optional[str]) – The version of the data asset.
type (str) – The type of the data asset. Defaults to ~azure.ai.resources.constants.AssetTypes.FOLDER. Accepted values include: ~azure.ai.resources.constants.AssetTypes.FILE, ~azure.ai.resources.constants.AssetTypes.FOLDER, and ~azure.ai.resources.constants.AssetTypes.TABLE.
description (Optional[str]) – The description of the data asset.
tags (Optional[Dict[str, str]]) – The tags of the data asset.
properties (Optional[Dict[str, str]]) – The properties of the data asset.
azure.ai.resources.entities.deployment_keys module¶
azure.ai.resources.entities.mlindex module¶
- class azure.ai.resources.entities.mlindex.Index(name: str, path: str | Path, version: str | None = None, description: str | None = None, tags: Dict[str, str] | None = None, properties: Dict[str, str] | None = None)[source]¶
A search index for queries
- Parameters:
name (str) – The name of the index.
path (str) – The path to the index files.
version (Optional[str]) – The version of the index.
description (Optional[str]) – The description of the index.
tags (Optional[Dict[str, str]]) – Tags associated with the index.
properties (Optional[Dict[str, str]]) – The properties of the index.
- override_connections(aoai_connection: AzureOpenAIConnection | None = None, acs_connection: AzureAISearchConnection | None = None) None [source]¶
Override the connections in the index with the provided connections
- Parameters:
aoai_connection (Optional[AzureOpenAIConnection]) – The AzureOpenAIConnection to override the index’s connection with.
acs_connection (Optional[AzureAISearchConnection]) – The AzureAISearchConnection to override the index’s connection with.
- query(text: str) List[Document] [source]¶
Query the index with the provided text
- Parameters:
text (str) – The text to query the index with.
- Returns:
A list of documents relevant to the query.
- Return type:
List[azure.ai.resources._index._langchain.vendor.schema.document.Document]
- Raises:
ImportError – If the azure-ai-generative[index] package is not installed
azure.ai.resources.entities.models module¶
- class azure.ai.resources.entities.models.Model(path: str | PathLike, conda_file: str | PathLike | None = None, loader_module: str | None = None, chat_module: str | None = None)[source]¶
A model asset
- Parameters:
path (Union[str, os.PathLike]) – The path to the model.
conda_file (Optional[Union[str, os.PathLike]]) – The path to the conda file for the model.
loader_module (Optional[str]) – The loader module for the model.
chat_module (Optional[str]) – The chat module for the model.
azure.ai.resources.entities.project module¶
- class azure.ai.resources.entities.project.Project(*, name: str, ai_resource: str, description: str | None = None, tags: Dict[str, str] | None = None, display_name: str | None = None, location: str | None = None, resource_group: str | None = None, **kwargs)[source]¶
A Project is a lightweight object for orchestrating AI applications, and is parented by an AI resource.
- Parameters:
name (str) – The name of the project.
ai_resource (str) – The AI resource parent of the project.
description (Optional[str]) – The description of the project.
tags (Optional[Dict[str, str]]) – Tags associated with the project.
display_name (Optional[str]) – The display name of the project.
location (Optional[str]) – The location of the project.
resource_group (Optional[str]) – The project’s resource group name.
- property ai_resource: str¶
The AI resource parent of the project.
- Returns:
Name of the AI resource.
- Return type:
- property description: str¶
The description of the project.
- Returns:
Name of the project.
- Return type:
- property location: str¶
The location of the project.
- Returns:
The location of the project.
- Return type:
azure.ai.resources.entities.single_deployment module¶
- class azure.ai.resources.entities.single_deployment.SingleDeployment(name: str, model: str | Model | PromptflowModel, app_insights_enabled: bool = True, data_collector_enabled: bool = True, endpoint_name: str | None = None, environment_variables: Dict[str, str] | None = None, instance_type: str | None = None, instance_count: str = '1', scoring_uri: str | None = None, properties: Dict[str, str] | None = None, tags: Dict[str, str] | None = None)[source]¶
A model deployment.
- Parameters:
name (str) – The name of the deployment.
model (Union[str, Model, PromptflowModel]) – The model to be deployed. This can be a model ID, a Model object, or a promptflow model.
app_insights_enabled (bool) – Whether to enable application insights. Defaults to True.
data_collector_enabled (bool) – Whether to enable data collection. Defaults to True.
endpoint_name (Optional[str]) – The name of the endpoint to deploy to.
environment_variables (Optional[Dict[str, str]]) – The environment variables for the deployment.
instance_type (Optional[str]) – The instance type for the deployment.
instance_count (str) – The number of instances for the deployment. Defaults to “1”.
scoring_uri (Optional[str]) – The scoring URI for the deployment.
properties (Optional[Dict[str, str]]) – The properties of the deployment.
tags (Optional[Dict[str, str]]) – The tags of the deployment.
- model: str | Model | PromptflowModel¶