다음을 통해 공유


CapabilityHost Class

Note

This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.

Initialize a CapabilityHost instance. Capabilityhost management is controlled by MLClient's capabilityhosts operations.

Inheritance
azure.ai.ml.entities._resource.Resource
CapabilityHost

Constructor

CapabilityHost(*, name: str, description: str | None = None, vector_store_connections: List[str] | None = None, ai_services_connections: List[str] | None = None, storage_connections: List[str] | None = None, capability_host_kind: str | CapabilityHostKind = CapabilityHostKind.AGENTS, **kwargs: Any)

Parameters

Name Description
name
Required
str

The name of the capability host.

description
Required

The description of the capability host.

vector_store_connections
Required

A list of vector store (AI Search) connections.

ai_services_connections
Required

A list of OpenAI service connection.

storage_connections
Required

A list of storage connections. Default storage connection value is projectname/workspaceblobstore for project workspace.

capability_host_kind
Required

The kind of capability host, either as a string or CapabilityHostKind enum. Default is AGENTS.

kwargs
Required
Any

Additional keyword arguments.

Examples

Create a CapabilityHost object.


   from azure.ai.ml.entities._workspace._ai_workspaces.capability_host import (
       CapabilityHost,
   )
   from azure.ai.ml.constants._workspace import CapabilityHostKind

   # CapabilityHost in Hub workspace. For Hub workspace, only name and description are required.
   capability_host = CapabilityHost(
       name="test-capability-host",
       description="some description",
       capability_host_kind=CapabilityHostKind.AGENTS,
   )

   # CapabilityHost in Project workspace
   capability_host = CapabilityHost(
       name="test-capability-host",
       description="some description",
       capability_host_kind=CapabilityHostKind.AGENTS,
       ai_services_connections=["connection1"],
       storage_connections=["projectname/workspaceblobstore"],
       vector_store_connections=["connection1"],
   )

Methods

dump

Dump the CapabilityHost content into a file in yaml format.

dump

Dump the CapabilityHost content into a file in yaml format.

dump(dest: str | PathLike | IO | None, **kwargs: Any) -> None

Parameters

Name Description
dest
Required
Union[<xref:PathLike>, str, IO[AnyStr]]

The destination to receive this CapabilityHost's content. Must be either a path to a local file, or an already-open file stream. If dest is a file path, a new file will be created, and an exception is raised if the file exists. If dest is an open file, the file will be written to directly, and an exception will be raised if the file is not writable.

Attributes

base_path

The base path of the resource.

Returns

Type Description
str

The base path of the resource.

creation_context

The creation context of the resource.

Returns

Type Description

The creation metadata for the resource.

id

The resource ID.

Returns

Type Description

The global ID of the resource, an Azure Resource Manager (ARM) ID.