Skip to content

batch_update_memory_records

Operation

batch_update_memory_records

batch_update_memory_records(request: BatchUpdateMemoryRecordsInput | BatchUpdateMemoryRecordsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[BatchUpdateMemoryRecordsInputDict]) -> BatchUpdateMemoryRecordsOutput

Updates multiple memory records with custom content in a single batch operation within the specified memory.

Parameters:

Name Type Description Default
request BatchUpdateMemoryRecordsInput | BatchUpdateMemoryRecordsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[BatchUpdateMemoryRecordsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
BatchUpdateMemoryRecordsOutput

An instance of BatchUpdateMemoryRecordsOutput.

batch_update_memory_records async

batch_update_memory_records(request: BatchUpdateMemoryRecordsInput | BatchUpdateMemoryRecordsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[BatchUpdateMemoryRecordsInputDict]) -> BatchUpdateMemoryRecordsOutput

Updates multiple memory records with custom content in a single batch operation within the specified memory.

Parameters:

Name Type Description Default
request BatchUpdateMemoryRecordsInput | BatchUpdateMemoryRecordsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[BatchUpdateMemoryRecordsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
BatchUpdateMemoryRecordsOutput

An instance of BatchUpdateMemoryRecordsOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

BatchUpdateMemoryRecordsInputDict

Bases: TypedDict

Dictionary form of BatchUpdateMemoryRecordsInput.

Attributes

memory_id instance-attribute
memory_id: Required[str]

The unique ID of the memory resource where records will be updated.

record_expiry_specification instance-attribute
record_expiry_specification: RecordExpirySpecification | RecordExpirySpecificationDict | None

The record expiry (long-term memory time-to-live) applied to every record updated by this request. Set recordExpiryDurationDays to configure or overwrite the number of days after which the records expire, or set action to REMOVE to clear a previously configured expiry so that the records no longer expire.

When you do not provide this value, the service determines each record's expiry from its current state:

  • If the record already has an expiry configured, the service resets and reapplies the expiry based on the last applied recordExpiryDurationDays.

  • If the record does not have an expiry configured, no expiry is applied and the record remains non-expiring. This is the outcome regardless of whether the record's strategy configures an expiry.

Providing an explicit recordExpiryDurationDays always takes precedence: it overwrites an existing expiry, or sets one on a record that previously had none.

records instance-attribute

A list of memory record update inputs to be processed in the batch operation.

BatchUpdateMemoryRecordsInput dataclass

Bases: _SerdeShape

Dataclass for BatchUpdateMemoryRecordsInput structure.

Attributes

memory_id class-attribute instance-attribute
memory_id: str | None = ...

The unique ID of the memory resource where records will be updated.

record_expiry_specification class-attribute instance-attribute
record_expiry_specification: RecordExpirySpecification | None = ...

The record expiry (long-term memory time-to-live) applied to every record updated by this request. Set recordExpiryDurationDays to configure or overwrite the number of days after which the records expire, or set action to REMOVE to clear a previously configured expiry so that the records no longer expire.

When you do not provide this value, the service determines each record's expiry from its current state:

  • If the record already has an expiry configured, the service resets and reapplies the expiry based on the last applied recordExpiryDurationDays.

  • If the record does not have an expiry configured, no expiry is applied and the record remains non-expiring. This is the outcome regardless of whether the record's strategy configures an expiry.

Providing an explicit recordExpiryDurationDays always takes precedence: it overwrites an existing expiry, or sets one on a record that previously had none.

records class-attribute instance-attribute
records: list[MemoryRecordUpdateInput] | None = ...

A list of memory record update inputs to be processed in the batch operation.

Output

BatchUpdateMemoryRecordsOutput dataclass

Bases: _SerdeShape

Dataclass for BatchUpdateMemoryRecordsOutput structure.

Attributes

failed_records instance-attribute
failed_records: list[MemoryRecordOutput]

A list of memory records that failed to be updated, including error details for each failure.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

successful_records instance-attribute
successful_records: list[MemoryRecordOutput]

A list of memory records that were successfully updated during the batch operation.