create_event¶
Operation¶
create_event
¶
create_event(request: CreateEventInput | CreateEventInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateEventInputDict]) -> CreateEventOutput
Creates an event in an AgentCore Memory resource. Events represent interactions or activities that occur within a session and are associated with specific actors.
To use this operation, you must have the bedrock-agentcore:CreateEvent
permission.
This operation is subject to request rate limiting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CreateEventInput | CreateEventInputDict | 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[CreateEventInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CreateEventOutput
|
An instance of |
create_event
async
¶
create_event(request: CreateEventInput | CreateEventInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateEventInputDict]) -> CreateEventOutput
Creates an event in an AgentCore Memory resource. Events represent interactions or activities that occur within a session and are associated with specific actors.
To use this operation, you must have the bedrock-agentcore:CreateEvent
permission.
This operation is subject to request rate limiting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
CreateEventInput | CreateEventInputDict | 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[CreateEventInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
CreateEventOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
CreateEventInputDict
¶
Bases: TypedDict
Dictionary form of CreateEventInput.
Attributes¶
actor_id
instance-attribute
¶
The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.
branch
instance-attribute
¶
branch: Branch | BranchDict | None
The branch information for this event. Branches allow for organizing events into different conversation threads or paths.
client_token
instance-attribute
¶
client_token: str | None
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.
This field is autopopulated if not provided.
event_timestamp
instance-attribute
¶
The timestamp when the event occurred. If not specified, the current time is used.
extraction_config
instance-attribute
¶
extraction_config: ExtractionConfig | ExtractionConfigDict | None
The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.
extraction_mode
instance-attribute
¶
extraction_mode: str | None
Controls long-term memory extraction for this event. When set to SKIP,
the event is stored in short-term memory but is excluded from long-term
memory extraction. If not specified, the event is processed for
extraction as usual.
memory_id
instance-attribute
¶
The identifier of the AgentCore Memory resource in which to create the event.
metadata
instance-attribute
¶
metadata: Mapping[str, MetadataValue | MetadataValueDict] | None
The key-value metadata to attach to the event.
payload
instance-attribute
¶
payload: Required[Sequence[PayloadType | PayloadTypeDict]]
The content payload of the event. This can include conversational data, JSON data, or binary content.
CreateEventInput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreateEventInput structure.
Attributes¶
actor_id
class-attribute
instance-attribute
¶
actor_id: str | None = ...
The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.
branch
class-attribute
instance-attribute
¶
branch: Branch | None = ...
The branch information for this event. Branches allow for organizing events into different conversation threads or paths.
client_token
class-attribute
instance-attribute
¶
client_token: str | None = ...
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, AgentCore ignores the request, but does not return an error.
This field is autopopulated if not provided.
event_timestamp
class-attribute
instance-attribute
¶
event_timestamp: datetime | None = ...
The timestamp when the event occurred. If not specified, the current time is used.
extraction_config
class-attribute
instance-attribute
¶
extraction_config: ExtractionConfig | None = ...
The extraction configuration for long-term memory records. Use this parameter to specify namespace variable keys and their values for namespace substitution during extraction.
extraction_mode
class-attribute
instance-attribute
¶
extraction_mode: str | None = ...
Controls long-term memory extraction for this event. When set to SKIP,
the event is stored in short-term memory but is excluded from long-term
memory extraction. If not specified, the event is processed for
extraction as usual.
memory_id
class-attribute
instance-attribute
¶
memory_id: str | None = ...
The identifier of the AgentCore Memory resource in which to create the event.
metadata
class-attribute
instance-attribute
¶
metadata: dict[str, MetadataValue] | None = ...
The key-value metadata to attach to the event.
payload
class-attribute
instance-attribute
¶
payload: list[PayloadType] | None = ...
The content payload of the event. This can include conversational data, JSON data, or binary content.
Output¶
CreateEventOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for CreateEventOutput structure.