ConversationStore#
- class ansys.cfx.mcp.common.conversation.ConversationStore(*, ttl_seconds: float = 60 * 60, max_entries: int = 256)#
Thread-safe TTL-bounded conversation store.
Overview#
Create and store a new code-generation conversation entry. |
|
Return an existing conversation entry by session identifier. |
|
Return an existing conversation entry or create a new one. |
|
Refresh the last-used time for a conversation entry. |
|
Append one message to a conversation history. |
|
Record the clarification currently awaiting a user answer. |
|
Return whether a conversation is waiting for a specific clarification. |
|
Return whether a clarification was asked very recently. |
Import detail#
from ansys.cfx.mcp.common.conversation import ConversationStore
Method detail#
- ConversationStore.create() ConversationEntry#
Create and store a new code-generation conversation entry.
- Returns:
ConversationEntryValue computed by the helper for the requested CFX workflow.
- ConversationStore.get(session_id: str) ConversationEntry | None#
Return an existing conversation entry by session identifier.
- Parameters:
- session_id
str Conversation identifier used to retrieve or continue context.
- session_id
- Returns:
Optional[ConversationEntry]Value computed by the helper for the requested CFX workflow.
- ConversationStore.get_or_create(session_id: str | None) ConversationEntry#
Return an existing conversation entry or create a new one.
- Parameters:
- session_id
Optional[str] Conversation identifier used to retrieve or continue context.
- session_id
- Returns:
ConversationEntryRequested CFX data or metadata for the active session.
- ConversationStore.append_history(session_id: str, role: str, content: Any) None#
Append one message to a conversation history.
- ConversationStore.set_pending_clarification(session_id: str, clarification: dict[str, Any] | None) None#
Record the clarification currently awaiting a user answer.
- ConversationStore.has_pending_clarification_id(session_id: str, clarification_id: str) bool#
Return whether a conversation is waiting for a specific clarification.