Share via


BetaMemoryStoresOperations Class

Constructor

BetaMemoryStoresOperations(*args, **kwargs)

Methods

begin_update_memories

Update memory store with conversation memories.

create

Create a memory store.

delete

Delete a memory store.

delete_scope

Delete all memories associated with a specific scope from a memory store.

get

Retrieve a memory store.

list

List all memory stores.

search_memories

Search for relevant memories from a memory store based on conversation context.

update

Update a memory store.

begin_update_memories

Update memory store with conversation memories.

begin_update_memories(name: str, *, scope: str, content_type: str = 'application/json', items: List[dict[str, Any]] | None = None, previous_update_id: str | None = None, update_delay: int | None = None, **kwargs: Any) -> UpdateMemoriesLROPoller

Parameters

Name Description
name
Required
str

The name of the memory store to update. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
scope
str

The namespace that logically groups and isolates memories, such as a user ID. Required.

Default value: <object object at 0x00000142480BB1C0>
items

A list of message items you would like to store in memory, each one represented as a dictionary, with role, content and type properties (with type equals message). Each message is identical to OpenAI's EasyInputMessageParam. For example: {"role": "user", "type": "message", "content": "my user message"}. Default value is None.

Default value: None
previous_update_id
str

The unique ID of the previous update request, enabling incremental memory updates from where the last operation left off. Default value is None.

Default value: None
update_delay
int

Timeout period before processing the memory update in seconds. If a new update request is received during this period, it will cancel the current request and reset the timeout. Set to 0 to immediately trigger the update without delay. Defaults to 300 (5 minutes). Default value is None.

Default value: None

Returns

Type Description

An instance of UpdateMemoriesLROPoller that returns MemoryStoreUpdateCompletedResult. The MemoryStoreUpdateCompletedResult is compatible with MutableMapping

Exceptions

Type Description

create

Create a memory store.

create(body: ~collections.abc.MutableMapping[str, ~typing.Any] | ~typing.IO[bytes] = <object object>, *, name: str = <object object>, definition: ~azure.ai.projects.models._models.MemoryStoreDefinition = <object object>, description: str | None = None, metadata: dict[str, str] | None = None, **kwargs: ~typing.Any) -> MemoryStoreDetails

Parameters

Name Description
body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
name
str

The name of the memory store. Required.

Default value: <object object at 0x00000142480BB1C0>
definition

The memory store definition. Required.

Default value: <object object at 0x00000142480BB1C0>
description
str

A human-readable description of the memory store. Default value is None.

Default value: None
metadata

Arbitrary key-value metadata to associate with the memory store. Default value is None.

Default value: None

Returns

Type Description

MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping

Exceptions

Type Description

delete

Delete a memory store.

delete(name: str, **kwargs: Any) -> DeleteMemoryStoreResult

Parameters

Name Description
name
Required
str

The name of the memory store to delete. Required.

Returns

Type Description

DeleteMemoryStoreResult. The DeleteMemoryStoreResult is compatible with MutableMapping

Exceptions

Type Description

delete_scope

Delete all memories associated with a specific scope from a memory store.

delete_scope(name: str, body: ~collections.abc.MutableMapping[str, ~typing.Any] | ~typing.IO[bytes] = <object object>, *, scope: str = <object object>, **kwargs: ~typing.Any) -> MemoryStoreDeleteScopeResult

Parameters

Name Description
name
Required
str

The name of the memory store. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
scope
str

The namespace that logically groups and isolates memories to delete, such as a user ID. Required.

Default value: <object object at 0x00000142480BB1C0>

Returns

Type Description

MemoryStoreDeleteScopeResult. The MemoryStoreDeleteScopeResult is compatible with MutableMapping

Exceptions

Type Description

get

Retrieve a memory store.

get(name: str, **kwargs: Any) -> MemoryStoreDetails

Parameters

Name Description
name
Required
str

The name of the memory store to retrieve. Required.

Returns

Type Description

MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping

Exceptions

Type Description

list

List all memory stores.

list(*, limit: int | None = None, order: str | PageOrder | None = None, before: str | None = None, **kwargs: Any) -> ItemPaged[MemoryStoreDetails]

Keyword-Only Parameters

Name Description
limit
int

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. Default value is None.

Default value: None
order

Sort order by the created_at timestamp of the objects. asc for ascending order anddesc for descending order. Known values are: "asc" and "desc". Default value is None.

Default value: None
before
str

A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. Default value is None.

Default value: None

Returns

Type Description

An iterator like instance of MemoryStoreDetails

Exceptions

Type Description

search_memories

Search for relevant memories from a memory store based on conversation context.

search_memories(name: str, body: ~collections.abc.MutableMapping[str, ~typing.Any] | ~typing.IO[bytes] = <object object>, *, scope: str = <object object>, items: list[dict[str, typing.Any]] | None = None, previous_search_id: str | None = None, options: ~azure.ai.projects.models._models.MemorySearchOptions | None = None, **kwargs: ~typing.Any) -> MemoryStoreSearchResult

Parameters

Name Description
name
Required
str

The name of the memory store to search. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
scope
str

The namespace that logically groups and isolates memories, such as a user ID. Required.

Default value: <object object at 0x00000142480BB1C0>
items

A list of queries you would like to use in the search, each one represented as a dictionary, with role, content and type properties (with type equals message). Each query is a message identical to OpenAI's EasyInputMessageParam. For example: {"role": "user", "type": "message", "content": "my user message"}. Default value is None.

Default value: None
previous_search_id
str

The unique ID of the previous search request, enabling incremental memory search from where the last operation left off. Default value is None.

Default value: None
options

Memory search options. Default value is None.

Default value: None

Returns

Type Description

MemoryStoreSearchResult. The MemoryStoreSearchResult is compatible with MutableMapping

Exceptions

Type Description

update

Update a memory store.

update(name: str, body: ~collections.abc.MutableMapping[str, ~typing.Any] | ~typing.IO[bytes] = <object object>, *, description: str | None = None, metadata: dict[str, str] | None = None, **kwargs: ~typing.Any) -> MemoryStoreDetails

Parameters

Name Description
name
Required
str

The name of the memory store to update. Required.

body
<xref:JSON> or IO[bytes]

Is either a JSON type or a IO[bytes] type. Required.

Keyword-Only Parameters

Name Description
description
str

A human-readable description of the memory store. Default value is None.

Default value: None
metadata

Arbitrary key-value metadata to associate with the memory store. Default value is None.

Default value: None

Returns

Type Description

MemoryStoreDetails. The MemoryStoreDetails is compatible with MutableMapping

Exceptions

Type Description