mud_server.admin_gradio.api.base ================================ .. py:module:: mud_server.admin_gradio.api.base .. autoapi-nested-parse:: Base API Client for MUD Server. This module provides the foundational HTTP client for communicating with the FastAPI backend server. It handles common patterns like request execution, error handling, and response parsing. All domain-specific API clients (auth, game, admin, ollama) inherit from BaseAPIClient to get consistent error handling and request patterns. Configuration: SERVER_URL: Backend API server URL (can be overridden with MUD_SERVER_URL env var) Classes ------- .. autoapisummary:: mud_server.admin_gradio.api.base.BaseAPIClient Module Contents --------------- .. py:class:: BaseAPIClient(server_url = None) Base API client providing common HTTP request patterns and error handling. This class handles: - Server URL configuration - Common request patterns (GET, POST) - Consistent error handling and formatting - Response parsing and validation .. attribute:: server_url Backend API server URL Initialize the base API client. :param server_url: Optional server URL override. If not provided, uses MUD_SERVER_URL environment variable or defaults to http://localhost:8000 .. py:attribute:: server_url .. py:method:: get(endpoint, params = None, headers = None, timeout = 30) Make a GET request to the API. :param endpoint: API endpoint path :param params: Optional query parameters :param headers: Optional headers to send with the request :param timeout: Request timeout in seconds :returns: Standardized response dictionary (see _make_request) .. py:method:: post(endpoint, json = None, headers = None, timeout = 30) Make a POST request to the API. :param endpoint: API endpoint path :param json: Optional JSON body :param headers: Optional headers to send with the request :param timeout: Request timeout in seconds :returns: Standardized response dictionary (see _make_request)