Create Session
bedrockagentruntime_create_session | R Documentation |
Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex¶
Description¶
Creates a session to temporarily store conversations for generative AI (GenAI) applications built with open-source frameworks such as LangGraph and LlamaIndex. Sessions enable you to save the state of conversations at checkpoints, with the added security and infrastructure of Amazon Web Services. For more information, see Store and retrieve conversation history and context with Amazon Bedrock sessions.
By default, Amazon Bedrock uses Amazon Web Services-managed keys for session encryption, including session metadata, or you can use your own KMS key. For more information, see Amazon Bedrock session encryption.
You use a session to store state and conversation history for generative
AI applications built with open-source frameworks. For Amazon Bedrock
Agents, the service automatically manages conversation context and
associates them with the agent-specific sessionId you specify in the
invoke_agent
API operation.
Related APIs:
-
list_sessions
-
get_session
-
end_session
-
delete_session
Usage¶
bedrockagentruntime_create_session(encryptionKeyArn, sessionMetadata,
tags)
Arguments¶
encryptionKeyArn |
The Amazon Resource Name (ARN) of the KMS key to use to encrypt the session data. The user or role creating the session must have permission to use the key. For more information, see Amazon Bedrock session encryption. |
sessionMetadata |
A map of key-value pairs containing attributes to be persisted across the session. For example, the user's ID, their language preference, and the type of device they are using. |
tags |
Specify the key-value pairs for the tags that you want to attach to the session. |
Value¶
A list with the following syntax:
list(
createdAt = as.POSIXct(
"2015-01-01"
),
sessionArn = "string",
sessionId = "string",
sessionStatus = "ACTIVE"|"EXPIRED"|"ENDED"
)
Request syntax¶
svc$create_session(
encryptionKeyArn = "string",
sessionMetadata = list(
"string"
),
tags = list(
"string"
)
)