4
4
5
5
import os
6
6
from os import PathLike
7
- from typing import (
8
- List ,
9
- Optional ,
10
- Union ,
11
- IO ,
12
- Any ,
13
- AnyStr ,
14
- Dict ,
15
- )
16
7
from pathlib import Path
17
- from azure .ai .ml ._utils ._experimental import experimental
18
- from azure .ai .ml .entities ._resource import Resource
19
- from azure .ai .ml .constants ._workspace import CapabilityHostKind
20
- from azure .ai .ml .constants ._common import (
21
- BASE_PATH_CONTEXT_KEY ,
22
- PARAMS_OVERRIDE_KEY ,
23
- )
8
+ from typing import IO , Any , AnyStr , Dict , List , Optional , Union
24
9
25
- from azure .ai .ml ._schema .workspace .ai_workspaces .capability_host import (
26
- CapabilityHostSchema ,
10
+ from azure .ai .ml ._restclient .v2025_01_01_preview .models ._models_py3 import CapabilityHost as RestCapabilityHost
11
+ from azure .ai .ml ._restclient .v2025_01_01_preview .models ._models_py3 import (
12
+ CapabilityHostProperties as RestCapabilityHostProperties ,
27
13
)
14
+ from azure .ai .ml ._schema .workspace .ai_workspaces .capability_host import CapabilityHostSchema
15
+ from azure .ai .ml ._utils ._experimental import experimental
28
16
from azure .ai .ml ._utils .utils import dump_yaml_to_file
17
+ from azure .ai .ml .constants ._common import BASE_PATH_CONTEXT_KEY , PARAMS_OVERRIDE_KEY
18
+ from azure .ai .ml .constants ._workspace import CapabilityHostKind
19
+ from azure .ai .ml .entities ._resource import Resource
29
20
from azure .ai .ml .entities ._util import load_from_dict
30
- from azure .ai .ml ._restclient .v2024_10_01_preview .models ._models_py3 import (
31
- CapabilityHost as RestCapabilityHost ,
32
- )
33
- from azure .ai .ml ._restclient .v2024_10_01_preview .models ._models_py3 import (
34
- CapabilityHostProperties as RestCapabilityHostProperties ,
35
- )
36
21
37
22
38
23
@experimental
@@ -51,6 +36,8 @@ class CapabilityHost(Resource):
51
36
:param storage_connections: A list of storage connections. Default storage connection value is
52
37
projectname/workspaceblobstore for project workspace.
53
38
:type storage_connections: Optional[List[str]]
39
+ :param thread_storage_connections: A list of cosmos db connections, which will be used for thread storage.
40
+ :type thread_storage_connections: Optional[List[str]]
54
41
:param capability_host_kind: The kind of capability host, either as a string or CapabilityHostKind enum.
55
42
Default is AGENTS.
56
43
:type capability_host_kind: Union[str, CapabilityHostKind]
@@ -75,6 +62,7 @@ def __init__(
75
62
vector_store_connections : Optional [List [str ]] = None ,
76
63
ai_services_connections : Optional [List [str ]] = None ,
77
64
storage_connections : Optional [List [str ]] = None ,
65
+ thread_storage_connections : Optional [List [str ]] = None ,
78
66
capability_host_kind : Union [str , CapabilityHostKind ] = CapabilityHostKind .AGENTS ,
79
67
** kwargs : Any ,
80
68
):
@@ -83,6 +71,7 @@ def __init__(
83
71
self .ai_services_connections = ai_services_connections
84
72
self .storage_connections = storage_connections
85
73
self .vector_store_connections = vector_store_connections
74
+ self .thread_storage_connections = thread_storage_connections
86
75
87
76
def dump (
88
77
self ,
@@ -160,6 +149,9 @@ def _from_rest_object(cls, rest_obj: RestCapabilityHost) -> "CapabilityHost":
160
149
ai_services_connections = (rest_obj .properties .ai_services_connections if rest_obj .properties else None ),
161
150
storage_connections = (rest_obj .properties .storage_connections if rest_obj .properties else None ),
162
151
vector_store_connections = (rest_obj .properties .vector_store_connections if rest_obj .properties else None ),
152
+ thread_storage_connections = (
153
+ rest_obj .properties .thread_storage_connections if rest_obj .properties else None
154
+ ),
163
155
capability_host_kind = (
164
156
rest_obj .properties .capability_host_kind if rest_obj .properties else CapabilityHostKind .AGENTS
165
157
),
@@ -178,6 +170,7 @@ def _to_rest_object(self) -> RestCapabilityHost:
178
170
ai_services_connections = self .ai_services_connections ,
179
171
storage_connections = self .storage_connections ,
180
172
vector_store_connections = self .vector_store_connections ,
173
+ thread_storage_connections = self .thread_storage_connections ,
181
174
description = self .description ,
182
175
capability_host_kind = self .capability_host_kind ,
183
176
)
0 commit comments