vibe.runtime_models.session¶
Session state validation models.
Provides Pydantic models for validating: - Assistant messages (SystemMessage, UserMessage, AssistantMessage, ToolResult) - Tool calls and tool results - Interview session metadata - Session serialization/deserialization
These models are used at session load/save boundaries and when deserializing messages from persisted .vibestate files.
Note: These are validation-only models. The actual dataclass instances from vibe.assistant.strructures are used at runtime. These Pydantic models validate dict data before constructing dataclasses.
ToolCallModel ¶
Validation model for LLM tool invocations.
Validates the structure of tool calls made by the LLM, ensuring required fields are present and well-formed.
SystemMessageModel ¶
Validation model for system messages.
System messages contain instructions and context for the LLM.
UserMessageModel ¶
Validation model for user messages.
User messages contain user input, either as plain text or structured form data.
AssistantMessageModel ¶
Validation model for assistant (LLM) messages.
Assistant messages contain LLM-generated text and optional tool calls.
ToolResultModel ¶
Validation model for tool execution results.
Tool results contain the output from executing a tool call.
MessageHistoryModel ¶
Validation model for a list of messages.
Ensures message history is well-formed and maintains required ordering.
validate_tool_result_references ¶
validate_tool_result_references() -> MessageHistoryModel
Ensure tool results reference valid tool calls.
Each ToolResult must have a corresponding ToolCall earlier in history.
DraftBlockModel ¶
Validation model for assistant draft blocks.
Draft blocks are sections of generated content that may reference questions and contain LLM-generated text.
AssistantSessionModel ¶
Validation model for per-assistant session state.
Each assistant maintains its own session data including message history, draft blocks, and turn tracking.
InterviewSessionModel ¶
Validation model for interview session state.
Validates the core interview session structure stored in Flask session. Uses FlexibleModel to allow for extensions and backward compatibility.