ollmchat
Description:
OLLMchat API - Package Overview
This documentation covers the OLLMchat application and its libraries.
Application
* libollmapp — namespace: OLLMapp. Main application: window, settings dialogs. Entry point and
window management.
Core libraries
* libollmchat — namespace: OLLMchat. LLM chat client: Ollama/OpenAI-compatible API, tool
calling, streaming, history, and configuration without GTK.
- Client — API communication and chat entry point.
Message — chat message representation.
- Call — API call implementations. Base
, Chat, Embed,
Models, Create,
Delete, Pull,
Version.
- Response — Response types for API results.
Base, Chat,
CallFunction,
ToolCall.
- Tool — Function calling (tools, params, requests).
BaseTool, Function,
Param, RequestBase.
- History — Session persistence and list.
Manager, Session,
SessionBase.
- Settings — Configuration (connections, models, usage).
Connection, Config1
, Config2,
AvailableModels,
ModelUsage.
- Agent — Agent interface and implementations.
Interface, Base,
Factory, JustAsk,
JustAskFactory.
- Prompt — Prompt templates for agents.
Template.
- ChatPermission — Permission provider for tool access.
Provider,
Dummy.
* liboctools — namespace: OLLMtools. Built-in tools; registered via
Tool and used by the chat/agent stack.
* libocfiles — namespace: OLLMfiles. File and project management: buffers, files, folders,
project list, tree-sitter AST paths, diff/patch.
* libollmchatgtk — namespace: OLLMchatGtk. Chat widget, history browser, tool permission
UI, model usage list. Application-facing GTK pieces.
Semantic Search
* libocvector — namespace: OLLMvector. Vector search and codebase indexing: embeddings,
FAISS, indexing pipeline, semantic search.
Markdown parsing and rendering
* libocmarkdown — namespace: Markdown. Markdown parsing and document model. Used by skills
and chat rendering.
* libocmarkdowngtk — namespace: MarkdownGtk. GTK markdown rendering for the chat UI.
Coding and Skills
* liboccoder — namespace: OLLMcoder. Code-editor and task/skill layer: skills, tasks, GTK
source view. Skill-based task creation, refinement, and execution.
- Skill — Skill definitions, runner, manager, templates.
Runner, Manager,
Factory, Definition
, PromptTemplate.
- Task — Task list, details, tool runs, steps, result parsing.
List, Details,
Tool, Step,
ResultParser.
- Agent — Coding agent.
AgentFactory — Factory. SourceView — Code editor widget.
Database
* libocsqlite — namespace: SQ. SQLite wrapper. Used by libocfiles and libocvector.
Reference
- Vala — Vala language site (external).
Content:
Namespaces:
- Markdown
Classes:
- BlockMap - Marker map for block-level markers
(headings, HR, lists, fenced code, blockquote, etc.). Used by the parser for handle_block_result().
- DummyRenderer - Dummy renderer for testing the
Parser. Extends RenderBase and overrides methods to print callbacks instead of rendering.
- EndMap - Marker map for delimiter runs that are valid
at **end of line** ("?_"). Used when the run is at end of line (closing delimiter). Contains only emphasis-style sequences (asterisk
and underscore); no links, code, etc. No integration with parser yet - structure only.
- FormatMap - Marker map for inline format markers
(bold, italic, code, etc.). Used by the parser for format detection via eat().
- HtmlParser - Converts HTML to Markdown format.
- HtmlRender - Simple renderer that converts
markdown to HTML strings.
- LeftMap - Marker map for delimiter runs that are
valid as opening delimiters (must be preceded by whitespace). peek() wraps eat() and fails if at line start or the character before is
not whitespace. Contains only emphasis-style sequences (asterisk and underscore); no links, code, etc.
- ListMap - Marker map for list-only block markers
(CONTINUE_LIST, ORDERED_LIST, UNORDERED_LIST). Used by the parser (via BlockMap.peek) for list-block detection.
- MarkerMap - Base class for marker maps
used by the parser. Holds an instance map and provides generic peek logic for matching variable-length marker sequences at a given
position.
- PangoRender - Simple renderer that converts
markdown and HTML tags to Pango markup strings.
- Parser - Parser for markdown text that calls specific
callbacks on Render.
- RenderBase - Base abstract class for
renderers that use the Parser.
- RightMap - Marker map for delimiter runs that are
valid as closing delimiters (must be followed by whitespace or newline). peek() wraps eat() and rejects the match if the next
character is not whitespace or newline. Contains only emphasis-style sequences (asterisk and underscore); no links, code, etc.
- StartMap - Marker map for delimiter runs that are
valid at **start of line** only. Used when the preceding context is "start of line" (e.g. at_line_start). Contains only emphasis-style
sequences (asterisk and underscore); no links, code, etc.
- Writer - Handles markdown output writing.
Enums:
Methods:
- Document
Classes:
- MarkdownGtk
Classes:
- Render - Renders markdown content to a
Gtk.TextBuffer using a state-based renderer.
- RenderSourceView - Handles SourceView
widget creation and management for code blocks.
- State - Represents a single piece of styling in the
markdown renderer.
- TopState - Extends State to handle special root
state behavior.
- OLLMapp
Classes:
- About - About button widget that shows an
Adw.AboutWindow when clicked. Self-contained component that handles its own dialog.
- FileChangeBanner - Banner widget that
displays file change warnings with action buttons.
- Initialize - Handles application initialization
and verification.
- OllmchatApplication - Main application
class implementing OLLMchat.ApplicationInterface interface.
- OllmchatWindow
- VectorScanBanner - Banner widget that
displays semantic search analysis progress.
- WindowPane - Window pane utility class that
manages a split view with special resizing behavior.
- SettingsDialog
Classes:
- AddModelDialog - Dialog for
adding models by selecting from available models list.
- CheckingConnectionDialog -
Dialog that shows a spinner while checking connection.
- ConnectionAdd - Dialog for
adding connections.
- ConnectionRow - Widget group for
a single connection row in the connections page.
- ConnectionsPage - Connections
tab content for settings dialog.
- MainDialog - Main settings dialog
for displaying and changing configuration.
- ModelRow - Model row widget that
extends Adw.ExpanderRow.
- ModelsPage - Models tab content for
settings dialog.
- ProjectSearchFilter -
Gtk.Filter for projects list: filters by project name (basename) or full path. Case-insensitive substring match. Emits changed when
query is set.
- ProjectsPage - Projects tab
content for settings dialog. Lists projects from ProjectManager, search/filter, Add and Remove. List view is built in the constructor
with a dummy empty model; the real store is bound when the dialog is shown via ensure_loaded() (called once).
- PullManager - Manages background
pull operations for models.
- PullManagerBanner - Banner
widget that displays pull progress information.
- PullStatus - Pull status
information for a model pull operation.
- SearchablePulldown - Simple
string-based searchable dropdown widget.
- SettingsPage - Base class for
settings dialog pages.
- ToolsPage - Tools tab content for
settings dialog.
- Rows
Classes:
- Bool - Widget class for bool
properties.
- Connection - Widget class for
connection properties.
- Float - Generic float option widget
that extends Row.
- Int - Generic int option widget that
extends Row.
- Model - Widget class for model
properties.
- ModelUsage - Widget class for
ModelUsage properties.
- Options - Widget that contains
all option rows for model configuration.
- Row - Base class for all
config widget classes.
- String - Widget class for string
properties.
- Tool - Tool row widget that extends
Adw.ExpanderRow.
- OLLMchat - LLM chat client namespace.
Interfaces:
- ApplicationInterface - Interface
for OLLMchat applications that provides standardized configuration and data directory management.
- ChatContentInterface - Interface
for objects that provide chat content.
Classes:
- Client - Main client class for interacting with
Ollama API and OpenAI-compatible REST interfaces.
- Message - Message class for chat conversations with
role-based behavior.
Error domains:
Fields:
- public bool debug_critical_enabled
Enable treating critical warnings as errors (abort on critical
warnings). Set to true to cause the program to abort on critical warnings.
- public bool debug_on
Enable debug output (show all log messages). Set to true to see all
log messages, false to only see critical warnings.
- Agent - Agent system namespace.
Interfaces:
- Interface - Interface for agent
implementations.
Classes:
- Base - Base handler for agent requests.
- Factory - Base class for agent factories.
- JustAsk - Just Ask agent - a simple pass-
through agent.
- JustAskFactory - Just Ask factory -
creates simple pass-through agents.
- Call - API call implementations namespace.
Classes:
- Base - Abstract base class for all Ollama
API calls.
- Chat - Chat API call implementation for sending
messages and receiving responses.
- Create - API call to create a model using the
Ollama create API endpoint.
- Delete - API call to delete a model from the
Ollama server.
- Embed - API call to generate embeddings for input
text.
- Generate - API call to generate a response for
a prompt.
- Models - API call to list available models
(OpenAI-compatible).
- Options - Options object for Ollama API calls.
- Ps - API call to list currently running models on
the Ollama server.
- Pull - API call to pull a model from the Ollama
server.
- ShowModel - API call to get detailed
information about a specific model.
- Version - API call to get the version of the
Ollama server.
- ChatPermission - Tool permission system
namespace.
Classes:
- Dummy - Dummy implementation of
Provider for testing.
- Provider - Abstract base
class for requesting permission to execute tool operations.
Enums:
- Operation - Operation types for
permission requests. Can be combined using bitwise OR (e.g., READ | WRITE).
- PermissionResponse -
Permission response from user. Combines allow/deny decision with storage type.
- PermissionResult - Permission
check result.
- History - Chat history and session management
namespace.
Classes:
- EmptySession - EmptySession represents
a session that hasn't started yet (no messages sent).
- Manager - Manager for chat history
persistence.
- Session - Session is a wrapper around
Call.Chat that provides history persistence.
- SessionBase - Base class for
Session implementations.
- SessionJson - SessionJson is used only
for loading messages from JSON files.
- SessionList - Manages session list with
deduplication and fast lookup.
- SessionPlaceholder -
SessionPlaceholder represents a chat session loaded from the database but without the chat connected or messages loaded.
- TitleGenerator - Generates concise
titles for chat conversations using LLM.
- Prompt - Prompt generation and agent system
namespace.
Classes:
- Template - Base prompt template: load from
resource URI or filesystem, fill placeholders. Subclasses set source and base_dir (e.g.
resource:// + /ocvector
, or filesystem path).
- Response - API response handling namespace.
Classes:
- Base - Abstract base class for Ollama
API responses.
- CallFunction - Represents a function
call with name and arguments. Used within ToolCall to represent the function being called.
- Chat - Response from a chat API call.
- Create - Represents a progress chunk from
the create API.
- Embed - Represents the response from the
embeddings API.
- Generate - Represents the response from
the generate API.
- Model - Represents model information from the
Ollama server.
- Pull - Represents a progress chunk from the
pull API.
- ToolCall - Represents a tool call from the
assistant. Used in assistant messages with tool_calls array.
- Settings - Configuration and settings namespace.
Interfaces:
Classes:
- AvailableModel - Represents an
available model from the Ollama models cache.
- AvailableModels - Manages available
models cache with ArrayList backing.
- BaseToolConfig - Base configuration
class for simple tools that only need enabled/disabled.
- Config1 - Configuration management for
OLLMchat client settings (Version 1).
- Config2 - Main serializable configuration
holder for version 2 format (multiple clients, extended structure).
- Connection - Represents a single server
connection configuration.
- ConnectionModels - Manages the
list of available models from all configured connections.
- ModelTag - Represents a model tag with
size, context, and input information.
- ModelUsage - Represents model usage
configuration (connection, model, and optional options).
- Tool - Tool interface and parameter system namespace.
Interfaces:
- WrapInterface - Interface for tools
that can be wrapped by other tools.
Classes:
- BaseTool - Abstract base class for
tools that can be used with Ollama function calling.
- Function - Concrete class representing a
function within a Tool.
- Param - Abstract base class for
parameter definitions.
- ParamArray - Represents an array parameter
with items definition.
- ParamObject - Represents an object
parameter with nested properties.
- ParamParser - Parser for tool definition
text containing descriptions and annotations.
- ParamSimple - Represents a simple parameter
type (string, integer, boolean).
- RequestBase - Abstract base class
for tool request execution.
- OLLMchatGtk
Classes:
- ChatBar - Chat bar widget: model dropdown, tools
menu, Send/Stop button. ChatWidget creates this and places it in the lower box with the permission widget.
- ChatInput - Chat text area: multiline input
only. ChatWidget places this in the paned and wires send_clicked / get_text_to_send with ChatBar.
- ChatPermission - Permission widget that
displays permission requests with buttons.
- ChatView - Chat view widget for displaying chat
messages with markdown rendering.
- ChatWidget - Reusable chat widget that can be
embedded anywhere in the project.
- HistoryBrowser - History browser widget
that displays a list of past chat sessions.
- List
Classes:
- Tools
Classes:
- Permission - Permission provider that
displays permission requests using ChatWidget's permission widget.
- OLLMcoder - GTK-based code editor components namespace.
Classes:
- Agent - Handler for CodeAssistant agent requests.
- AgentFactory - Code Assistant factory.
- Approvals - Horizontal box widget containing
buttons for file approval workflow.
- BufferProvider - GTK implementation for GUI
contexts.
- FileDropdown - Searchable dropdown widget for
selecting files.
- GitProvider - Git implementation of git
provider for Folder and ProjectManager operations.
- GtkSourceFileBuffer - GTK SourceView
buffer implementation for GUI contexts.
- ProjectDropdown - Searchable dropdown
widget for selecting projects.
- SearchableDropdown - Base class
for searchable dropdown widgets.
- SourceView - Source view component with code
editor.
- List
Classes:
- SortedList - A sorted and filtered list
model for any type of object.
- Skill
Classes:
- Definition - One skill file: YAML header,
then Refinement and Execution sections separated by "---". Constructor only stores path; call load() to read and parse. Header is
stored in a hash map; "name" etc. are read from the map after load.
- Factory - Lightweight factory: creates
Manager and Runner only. Message building lives in Runner.
- Manager - Holds an array of skills
directories and two maps: path → Definition and name → Definition. One scan populates both; each Definition stores its own mtime.
- PromptTemplate - Prompt template that
loads from the skill-prompts resource only (no filesystem).
- Runner - Agent that runs a single skill.
Builds system message (template + available skills + current skill) and user message (template or pass-through); injects them and
sends.
- Task
Classes:
- Details - One task in the plan. Built from
task list output; updated from refinement output.
- List - Ordered list of task steps produced by
planning; runs refinement and execution.
- ResultParser - Parses structured markdown
responses from the LLM into task data and results.
- Step - One unit of the task list: either a single
task or a concurrent group.
- Tool - Parsed tool call (refinement) and/or one
execution run.
Enums:
- OLLMfiles - File and project management namespace.
Interfaces:
- FileBuffer - Interface for file buffer
operations.
Classes:
- BufferProviderBase - Base implementation
for non-GTK contexts.
- DeleteManager - Centralizes all file deletion
logic.
- DummyFileBuffer - In-memory buffer
implementation for non-GTK contexts (tools, CLI).
- File - Represents a file in the project.
- FileAlias - Represents a symlink/alias to a file
or folder.
- FileBase - Abstract base class providing
common properties and methods for files and folders.
- FileChange - Represents a single edit operation
with range and replacement.
- FileHistory - Represents a file change history
entry. Handles backup creation and database storage for file changes.
- Folder - Represents a directory/folder in the
project.
- FolderFiles - Manages files and subfolders in a
folder (hierarchical tree structure).
- GitProviderBase - Base class for git
operations with default no-op implementations.
- ProjectFile - Wrapper around a File object for
use in project file lists.
- ProjectFiles - Manages files in a project
(flat list for dropdowns/search).
- ProjectList - Manages project list with
deduplication.
- ProjectManager - Central coordinator for all
file system operations.
- ProjectMigrate - Migrates project data from
existing sources (Cursor, roobuilder, VS Code).
- ReviewFiles - Manages files in a project that
need approval (flat list for approvals UI).
- Tree - Tree-sitter AST path lookup class.
- TreeBase - Base class for tree-sitter AST
parsing.
Enums:
- Diff
Classes:
- Differ - Simple line-based diff implementation
using Myers algorithm.
- Patch - Represents a patch operation with line
numbers.
- PatchApplier - Applies patches to text.
Enums:
- SQT
Classes:
- OLLMtools
Classes:
- Registry - Registry for all tools in liboctools.
- ToolBuilder - Builder class for creating
wrapped tools from .tool definition files.
- Child
Classes:
- Agent - Agent instance for agent tool
execution.
- Config - Tool-specific configuration for agent
tools with model usage.
- Factory - Factory class that creates agent
instances for agent tools.
- Parser - Parser class for parsing agent file
frontmatter.
- Request - Request handler for agent tool
execution.
- Tool - Main tool class that executes agent
requests.
- EditMode
Classes:
- Request - Request handler for editing
files by activating "edit mode" for a file.
- Stream - Handles streaming content parsing
for EditMode.
- Tool - Tool for editing files by activating
"edit mode" for a file.
- GoogleSearch
Classes:
- Config - Tool-specific configuration
for Google search tool.
- Request - Request handler for
performing Google web searches.
- Result - Search results container from
Google Custom Search API.
- ResultItem - Result item from
Google Custom Search API.
- Tool - Tool for performing web searches
using Google Custom Search API.
- ReadFile
Classes:
- Request - Request handler for reading file
contents with optional line range support.
- Summarize - Tree-sitter based file
structure summarizer.
- Tool - Tool for reading file contents with
optional line range support.
- RunCommand
Classes:
- Bubble - Bubble class for executing
commands in bubblewrap sandbox.
- Overlay - Manages overlay filesystem
creation, mounting, and cleanup for isolating writes during command execution.
- Request - Request handler for executing
terminal commands in the project root directory.
- Scan - Post-completion overlay scanner that
detects all changes (additions, modifications, deletions) and synchronizes them with the live filesystem and ProjectFiles database.
- Tool - Tool for executing terminal commands
in the project root directory.
- WebFetch
Classes:
- Request - Request handler for fetching web
content with automatic format detection and conversion.
- Tool - Tool for fetching web content with
automatic format detection and conversion.
- WriteFile
Classes:
- Request
- Tool - One-shot file write tool. Same
semantics as EditMode (permissions, backups) but content and mode are in the call; no streaming.
- OLLMvector - Vector search and codebase indexing
namespace.
Classes:
- BackgroundScan - BackgroundScan manages a
background thread that continuously processes file‑indexing jobs. The thread is started on first use and lives for the lifetime of
the application.
- Database - Vector database with embedding
generation and FAISS storage.
- Index - FAISS index wrapper for vector storage and
similarity search.
- Registry - Registry for all tools in libocvector.
- VectorBase - Base class for vector
operations that need tool config access.
Structs:
- Indexing - Code indexing namespace.
Classes:
- Search - Vector search namespace.
Classes:
- Search - Executes vector search operations.
- SearchResult - Represents a single
search result from vector search.
- Tool - Tool integration namespace.
Classes:
- SQ - Simple SQL builder for GObject values.
Classes:
- Database - Manages SQLite database connections with in-
memory storage and file backup.
- Query - A generic SQL query builder for GObject-based types.
- Schema - Represents the schema information for a database
table column.
Classes:
- TestAppBase - Base class for OLLMchat test
applications.
- VectorAppBase - Base class for OLLMchat vector
applications (index and search).