Skip to content

SessionState

Source code in docs_src/capo_bedrock_agent_runtime/types/session_state.py
class SessionState(TypedDict, closed=True):
    session_attributes: NotRequired[
        "capo_bedrock_agent_runtime.types.session_attributes_map.SessionAttributesMap"
    ]
    """<p>Contains attributes that persist across a session and the values of those attributes. If <code>sessionAttributes</code> are passed to a supervisor agent in <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html">multi-agent collaboration</a>, it will be forwarded to all agent collaborators.</p>"""
    prompt_session_attributes: NotRequired[
        "capo_bedrock_agent_runtime.types.prompt_session_attributes_map.PromptSessionAttributesMap"
    ]
    """<p>Contains attributes that persist across a prompt and the values of those attributes. </p> <ul> <li> <p>In orchestration prompt template, these attributes replace the $prompt_session_attributes$ placeholder variable. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-placeholders.html">Prompt template placeholder variables</a>.</p> </li> <li> <p>In <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-multi-agent-collaboration.html">multi-agent collaboration</a>, the <code>promptSessionAttributes</code> will only be used by supervisor agent when $prompt_session_attributes$ is present in prompt template. </p> </li> </ul>"""
    return_control_invocation_results: NotRequired[
        "capo_bedrock_agent_runtime.types.return_control_invocation_results.ReturnControlInvocationResults"
    ]
    """<p>Contains information about the results from the action group invocation. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html">Return control to the agent developer</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p> <note> <p>If you include this field, the <code>inputText</code> field will be ignored.</p> </note>"""
    invocation_id: NotRequired["str"]
    """<p>The identifier of the invocation of an action. This value must match the <code>invocationId</code> returned in the <code>InvokeAgent</code> response for the action whose results are provided in the <code>returnControlInvocationResults</code> field. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-returncontrol.html">Return control to the agent developer</a> and <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html">Control session context</a>.</p>"""
    files: NotRequired["capo_bedrock_agent_runtime.types.input_files.InputFiles"]
    """<p>Contains information about the files used by code interpreter.</p>"""
    knowledge_base_configurations: NotRequired[
        "capo_bedrock_agent_runtime.types.knowledge_base_configurations.KnowledgeBaseConfigurations"
    ]
    """<p>An array of configurations, each of which applies to a knowledge base attached to the agent.</p>"""
    conversation_history: NotRequired[
        "capo_bedrock_agent_runtime.types.conversation_history.ConversationHistory"
    ]
    """<p>The state's conversation history.</p>"""

conversation_history instance-attribute

conversation_history: NotRequired[ConversationHistory]

The state's conversation history.

files instance-attribute

files: NotRequired[InputFiles]

Contains information about the files used by code interpreter.

invocation_id instance-attribute

invocation_id: NotRequired[str]

The identifier of the invocation of an action. This value must match the invocationId returned in the InvokeAgent response for the action whose results are provided in the returnControlInvocationResults field. For more information, see Return control to the agent developer and Control session context.

knowledge_base_configurations instance-attribute

knowledge_base_configurations: NotRequired[KnowledgeBaseConfigurations]

An array of configurations, each of which applies to a knowledge base attached to the agent.

prompt_session_attributes instance-attribute

prompt_session_attributes: NotRequired[PromptSessionAttributesMap]

Contains attributes that persist across a prompt and the values of those attributes.

  • In orchestration prompt template, these attributes replace the $prompt_session_attributes$ placeholder variable. For more information, see Prompt template placeholder variables.

  • In multi-agent collaboration, the promptSessionAttributes will only be used by supervisor agent when $prompt_session_attributes$ is present in prompt template.

return_control_invocation_results instance-attribute

return_control_invocation_results: NotRequired[ReturnControlInvocationResults]

Contains information about the results from the action group invocation. For more information, see Return control to the agent developer and Control session context.

If you include this field, the inputText field will be ignored.

session_attributes instance-attribute

session_attributes: NotRequired[SessionAttributesMap]

Contains attributes that persist across a session and the values of those attributes. If sessionAttributes are passed to a supervisor agent in multi-agent collaboration, it will be forwarded to all agent collaborators.