pipeworks_mud_mapper.services.ollama_client =========================================== .. py:module:: pipeworks_mud_mapper.services.ollama_client .. autoapi-nested-parse:: Thin client for interacting with a local Ollama server. This module isolates HTTP communication so callbacks can remain focused on UI state and response handling. It also provides a central place for timeouts and request formatting. Functions --------- .. autoapisummary:: pipeworks_mud_mapper.services.ollama_client.list_models pipeworks_mud_mapper.services.ollama_client.chat Module Contents --------------- .. py:function:: list_models(server_url) Return the list of models from the Ollama server. :param server_url: Base URL for the Ollama server (e.g., http://localhost:11434). :type server_url: :py:class:`str` :returns: Raw model entries from the Ollama /api/tags endpoint. :rtype: :py:class:`list[dict[str`, :py:class:`Any]]` .. py:function:: chat(server_url, model, messages, options) Send a chat request to the Ollama /api/chat endpoint. :param server_url: Base URL for the Ollama server (e.g., http://localhost:11434). :type server_url: :py:class:`str` :param model: Ollama model identifier (e.g., "llama3:8b"). :type model: :py:class:`str` :param messages: Chat message objects with role/content keys. :type messages: :py:class:`list[dict[str`, :py:class:`str]]` :param options: Ollama generation options (seed, temperature, etc.). :type options: :py:class:`dict[str`, :py:class:`Any]` :returns: Parsed JSON response from the Ollama server. :rtype: :py:class:`dict[str`, :py:class:`Any]`