Skip to main content
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

agent
Agent
required
The Strands Agent instance to retrieve the conversation ID from

Returns

The conversation ID string, or empty string if none has been set