create_event
async
¶
create_event(
memory_id: MemoryId,
actor_id: ActorId,
event_timestamp: datetime,
payload: PayloadTypeList,
*,
config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
session_id: Optional[SessionId] = None,
branch: Optional[Branch] = None,
client_token: Optional[str] = None,
metadata: Optional[MetadataMap] = None,
extraction_mode: Optional[ExtractionMode] = None,
extraction_config: Optional[ExtractionConfig] = None,
) -> 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:
-
memory_id(MemoryId) –The identifier of the AgentCore Memory resource in which to create the event.
-
actor_id(ActorId) –The identifier of the actor associated with this event. An actor represents an entity that participates in sessions and generates events.
-
session_id(Optional[SessionId], default:None) –The identifier of the session in which this event occurs. A session represents a sequence of related events.
-
event_timestamp(datetime) –The timestamp when the event occurred. If not specified, the current time is used.
-
payload(PayloadTypeList) –The content payload of the event. This can include conversational data, JSON data, or binary content.
-
branch(Optional[Branch], default:None) –The branch information for this event. Branches allow for organizing events into different conversation threads or paths.
-
client_token(Optional[str], default: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.
-
metadata(Optional[MetadataMap], default:None) –The key-value metadata to attach to the event.
-
extraction_mode(Optional[ExtractionMode], default: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. -
extraction_config(Optional[ExtractionConfig], default: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.
Raises:
-
AccessDeniedException–The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
-
InvalidInputException–The input fails to satisfy the constraints specified by AgentCore. Check your input values and try again.
-
ResourceNotFoundException–The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
-
RetryableConflictException–The exception that occurs when there is a retryable conflict performing an operation. This is a temporary condition that may resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
-
ServiceException–The service encountered an internal error. Try your request again later.
-
ServiceQuotaExceededException–The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
-
ThrottledException–The request was denied due to request throttling. Reduce the frequency of requests and try again.
-
ValidationException–The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore/_services/async_bedrock_agent_core.py
3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 | |