letta-client 0.1.41__py3-none-any.whl → 0.1.43__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of letta-client might be problematic. Click here for more details.
- letta_client/__init__.py +10 -8
- letta_client/agents/__init__.py +5 -6
- letta_client/agents/blocks/client.py +753 -0
- letta_client/agents/client.py +32 -28
- letta_client/agents/core_memory/client.py +1 -734
- letta_client/agents/passages/__init__.py +2 -0
- letta_client/agents/{archival_memory → passages}/client.py +8 -8
- letta_client/agents/types/__init__.py +2 -4
- letta_client/agents/types/agents_search_response_agents_item.py +2 -2
- letta_client/agents/types/agents_search_response_agents_item_identity_ids.py +5 -0
- letta_client/core/client_wrapper.py +1 -1
- letta_client/identities/client.py +108 -50
- letta_client/templates/__init__.py +2 -4
- letta_client/templates/types/__init__.py +3 -7
- letta_client/templates/types/templates_create_agents_response_agents_item.py +3 -3
- letta_client/templates/types/templates_create_agents_response_agents_item_identity_ids.py +5 -0
- letta_client/types/__init__.py +6 -0
- letta_client/types/agent_state.py +2 -2
- letta_client/types/identity.py +8 -3
- letta_client/types/identity_create.py +6 -0
- letta_client/types/identity_property.py +38 -0
- letta_client/types/identity_property_type.py +5 -0
- letta_client/types/identity_property_value.py +5 -0
- {letta_client-0.1.41.dist-info → letta_client-0.1.43.dist-info}/METADATA +1 -1
- {letta_client-0.1.41.dist-info → letta_client-0.1.43.dist-info}/RECORD +27 -24
- letta_client/agents/types/agents_search_response_agents_item_identifier_key.py +0 -11
- letta_client/agents/types/agents_search_response_agents_item_identifier_key_item.py +0 -5
- letta_client/templates/types/templates_create_agents_response_agents_item_identifier_key.py +0 -13
- letta_client/templates/types/templates_create_agents_response_agents_item_identifier_key_item.py +0 -5
- /letta_client/agents/{archival_memory → blocks}/__init__.py +0 -0
- {letta_client-0.1.41.dist-info → letta_client-0.1.43.dist-info}/WHEEL +0 -0
|
@@ -16,7 +16,7 @@ from ...core.client_wrapper import AsyncClientWrapper
|
|
|
16
16
|
OMIT = typing.cast(typing.Any, ...)
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class PassagesClient:
|
|
20
20
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
21
21
|
self._client_wrapper = client_wrapper
|
|
22
22
|
|
|
@@ -60,7 +60,7 @@ class ArchivalMemoryClient:
|
|
|
60
60
|
client = Letta(
|
|
61
61
|
token="YOUR_TOKEN",
|
|
62
62
|
)
|
|
63
|
-
client.agents.
|
|
63
|
+
client.agents.passages.list(
|
|
64
64
|
agent_id="agent_id",
|
|
65
65
|
)
|
|
66
66
|
"""
|
|
@@ -126,7 +126,7 @@ class ArchivalMemoryClient:
|
|
|
126
126
|
client = Letta(
|
|
127
127
|
token="YOUR_TOKEN",
|
|
128
128
|
)
|
|
129
|
-
client.agents.
|
|
129
|
+
client.agents.passages.create(
|
|
130
130
|
agent_id="agent_id",
|
|
131
131
|
text="text",
|
|
132
132
|
)
|
|
@@ -194,7 +194,7 @@ class ArchivalMemoryClient:
|
|
|
194
194
|
client = Letta(
|
|
195
195
|
token="YOUR_TOKEN",
|
|
196
196
|
)
|
|
197
|
-
client.agents.
|
|
197
|
+
client.agents.passages.delete(
|
|
198
198
|
agent_id="agent_id",
|
|
199
199
|
memory_id="memory_id",
|
|
200
200
|
)
|
|
@@ -229,7 +229,7 @@ class ArchivalMemoryClient:
|
|
|
229
229
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
230
230
|
|
|
231
231
|
|
|
232
|
-
class
|
|
232
|
+
class AsyncPassagesClient:
|
|
233
233
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
234
234
|
self._client_wrapper = client_wrapper
|
|
235
235
|
|
|
@@ -278,7 +278,7 @@ class AsyncArchivalMemoryClient:
|
|
|
278
278
|
|
|
279
279
|
|
|
280
280
|
async def main() -> None:
|
|
281
|
-
await client.agents.
|
|
281
|
+
await client.agents.passages.list(
|
|
282
282
|
agent_id="agent_id",
|
|
283
283
|
)
|
|
284
284
|
|
|
@@ -352,7 +352,7 @@ class AsyncArchivalMemoryClient:
|
|
|
352
352
|
|
|
353
353
|
|
|
354
354
|
async def main() -> None:
|
|
355
|
-
await client.agents.
|
|
355
|
+
await client.agents.passages.create(
|
|
356
356
|
agent_id="agent_id",
|
|
357
357
|
text="text",
|
|
358
358
|
)
|
|
@@ -428,7 +428,7 @@ class AsyncArchivalMemoryClient:
|
|
|
428
428
|
|
|
429
429
|
|
|
430
430
|
async def main() -> None:
|
|
431
|
-
await client.agents.
|
|
431
|
+
await client.agents.passages.delete(
|
|
432
432
|
agent_id="agent_id",
|
|
433
433
|
memory_id="memory_id",
|
|
434
434
|
)
|
|
@@ -56,8 +56,7 @@ from .agents_search_response_agents_item_embedding_config_handle import (
|
|
|
56
56
|
from .agents_search_response_agents_item_embedding_config_handle_item import (
|
|
57
57
|
AgentsSearchResponseAgentsItemEmbeddingConfigHandleItem,
|
|
58
58
|
)
|
|
59
|
-
from .
|
|
60
|
-
from .agents_search_response_agents_item_identifier_key_item import AgentsSearchResponseAgentsItemIdentifierKeyItem
|
|
59
|
+
from .agents_search_response_agents_item_identity_ids import AgentsSearchResponseAgentsItemIdentityIds
|
|
61
60
|
from .agents_search_response_agents_item_last_updated_by_id import AgentsSearchResponseAgentsItemLastUpdatedById
|
|
62
61
|
from .agents_search_response_agents_item_last_updated_by_id_item import (
|
|
63
62
|
AgentsSearchResponseAgentsItemLastUpdatedByIdItem,
|
|
@@ -442,8 +441,7 @@ __all__ = [
|
|
|
442
441
|
"AgentsSearchResponseAgentsItemEmbeddingConfigEmbeddingEndpointType",
|
|
443
442
|
"AgentsSearchResponseAgentsItemEmbeddingConfigHandle",
|
|
444
443
|
"AgentsSearchResponseAgentsItemEmbeddingConfigHandleItem",
|
|
445
|
-
"
|
|
446
|
-
"AgentsSearchResponseAgentsItemIdentifierKeyItem",
|
|
444
|
+
"AgentsSearchResponseAgentsItemIdentityIds",
|
|
447
445
|
"AgentsSearchResponseAgentsItemLastUpdatedById",
|
|
448
446
|
"AgentsSearchResponseAgentsItemLastUpdatedByIdItem",
|
|
449
447
|
"AgentsSearchResponseAgentsItemLlmConfig",
|
|
@@ -23,7 +23,7 @@ from .agents_search_response_agents_item_tool_exec_environment_variables import
|
|
|
23
23
|
from .agents_search_response_agents_item_project_id import AgentsSearchResponseAgentsItemProjectId
|
|
24
24
|
from .agents_search_response_agents_item_template_id import AgentsSearchResponseAgentsItemTemplateId
|
|
25
25
|
from .agents_search_response_agents_item_base_template_id import AgentsSearchResponseAgentsItemBaseTemplateId
|
|
26
|
-
from .
|
|
26
|
+
from .agents_search_response_agents_item_identity_ids import AgentsSearchResponseAgentsItemIdentityIds
|
|
27
27
|
from .agents_search_response_agents_item_message_buffer_autoclear import (
|
|
28
28
|
AgentsSearchResponseAgentsItemMessageBufferAutoclear,
|
|
29
29
|
)
|
|
@@ -55,7 +55,7 @@ class AgentsSearchResponseAgentsItem(UncheckedBaseModel):
|
|
|
55
55
|
project_id: typing.Optional[AgentsSearchResponseAgentsItemProjectId] = None
|
|
56
56
|
template_id: typing.Optional[AgentsSearchResponseAgentsItemTemplateId] = None
|
|
57
57
|
base_template_id: typing.Optional[AgentsSearchResponseAgentsItemBaseTemplateId] = None
|
|
58
|
-
|
|
58
|
+
identity_ids: typing.Optional[AgentsSearchResponseAgentsItemIdentityIds] = None
|
|
59
59
|
message_buffer_autoclear: typing.Optional[AgentsSearchResponseAgentsItemMessageBufferAutoclear] = None
|
|
60
60
|
template: typing.Optional[str] = None
|
|
61
61
|
|
|
@@ -16,7 +16,7 @@ class BaseClientWrapper:
|
|
|
16
16
|
headers: typing.Dict[str, str] = {
|
|
17
17
|
"X-Fern-Language": "Python",
|
|
18
18
|
"X-Fern-SDK-Name": "letta-client",
|
|
19
|
-
"X-Fern-SDK-Version": "0.1.
|
|
19
|
+
"X-Fern-SDK-Version": "0.1.43",
|
|
20
20
|
}
|
|
21
21
|
if self.token is not None:
|
|
22
22
|
headers["Authorization"] = f"Bearer {self.token}"
|
|
@@ -10,6 +10,8 @@ from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
|
|
10
10
|
from ..types.http_validation_error import HttpValidationError
|
|
11
11
|
from json.decoder import JSONDecodeError
|
|
12
12
|
from ..core.api_error import ApiError
|
|
13
|
+
from ..types.identity_property import IdentityProperty
|
|
14
|
+
from ..core.serialization import convert_and_respect_annotation_metadata
|
|
13
15
|
from ..core.jsonable_encoder import jsonable_encoder
|
|
14
16
|
from ..core.client_wrapper import AsyncClientWrapper
|
|
15
17
|
|
|
@@ -21,11 +23,12 @@ class IdentitiesClient:
|
|
|
21
23
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
22
24
|
self._client_wrapper = client_wrapper
|
|
23
25
|
|
|
24
|
-
def
|
|
26
|
+
def list(
|
|
25
27
|
self,
|
|
26
28
|
*,
|
|
27
29
|
name: typing.Optional[str] = None,
|
|
28
30
|
project_id: typing.Optional[str] = None,
|
|
31
|
+
identifier_key: typing.Optional[str] = None,
|
|
29
32
|
identity_type: typing.Optional[IdentityType] = None,
|
|
30
33
|
before: typing.Optional[str] = None,
|
|
31
34
|
after: typing.Optional[str] = None,
|
|
@@ -41,6 +44,8 @@ class IdentitiesClient:
|
|
|
41
44
|
|
|
42
45
|
project_id : typing.Optional[str]
|
|
43
46
|
|
|
47
|
+
identifier_key : typing.Optional[str]
|
|
48
|
+
|
|
44
49
|
identity_type : typing.Optional[IdentityType]
|
|
45
50
|
|
|
46
51
|
before : typing.Optional[str]
|
|
@@ -64,7 +69,7 @@ class IdentitiesClient:
|
|
|
64
69
|
client = Letta(
|
|
65
70
|
token="YOUR_TOKEN",
|
|
66
71
|
)
|
|
67
|
-
client.identities.
|
|
72
|
+
client.identities.list()
|
|
68
73
|
"""
|
|
69
74
|
_response = self._client_wrapper.httpx_client.request(
|
|
70
75
|
"v1/identities/",
|
|
@@ -72,6 +77,7 @@ class IdentitiesClient:
|
|
|
72
77
|
params={
|
|
73
78
|
"name": name,
|
|
74
79
|
"project_id": project_id,
|
|
80
|
+
"identifier_key": identifier_key,
|
|
75
81
|
"identity_type": identity_type,
|
|
76
82
|
"before": before,
|
|
77
83
|
"after": after,
|
|
@@ -103,7 +109,7 @@ class IdentitiesClient:
|
|
|
103
109
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
104
110
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
105
111
|
|
|
106
|
-
def
|
|
112
|
+
def create(
|
|
107
113
|
self,
|
|
108
114
|
*,
|
|
109
115
|
identifier_key: str,
|
|
@@ -112,6 +118,7 @@ class IdentitiesClient:
|
|
|
112
118
|
project: typing.Optional[str] = None,
|
|
113
119
|
project_id: typing.Optional[str] = OMIT,
|
|
114
120
|
agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
121
|
+
properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
|
|
115
122
|
request_options: typing.Optional[RequestOptions] = None,
|
|
116
123
|
) -> Identity:
|
|
117
124
|
"""
|
|
@@ -134,6 +141,9 @@ class IdentitiesClient:
|
|
|
134
141
|
agent_ids : typing.Optional[typing.Sequence[str]]
|
|
135
142
|
The agent ids that are associated with the identity.
|
|
136
143
|
|
|
144
|
+
properties : typing.Optional[typing.Sequence[IdentityProperty]]
|
|
145
|
+
List of properties associated with the identity.
|
|
146
|
+
|
|
137
147
|
request_options : typing.Optional[RequestOptions]
|
|
138
148
|
Request-specific configuration.
|
|
139
149
|
|
|
@@ -149,7 +159,7 @@ class IdentitiesClient:
|
|
|
149
159
|
client = Letta(
|
|
150
160
|
token="YOUR_TOKEN",
|
|
151
161
|
)
|
|
152
|
-
client.identities.
|
|
162
|
+
client.identities.create(
|
|
153
163
|
identifier_key="identifier_key",
|
|
154
164
|
name="name",
|
|
155
165
|
identity_type="org",
|
|
@@ -164,6 +174,9 @@ class IdentitiesClient:
|
|
|
164
174
|
"identity_type": identity_type,
|
|
165
175
|
"project_id": project_id,
|
|
166
176
|
"agent_ids": agent_ids,
|
|
177
|
+
"properties": convert_and_respect_annotation_metadata(
|
|
178
|
+
object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
|
|
179
|
+
),
|
|
167
180
|
},
|
|
168
181
|
headers={
|
|
169
182
|
"X-Project": str(project) if project is not None else None,
|
|
@@ -195,7 +208,7 @@ class IdentitiesClient:
|
|
|
195
208
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
196
209
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
197
210
|
|
|
198
|
-
def
|
|
211
|
+
def upsert(
|
|
199
212
|
self,
|
|
200
213
|
*,
|
|
201
214
|
identifier_key: str,
|
|
@@ -204,6 +217,7 @@ class IdentitiesClient:
|
|
|
204
217
|
project: typing.Optional[str] = None,
|
|
205
218
|
project_id: typing.Optional[str] = OMIT,
|
|
206
219
|
agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
220
|
+
properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
|
|
207
221
|
request_options: typing.Optional[RequestOptions] = None,
|
|
208
222
|
) -> Identity:
|
|
209
223
|
"""
|
|
@@ -226,6 +240,9 @@ class IdentitiesClient:
|
|
|
226
240
|
agent_ids : typing.Optional[typing.Sequence[str]]
|
|
227
241
|
The agent ids that are associated with the identity.
|
|
228
242
|
|
|
243
|
+
properties : typing.Optional[typing.Sequence[IdentityProperty]]
|
|
244
|
+
List of properties associated with the identity.
|
|
245
|
+
|
|
229
246
|
request_options : typing.Optional[RequestOptions]
|
|
230
247
|
Request-specific configuration.
|
|
231
248
|
|
|
@@ -241,7 +258,7 @@ class IdentitiesClient:
|
|
|
241
258
|
client = Letta(
|
|
242
259
|
token="YOUR_TOKEN",
|
|
243
260
|
)
|
|
244
|
-
client.identities.
|
|
261
|
+
client.identities.upsert(
|
|
245
262
|
identifier_key="identifier_key",
|
|
246
263
|
name="name",
|
|
247
264
|
identity_type="org",
|
|
@@ -256,6 +273,9 @@ class IdentitiesClient:
|
|
|
256
273
|
"identity_type": identity_type,
|
|
257
274
|
"project_id": project_id,
|
|
258
275
|
"agent_ids": agent_ids,
|
|
276
|
+
"properties": convert_and_respect_annotation_metadata(
|
|
277
|
+
object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
|
|
278
|
+
),
|
|
259
279
|
},
|
|
260
280
|
headers={
|
|
261
281
|
"X-Project": str(project) if project is not None else None,
|
|
@@ -287,13 +307,11 @@ class IdentitiesClient:
|
|
|
287
307
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
288
308
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
289
309
|
|
|
290
|
-
def
|
|
291
|
-
self, identifier_key: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
292
|
-
) -> Identity:
|
|
310
|
+
def retrieve(self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Identity:
|
|
293
311
|
"""
|
|
294
312
|
Parameters
|
|
295
313
|
----------
|
|
296
|
-
|
|
314
|
+
identity_id : str
|
|
297
315
|
|
|
298
316
|
request_options : typing.Optional[RequestOptions]
|
|
299
317
|
Request-specific configuration.
|
|
@@ -310,12 +328,12 @@ class IdentitiesClient:
|
|
|
310
328
|
client = Letta(
|
|
311
329
|
token="YOUR_TOKEN",
|
|
312
330
|
)
|
|
313
|
-
client.identities.
|
|
314
|
-
|
|
331
|
+
client.identities.retrieve(
|
|
332
|
+
identity_id="identity_id",
|
|
315
333
|
)
|
|
316
334
|
"""
|
|
317
335
|
_response = self._client_wrapper.httpx_client.request(
|
|
318
|
-
f"v1/identities/{jsonable_encoder(
|
|
336
|
+
f"v1/identities/{jsonable_encoder(identity_id)}",
|
|
319
337
|
method="GET",
|
|
320
338
|
request_options=request_options,
|
|
321
339
|
)
|
|
@@ -343,15 +361,15 @@ class IdentitiesClient:
|
|
|
343
361
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
344
362
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
345
363
|
|
|
346
|
-
def
|
|
347
|
-
self,
|
|
364
|
+
def delete(
|
|
365
|
+
self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
348
366
|
) -> typing.Optional[typing.Any]:
|
|
349
367
|
"""
|
|
350
368
|
Delete an identity by its identifier key
|
|
351
369
|
|
|
352
370
|
Parameters
|
|
353
371
|
----------
|
|
354
|
-
|
|
372
|
+
identity_id : str
|
|
355
373
|
|
|
356
374
|
request_options : typing.Optional[RequestOptions]
|
|
357
375
|
Request-specific configuration.
|
|
@@ -368,12 +386,12 @@ class IdentitiesClient:
|
|
|
368
386
|
client = Letta(
|
|
369
387
|
token="YOUR_TOKEN",
|
|
370
388
|
)
|
|
371
|
-
client.identities.
|
|
372
|
-
|
|
389
|
+
client.identities.delete(
|
|
390
|
+
identity_id="identity_id",
|
|
373
391
|
)
|
|
374
392
|
"""
|
|
375
393
|
_response = self._client_wrapper.httpx_client.request(
|
|
376
|
-
f"v1/identities/{jsonable_encoder(
|
|
394
|
+
f"v1/identities/{jsonable_encoder(identity_id)}",
|
|
377
395
|
method="DELETE",
|
|
378
396
|
request_options=request_options,
|
|
379
397
|
)
|
|
@@ -401,19 +419,24 @@ class IdentitiesClient:
|
|
|
401
419
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
402
420
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
403
421
|
|
|
404
|
-
def
|
|
422
|
+
def modify(
|
|
405
423
|
self,
|
|
406
|
-
|
|
424
|
+
identity_id: str,
|
|
407
425
|
*,
|
|
426
|
+
identifier_key: typing.Optional[str] = OMIT,
|
|
408
427
|
name: typing.Optional[str] = OMIT,
|
|
409
428
|
identity_type: typing.Optional[IdentityType] = OMIT,
|
|
410
429
|
agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
430
|
+
properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
|
|
411
431
|
request_options: typing.Optional[RequestOptions] = None,
|
|
412
432
|
) -> Identity:
|
|
413
433
|
"""
|
|
414
434
|
Parameters
|
|
415
435
|
----------
|
|
416
|
-
|
|
436
|
+
identity_id : str
|
|
437
|
+
|
|
438
|
+
identifier_key : typing.Optional[str]
|
|
439
|
+
External, user-generated identifier key of the identity.
|
|
417
440
|
|
|
418
441
|
name : typing.Optional[str]
|
|
419
442
|
The name of the identity.
|
|
@@ -424,6 +447,9 @@ class IdentitiesClient:
|
|
|
424
447
|
agent_ids : typing.Optional[typing.Sequence[str]]
|
|
425
448
|
The agent ids that are associated with the identity.
|
|
426
449
|
|
|
450
|
+
properties : typing.Optional[typing.Sequence[IdentityProperty]]
|
|
451
|
+
List of properties associated with the identity.
|
|
452
|
+
|
|
427
453
|
request_options : typing.Optional[RequestOptions]
|
|
428
454
|
Request-specific configuration.
|
|
429
455
|
|
|
@@ -439,17 +465,21 @@ class IdentitiesClient:
|
|
|
439
465
|
client = Letta(
|
|
440
466
|
token="YOUR_TOKEN",
|
|
441
467
|
)
|
|
442
|
-
client.identities.
|
|
443
|
-
|
|
468
|
+
client.identities.modify(
|
|
469
|
+
identity_id="identity_id",
|
|
444
470
|
)
|
|
445
471
|
"""
|
|
446
472
|
_response = self._client_wrapper.httpx_client.request(
|
|
447
|
-
f"v1/identities/{jsonable_encoder(
|
|
473
|
+
f"v1/identities/{jsonable_encoder(identity_id)}",
|
|
448
474
|
method="PATCH",
|
|
449
475
|
json={
|
|
476
|
+
"identifier_key": identifier_key,
|
|
450
477
|
"name": name,
|
|
451
478
|
"identity_type": identity_type,
|
|
452
479
|
"agent_ids": agent_ids,
|
|
480
|
+
"properties": convert_and_respect_annotation_metadata(
|
|
481
|
+
object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
|
|
482
|
+
),
|
|
453
483
|
},
|
|
454
484
|
headers={
|
|
455
485
|
"content-type": "application/json",
|
|
@@ -486,11 +516,12 @@ class AsyncIdentitiesClient:
|
|
|
486
516
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
487
517
|
self._client_wrapper = client_wrapper
|
|
488
518
|
|
|
489
|
-
async def
|
|
519
|
+
async def list(
|
|
490
520
|
self,
|
|
491
521
|
*,
|
|
492
522
|
name: typing.Optional[str] = None,
|
|
493
523
|
project_id: typing.Optional[str] = None,
|
|
524
|
+
identifier_key: typing.Optional[str] = None,
|
|
494
525
|
identity_type: typing.Optional[IdentityType] = None,
|
|
495
526
|
before: typing.Optional[str] = None,
|
|
496
527
|
after: typing.Optional[str] = None,
|
|
@@ -506,6 +537,8 @@ class AsyncIdentitiesClient:
|
|
|
506
537
|
|
|
507
538
|
project_id : typing.Optional[str]
|
|
508
539
|
|
|
540
|
+
identifier_key : typing.Optional[str]
|
|
541
|
+
|
|
509
542
|
identity_type : typing.Optional[IdentityType]
|
|
510
543
|
|
|
511
544
|
before : typing.Optional[str]
|
|
@@ -534,7 +567,7 @@ class AsyncIdentitiesClient:
|
|
|
534
567
|
|
|
535
568
|
|
|
536
569
|
async def main() -> None:
|
|
537
|
-
await client.identities.
|
|
570
|
+
await client.identities.list()
|
|
538
571
|
|
|
539
572
|
|
|
540
573
|
asyncio.run(main())
|
|
@@ -545,6 +578,7 @@ class AsyncIdentitiesClient:
|
|
|
545
578
|
params={
|
|
546
579
|
"name": name,
|
|
547
580
|
"project_id": project_id,
|
|
581
|
+
"identifier_key": identifier_key,
|
|
548
582
|
"identity_type": identity_type,
|
|
549
583
|
"before": before,
|
|
550
584
|
"after": after,
|
|
@@ -576,7 +610,7 @@ class AsyncIdentitiesClient:
|
|
|
576
610
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
577
611
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
578
612
|
|
|
579
|
-
async def
|
|
613
|
+
async def create(
|
|
580
614
|
self,
|
|
581
615
|
*,
|
|
582
616
|
identifier_key: str,
|
|
@@ -585,6 +619,7 @@ class AsyncIdentitiesClient:
|
|
|
585
619
|
project: typing.Optional[str] = None,
|
|
586
620
|
project_id: typing.Optional[str] = OMIT,
|
|
587
621
|
agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
622
|
+
properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
|
|
588
623
|
request_options: typing.Optional[RequestOptions] = None,
|
|
589
624
|
) -> Identity:
|
|
590
625
|
"""
|
|
@@ -607,6 +642,9 @@ class AsyncIdentitiesClient:
|
|
|
607
642
|
agent_ids : typing.Optional[typing.Sequence[str]]
|
|
608
643
|
The agent ids that are associated with the identity.
|
|
609
644
|
|
|
645
|
+
properties : typing.Optional[typing.Sequence[IdentityProperty]]
|
|
646
|
+
List of properties associated with the identity.
|
|
647
|
+
|
|
610
648
|
request_options : typing.Optional[RequestOptions]
|
|
611
649
|
Request-specific configuration.
|
|
612
650
|
|
|
@@ -627,7 +665,7 @@ class AsyncIdentitiesClient:
|
|
|
627
665
|
|
|
628
666
|
|
|
629
667
|
async def main() -> None:
|
|
630
|
-
await client.identities.
|
|
668
|
+
await client.identities.create(
|
|
631
669
|
identifier_key="identifier_key",
|
|
632
670
|
name="name",
|
|
633
671
|
identity_type="org",
|
|
@@ -645,6 +683,9 @@ class AsyncIdentitiesClient:
|
|
|
645
683
|
"identity_type": identity_type,
|
|
646
684
|
"project_id": project_id,
|
|
647
685
|
"agent_ids": agent_ids,
|
|
686
|
+
"properties": convert_and_respect_annotation_metadata(
|
|
687
|
+
object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
|
|
688
|
+
),
|
|
648
689
|
},
|
|
649
690
|
headers={
|
|
650
691
|
"X-Project": str(project) if project is not None else None,
|
|
@@ -676,7 +717,7 @@ class AsyncIdentitiesClient:
|
|
|
676
717
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
677
718
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
678
719
|
|
|
679
|
-
async def
|
|
720
|
+
async def upsert(
|
|
680
721
|
self,
|
|
681
722
|
*,
|
|
682
723
|
identifier_key: str,
|
|
@@ -685,6 +726,7 @@ class AsyncIdentitiesClient:
|
|
|
685
726
|
project: typing.Optional[str] = None,
|
|
686
727
|
project_id: typing.Optional[str] = OMIT,
|
|
687
728
|
agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
729
|
+
properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
|
|
688
730
|
request_options: typing.Optional[RequestOptions] = None,
|
|
689
731
|
) -> Identity:
|
|
690
732
|
"""
|
|
@@ -707,6 +749,9 @@ class AsyncIdentitiesClient:
|
|
|
707
749
|
agent_ids : typing.Optional[typing.Sequence[str]]
|
|
708
750
|
The agent ids that are associated with the identity.
|
|
709
751
|
|
|
752
|
+
properties : typing.Optional[typing.Sequence[IdentityProperty]]
|
|
753
|
+
List of properties associated with the identity.
|
|
754
|
+
|
|
710
755
|
request_options : typing.Optional[RequestOptions]
|
|
711
756
|
Request-specific configuration.
|
|
712
757
|
|
|
@@ -727,7 +772,7 @@ class AsyncIdentitiesClient:
|
|
|
727
772
|
|
|
728
773
|
|
|
729
774
|
async def main() -> None:
|
|
730
|
-
await client.identities.
|
|
775
|
+
await client.identities.upsert(
|
|
731
776
|
identifier_key="identifier_key",
|
|
732
777
|
name="name",
|
|
733
778
|
identity_type="org",
|
|
@@ -745,6 +790,9 @@ class AsyncIdentitiesClient:
|
|
|
745
790
|
"identity_type": identity_type,
|
|
746
791
|
"project_id": project_id,
|
|
747
792
|
"agent_ids": agent_ids,
|
|
793
|
+
"properties": convert_and_respect_annotation_metadata(
|
|
794
|
+
object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
|
|
795
|
+
),
|
|
748
796
|
},
|
|
749
797
|
headers={
|
|
750
798
|
"X-Project": str(project) if project is not None else None,
|
|
@@ -776,13 +824,11 @@ class AsyncIdentitiesClient:
|
|
|
776
824
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
777
825
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
778
826
|
|
|
779
|
-
async def
|
|
780
|
-
self, identifier_key: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
781
|
-
) -> Identity:
|
|
827
|
+
async def retrieve(self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Identity:
|
|
782
828
|
"""
|
|
783
829
|
Parameters
|
|
784
830
|
----------
|
|
785
|
-
|
|
831
|
+
identity_id : str
|
|
786
832
|
|
|
787
833
|
request_options : typing.Optional[RequestOptions]
|
|
788
834
|
Request-specific configuration.
|
|
@@ -804,15 +850,15 @@ class AsyncIdentitiesClient:
|
|
|
804
850
|
|
|
805
851
|
|
|
806
852
|
async def main() -> None:
|
|
807
|
-
await client.identities.
|
|
808
|
-
|
|
853
|
+
await client.identities.retrieve(
|
|
854
|
+
identity_id="identity_id",
|
|
809
855
|
)
|
|
810
856
|
|
|
811
857
|
|
|
812
858
|
asyncio.run(main())
|
|
813
859
|
"""
|
|
814
860
|
_response = await self._client_wrapper.httpx_client.request(
|
|
815
|
-
f"v1/identities/{jsonable_encoder(
|
|
861
|
+
f"v1/identities/{jsonable_encoder(identity_id)}",
|
|
816
862
|
method="GET",
|
|
817
863
|
request_options=request_options,
|
|
818
864
|
)
|
|
@@ -840,15 +886,15 @@ class AsyncIdentitiesClient:
|
|
|
840
886
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
841
887
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
842
888
|
|
|
843
|
-
async def
|
|
844
|
-
self,
|
|
889
|
+
async def delete(
|
|
890
|
+
self, identity_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
845
891
|
) -> typing.Optional[typing.Any]:
|
|
846
892
|
"""
|
|
847
893
|
Delete an identity by its identifier key
|
|
848
894
|
|
|
849
895
|
Parameters
|
|
850
896
|
----------
|
|
851
|
-
|
|
897
|
+
identity_id : str
|
|
852
898
|
|
|
853
899
|
request_options : typing.Optional[RequestOptions]
|
|
854
900
|
Request-specific configuration.
|
|
@@ -870,15 +916,15 @@ class AsyncIdentitiesClient:
|
|
|
870
916
|
|
|
871
917
|
|
|
872
918
|
async def main() -> None:
|
|
873
|
-
await client.identities.
|
|
874
|
-
|
|
919
|
+
await client.identities.delete(
|
|
920
|
+
identity_id="identity_id",
|
|
875
921
|
)
|
|
876
922
|
|
|
877
923
|
|
|
878
924
|
asyncio.run(main())
|
|
879
925
|
"""
|
|
880
926
|
_response = await self._client_wrapper.httpx_client.request(
|
|
881
|
-
f"v1/identities/{jsonable_encoder(
|
|
927
|
+
f"v1/identities/{jsonable_encoder(identity_id)}",
|
|
882
928
|
method="DELETE",
|
|
883
929
|
request_options=request_options,
|
|
884
930
|
)
|
|
@@ -906,19 +952,24 @@ class AsyncIdentitiesClient:
|
|
|
906
952
|
raise ApiError(status_code=_response.status_code, body=_response.text)
|
|
907
953
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
908
954
|
|
|
909
|
-
async def
|
|
955
|
+
async def modify(
|
|
910
956
|
self,
|
|
911
|
-
|
|
957
|
+
identity_id: str,
|
|
912
958
|
*,
|
|
959
|
+
identifier_key: typing.Optional[str] = OMIT,
|
|
913
960
|
name: typing.Optional[str] = OMIT,
|
|
914
961
|
identity_type: typing.Optional[IdentityType] = OMIT,
|
|
915
962
|
agent_ids: typing.Optional[typing.Sequence[str]] = OMIT,
|
|
963
|
+
properties: typing.Optional[typing.Sequence[IdentityProperty]] = OMIT,
|
|
916
964
|
request_options: typing.Optional[RequestOptions] = None,
|
|
917
965
|
) -> Identity:
|
|
918
966
|
"""
|
|
919
967
|
Parameters
|
|
920
968
|
----------
|
|
921
|
-
|
|
969
|
+
identity_id : str
|
|
970
|
+
|
|
971
|
+
identifier_key : typing.Optional[str]
|
|
972
|
+
External, user-generated identifier key of the identity.
|
|
922
973
|
|
|
923
974
|
name : typing.Optional[str]
|
|
924
975
|
The name of the identity.
|
|
@@ -929,6 +980,9 @@ class AsyncIdentitiesClient:
|
|
|
929
980
|
agent_ids : typing.Optional[typing.Sequence[str]]
|
|
930
981
|
The agent ids that are associated with the identity.
|
|
931
982
|
|
|
983
|
+
properties : typing.Optional[typing.Sequence[IdentityProperty]]
|
|
984
|
+
List of properties associated with the identity.
|
|
985
|
+
|
|
932
986
|
request_options : typing.Optional[RequestOptions]
|
|
933
987
|
Request-specific configuration.
|
|
934
988
|
|
|
@@ -949,20 +1003,24 @@ class AsyncIdentitiesClient:
|
|
|
949
1003
|
|
|
950
1004
|
|
|
951
1005
|
async def main() -> None:
|
|
952
|
-
await client.identities.
|
|
953
|
-
|
|
1006
|
+
await client.identities.modify(
|
|
1007
|
+
identity_id="identity_id",
|
|
954
1008
|
)
|
|
955
1009
|
|
|
956
1010
|
|
|
957
1011
|
asyncio.run(main())
|
|
958
1012
|
"""
|
|
959
1013
|
_response = await self._client_wrapper.httpx_client.request(
|
|
960
|
-
f"v1/identities/{jsonable_encoder(
|
|
1014
|
+
f"v1/identities/{jsonable_encoder(identity_id)}",
|
|
961
1015
|
method="PATCH",
|
|
962
1016
|
json={
|
|
1017
|
+
"identifier_key": identifier_key,
|
|
963
1018
|
"name": name,
|
|
964
1019
|
"identity_type": identity_type,
|
|
965
1020
|
"agent_ids": agent_ids,
|
|
1021
|
+
"properties": convert_and_respect_annotation_metadata(
|
|
1022
|
+
object_=properties, annotation=typing.Sequence[IdentityProperty], direction="write"
|
|
1023
|
+
),
|
|
966
1024
|
},
|
|
967
1025
|
headers={
|
|
968
1026
|
"content-type": "application/json",
|
|
@@ -26,8 +26,7 @@ from .types import (
|
|
|
26
26
|
TemplatesCreateAgentsResponseAgentsItemEmbeddingConfigEmbeddingEndpointType,
|
|
27
27
|
TemplatesCreateAgentsResponseAgentsItemEmbeddingConfigHandle,
|
|
28
28
|
TemplatesCreateAgentsResponseAgentsItemEmbeddingConfigHandleItem,
|
|
29
|
-
|
|
30
|
-
TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem,
|
|
29
|
+
TemplatesCreateAgentsResponseAgentsItemIdentityIds,
|
|
31
30
|
TemplatesCreateAgentsResponseAgentsItemLastUpdatedById,
|
|
32
31
|
TemplatesCreateAgentsResponseAgentsItemLastUpdatedByIdItem,
|
|
33
32
|
TemplatesCreateAgentsResponseAgentsItemLlmConfig,
|
|
@@ -196,8 +195,7 @@ __all__ = [
|
|
|
196
195
|
"TemplatesCreateAgentsResponseAgentsItemEmbeddingConfigEmbeddingEndpointType",
|
|
197
196
|
"TemplatesCreateAgentsResponseAgentsItemEmbeddingConfigHandle",
|
|
198
197
|
"TemplatesCreateAgentsResponseAgentsItemEmbeddingConfigHandleItem",
|
|
199
|
-
"
|
|
200
|
-
"TemplatesCreateAgentsResponseAgentsItemIdentifierKeyItem",
|
|
198
|
+
"TemplatesCreateAgentsResponseAgentsItemIdentityIds",
|
|
201
199
|
"TemplatesCreateAgentsResponseAgentsItemLastUpdatedById",
|
|
202
200
|
"TemplatesCreateAgentsResponseAgentsItemLastUpdatedByIdItem",
|
|
203
201
|
"TemplatesCreateAgentsResponseAgentsItemLlmConfig",
|