mud_server.api.models ===================== .. py:module:: mud_server.api.models .. autoapi-nested-parse:: Pydantic models for API requests and responses. This module defines all the data models used for API communication between the FastAPI backend and the Gradio frontend. Pydantic models provide: - Automatic request/response validation - Type checking and conversion - Clear API documentation via FastAPI's automatic OpenAPI schema generation - Serialization/deserialization to/from JSON Models are organized into two categories: 1. Request models: Data sent FROM the client TO the server 2. Response models: Data sent FROM the server TO the client Classes ------- .. autoapisummary:: mud_server.api.models.LoginRequest mud_server.api.models.RegisterRequest mud_server.api.models.RegisterGuestRequest mud_server.api.models.SelectCharacterRequest mud_server.api.models.LoginDirectRequest mud_server.api.models.ChangePasswordRequest mud_server.api.models.UserManagementRequest mud_server.api.models.CreateUserRequest mud_server.api.models.ServerStopRequest mud_server.api.models.LogoutRequest mud_server.api.models.CommandRequest mud_server.api.models.ChatRequest mud_server.api.models.LoginResponse mud_server.api.models.LoginDirectResponse mud_server.api.models.SelectCharacterResponse mud_server.api.models.CharactersResponse mud_server.api.models.RegisterResponse mud_server.api.models.RegisterGuestResponse mud_server.api.models.CreateUserResponse mud_server.api.models.CommandResponse mud_server.api.models.StatusResponse mud_server.api.models.UserListResponse mud_server.api.models.DatabasePlayersResponse mud_server.api.models.DatabaseTableInfo mud_server.api.models.DatabaseTablesResponse mud_server.api.models.DatabaseTableRowsResponse mud_server.api.models.DatabasePlayerLocationsResponse mud_server.api.models.DatabaseConnectionsResponse mud_server.api.models.KickSessionRequest mud_server.api.models.KickSessionResponse mud_server.api.models.DatabaseSessionsResponse mud_server.api.models.DatabaseChatResponse mud_server.api.models.UserManagementResponse mud_server.api.models.ServerStopResponse mud_server.api.models.OllamaCommandRequest mud_server.api.models.OllamaCommandResponse mud_server.api.models.ClearOllamaContextRequest mud_server.api.models.ClearOllamaContextResponse Module Contents --------------- .. py:class:: LoginRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Login request with username and password. .. attribute:: username Account username (case-sensitive for database lookup) .. attribute:: password Plain text password (will be verified against bcrypt hash) .. attribute:: world_id Optional world id used to filter characters on login Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: username :type: str .. py:attribute:: password :type: str .. py:attribute:: world_id :type: str | None :value: None .. py:class:: RegisterRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Registration request for creating a new player account. .. attribute:: username Desired username (2-20 characters, must be unique) .. attribute:: password Desired password (minimum 8 characters) .. attribute:: password_confirm Password confirmation (must match password) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: username :type: str .. py:attribute:: password :type: str .. py:attribute:: password_confirm :type: str .. py:class:: RegisterGuestRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Registration request for creating a temporary guest account. .. attribute:: password Desired password (validated against STANDARD policy) .. attribute:: password_confirm Password confirmation (must match password) .. attribute:: character_name Initial character name for the guest account Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: password :type: str .. py:attribute:: password_confirm :type: str .. py:attribute:: character_name :type: str .. py:class:: SelectCharacterRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to select an active character for a session. .. attribute:: session_id Active session ID for authentication .. attribute:: character_id Character id to bind to the session .. attribute:: world_id World id to bind to the session (must match character's world) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: character_id :type: int .. py:attribute:: world_id :type: str | None :value: None .. py:class:: LoginDirectRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Direct login request that binds a session to a world + character. .. attribute:: username Account username (case-sensitive for database lookup) .. attribute:: password Plain text password (will be verified against bcrypt hash) .. attribute:: world_id Target world id (must be accessible by the user) .. attribute:: character_name Existing character name (optional) .. attribute:: create_character When true, create the character if missing Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: username :type: str .. py:attribute:: password :type: str .. py:attribute:: world_id :type: str .. py:attribute:: character_name :type: str | None :value: None .. py:attribute:: create_character :type: bool :value: False .. py:class:: ChangePasswordRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to change the current user's password. .. attribute:: session_id Active session ID for authentication .. attribute:: old_password Current password (verified before change) .. attribute:: new_password New password (minimum 8 characters, must differ from old) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: old_password :type: str .. py:attribute:: new_password :type: str .. py:class:: UserManagementRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to manage user accounts. Requires admin or superuser permissions. Allows role changes, banning, unbanning, and password changes of user accounts. Superusers can manage all users, admins can only manage users with lower permissions. .. attribute:: session_id Active session ID (must have appropriate permission) .. attribute:: target_username Username of the account to manage .. attribute:: action Management action - one of: - "change_role": Change user's role (requires new_role parameter) - "ban" or "deactivate": Deactivate user account (prevents login, removes active session) - "delete": Permanently delete user and related data (superuser only) - "unban": Reactivate previously banned account - "change_password": Change user's password (requires new_password parameter) .. attribute:: new_role (Optional) New role when action is "change_role" Valid roles: "player", "worldbuilder", "admin", "superuser" .. attribute:: new_password (Optional) New password when action is "change_password" Must be at least 8 characters Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: target_username :type: str .. py:attribute:: action :type: str .. py:attribute:: new_role :type: str | None :value: None .. py:attribute:: new_password :type: str | None :value: None .. py:class:: CreateUserRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to create a new user account. Requires admin or superuser permissions. Admins may create Player or WorldBuilder accounts. Superusers may create any role, including Admin and Superuser. Passwords must meet the STANDARD password policy, and password_confirm must match password. .. attribute:: session_id Active session ID (must have appropriate permission) .. attribute:: username Desired username (2-20 characters, must be unique) .. attribute:: password Desired password (must meet STANDARD policy) .. attribute:: password_confirm Password confirmation (must match password) .. attribute:: role Role to assign to the new account Valid roles: "player", "worldbuilder", "admin", "superuser" Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: username :type: str .. py:attribute:: password :type: str .. py:attribute:: password_confirm :type: str .. py:attribute:: role :type: str .. py:class:: ServerStopRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin request to stop the server gracefully. Requires STOP_SERVER permission (admin or superuser only). Server will shutdown 0.5 seconds after sending response to allow the HTTP response to be delivered. .. attribute:: session_id Active session ID (must have STOP_SERVER permission) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:class:: LogoutRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to logout and end the current session. .. attribute:: session_id Active session ID to be terminated Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:class:: CommandRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to execute a game command. Supports all game commands including movement, inventory management, chat, and special commands. Commands can be prefixed with "/" or not. .. attribute:: session_id Active session ID for authentication .. attribute:: command Game command to execute, examples: - Movement: "north", "n", "south", "s", "east", "e", "west", "w", "up", "u", "down", "d" - Actions: "look", "inventory", "get ", "drop " - Chat: "say ", "yell ", "whisper " - Info: "who", "help" Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: command :type: str .. py:class:: ChatRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to send a chat message. Note: This model is defined but may not be actively used. Chat is typically sent via CommandRequest with "/say" command. .. attribute:: session_id Active session ID for authentication .. attribute:: message Chat message text Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: message :type: str .. py:class:: LoginResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to login request. .. attribute:: success True if login succeeded, False otherwise .. attribute:: message Welcome message on success, error message on failure .. attribute:: session_id (Optional) UUID session identifier on successful login .. attribute:: role (Optional) User's role on successful login ("player", "worldbuilder", "admin", or "superuser") .. attribute:: characters List of available characters for selection .. attribute:: available_worlds List of available worlds for selection Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: session_id :type: str | None :value: None .. py:attribute:: role :type: str | None :value: None .. py:attribute:: characters :type: list[dict[str, Any]] :value: [] .. py:attribute:: available_worlds :type: list[dict[str, Any]] :value: [] .. py:class:: LoginDirectResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to direct login request. .. attribute:: success True if login succeeded, False otherwise .. attribute:: message Welcome message on success, error message on failure .. attribute:: session_id Session identifier on successful login .. attribute:: role User's role on successful login .. attribute:: character_name Selected character name on success .. attribute:: world_id World bound to the session Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: session_id :type: str | None :value: None .. py:attribute:: role :type: str | None :value: None .. py:attribute:: character_name :type: str | None :value: None .. py:attribute:: world_id :type: str | None :value: None .. py:class:: SelectCharacterResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to character selection request. .. attribute:: success True if character selected .. attribute:: message Success or error message .. attribute:: character_name Selected character name on success Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: character_name :type: str | None :value: None .. py:class:: CharactersResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response containing the user's characters. .. attribute:: characters List of character summaries Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: characters :type: list[dict[str, Any]] .. py:class:: RegisterResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to registration request. .. attribute:: success True if account created, False otherwise .. attribute:: message Success confirmation or error details Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: RegisterGuestResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to guest registration request. .. attribute:: success True if account created, False otherwise .. attribute:: message Success confirmation or error details .. attribute:: username Generated guest username for login Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:attribute:: username :type: str | None :value: None .. py:class:: CreateUserResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to admin user creation request. .. attribute:: success True if account created, False otherwise .. attribute:: message Success confirmation or error details Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: CommandResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to game command execution. .. attribute:: success True if command executed successfully, False for errors .. attribute:: message Command result, room description, error message, etc. For movement: includes new room description For inventory: lists items in inventory For chat: confirmation message For errors: explanation of what went wrong Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: StatusResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response containing player's current game status. Used for periodic status updates to keep the UI synchronized. Attributes: active_players: List of usernames currently online current_room: Player's current room ID (e.g., "spawn", "forest_1") inventory: Formatted inventory string (e.g., "Your inventory: - Torch - Rope") Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: active_players :type: list[str] .. py:attribute:: current_room :type: str | None .. py:attribute:: inventory :type: str .. py:class:: UserListResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response containing list of user accounts. Used for admin user management interfaces. .. attribute:: users List of user data dictionaries with account information Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: users :type: list[dict[str, Any]] .. py:class:: DatabasePlayersResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing all user records from database. Requires VIEW_LOGS permission. Includes account details and character counts. .. attribute:: players List of user data dictionaries with fields: - id: Database record ID - username: Account username - password_hash: Truncated password hash (first 20 chars + "...") - role: User role - account_origin: Account provenance ("visitor", "admin", "superuser", "system", "legacy") - is_guest: Guest flag - guest_expires_at: Guest expiry timestamp - character_count: Number of linked characters - created_at: Account creation timestamp - last_login: Last login timestamp - is_active: Account status (True=active, False=banned) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: players :type: list[dict[str, Any]] .. py:class:: DatabaseTableInfo(/, **data) Bases: :py:obj:`pydantic.BaseModel` Metadata about a single database table. .. attribute:: name Table name. .. attribute:: columns List of column names in order. .. attribute:: row_count Number of rows in the table. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: name :type: str .. py:attribute:: columns :type: list[str] .. py:attribute:: row_count :type: int .. py:class:: DatabaseTablesResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing database table metadata. Requires VIEW_LOGS permission. Used for table discovery in the admin UI. .. attribute:: tables List of DatabaseTableInfo entries. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: tables :type: list[DatabaseTableInfo] .. py:class:: DatabaseTableRowsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing rows for a specific database table. Requires VIEW_LOGS permission. Includes column names and raw row values. .. attribute:: table Table name. .. attribute:: columns Column names in order. .. attribute:: rows Row values as a list of rows (each row is a list of values). Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: table :type: str .. py:attribute:: columns :type: list[str] .. py:attribute:: rows :type: list[list[Any]] .. py:class:: DatabasePlayerLocationsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing character locations with names. Requires VIEW_LOGS permission. Useful for cross-referencing room occupancy. .. attribute:: locations List of dicts with fields: - character_id - character_name - zone_id - room_id - updated_at Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: locations :type: list[dict[str, Any]] .. py:class:: DatabaseConnectionsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing active session connections. Requires VIEW_LOGS permission. Includes activity age for dashboards. .. attribute:: connections List of session dictionaries with fields: - id - username - session_id - created_at - last_activity - expires_at - client_type - age_seconds Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: connections :type: list[dict[str, Any]] .. py:class:: KickSessionRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to force-disconnect a session. Requires KICK_USERS permission. .. attribute:: session_id Admin's active session id. .. attribute:: target_session_id Session id to disconnect. .. attribute:: reason Optional reason for audit/logging. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: target_session_id :type: str .. py:attribute:: reason :type: str | None :value: None .. py:class:: KickSessionResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response for a kick session request. .. attribute:: success True if session was removed. .. attribute:: message Human-readable result. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: DatabaseSessionsResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing all active sessions from database. Requires VIEW_LOGS permission. Shows who is currently logged in. .. attribute:: sessions List of session data dictionaries with fields: - id: Database record ID - username: Logged in account - character_name: Active character for the session (if selected) - session_id: UUID session identifier - created_at: Login timestamp - last_activity: Most recent API request timestamp - expires_at: Session expiry timestamp (NULL means no expiry) - client_type: Client identifier (tui, browser, api) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: sessions :type: list[dict[str, Any]] .. py:class:: DatabaseChatResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Admin response containing recent chat messages across all rooms. Requires VIEW_LOGS permission. Useful for moderation and monitoring. .. attribute:: messages List of chat message dictionaries with fields: - id: Database record ID - username: Message sender - message: Message text (includes [WHISPER], [YELL] prefixes) - room: Room ID where message was sent - timestamp: Message timestamp Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: messages :type: list[dict[str, Any]] .. py:class:: UserManagementResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to user management action (role change, ban, unban). .. attribute:: success True if action completed successfully .. attribute:: message Confirmation message or error details Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: ServerStopResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to server stop request. Server will shutdown shortly after sending this response. .. attribute:: success True if shutdown initiated .. attribute:: message Confirmation message indicating who initiated shutdown Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str .. py:class:: OllamaCommandRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to execute an Ollama command. Requires VIEW_LOGS permission (admin or superuser only). .. attribute:: session_id Active session ID (must have appropriate permission) .. attribute:: server_url URL of the Ollama server (e.g., "http://localhost:11434") .. attribute:: command Ollama command to execute (e.g., "list", "ps", "run llama2") Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:attribute:: server_url :type: str .. py:attribute:: command :type: str .. py:class:: OllamaCommandResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to Ollama command execution. .. attribute:: success True if command executed successfully .. attribute:: output Command output or error message Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: output :type: str .. py:class:: ClearOllamaContextRequest(/, **data) Bases: :py:obj:`pydantic.BaseModel` Request to clear Ollama conversation context for the current session. Requires VIEW_LOGS permission (admin or superuser only). .. attribute:: session_id Active session ID (must have appropriate permission) Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: session_id :type: str .. py:class:: ClearOllamaContextResponse(/, **data) Bases: :py:obj:`pydantic.BaseModel` Response to clear Ollama context request. .. attribute:: success True if context was cleared successfully .. attribute:: message Confirmation message Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:attribute:: success :type: bool .. py:attribute:: message :type: str