get_conversation_id

API reference for get_conversation_id

get_conversation_id()

Get the conversation ID for the current agent invocation.

Retrieves the conversation ID that was previously set using set_conversation_id(). Works in both synchronous and asynchronous contexts automatically.

Parameters

Parameter
Type
Required
Default
Description

agent

Agent

None

The Strands Agent instance to retrieve the conversation ID from

Returns

The conversation ID string, or empty string if none has been set Return type: str

Last updated

Was this helpful?