ephemeral • AI Agent SDK
ephemeral: Context manager for ephemeral conversations.
ephemeral
Method
</div>
Context manager for ephemeral conversations.
Messages within this block are NOT permanently stored in chat_history. History is restored to pre-block state after exiting.
Signature
def ephemeral() -> AnyReturns
ResponseField
AnyThe result of the operation.
Usage
with agent.ephemeral():
response = agent.chat("[IMAGE] Analyze this")
# After block, history is restored - image NOT persistedSource
View on GitHubpraisonaiagents/agent/agent.py at line 4278