Module: OllamaChat

Defined in:
lib/ollama_chat.rb,
lib/ollama_chat/version.rb,
lib/ollama_chat/env_config.rb,
lib/ollama_chat/redis_cache.rb,
lib/ollama_chat/tools/get_time.rb

Overview

get_time.rb – a tool that returns the current time as an ISO8601 string.

This file mirrors the structure of get_location.rb and can be dropped into the ‘lib/ollama_chat/tools` directory. The tool is registered with the Ollama tool‑calling system and can be invoked by name `get_time`.

Usage in a chat session:

ollama_chat.run('get_time')
# => "{\"time\":\"2026-02-09T14:32:00+01:00\"}"

The implementation is intentionally lightweight – it simply calls ‘Time.now.iso8601` and serialises the result as JSON.

Defined Under Namespace

Modules: Clipboard, Conversation, Dialog, DocumentCache, EnvConfig, History, Information, InputContent, KramdownANSI, LocationHandling, MessageEditing, MessageFormat, MessageOutput, ModelHandling, Parsing, ServerSocket, SourceFetching, StateSelectors, Switches, ThinkControl, ToolCalling, Tools, Utils, WebSearching Classes: Chat, ConfigMissingError, FollowChat, InvalidPathError, MessageList, OllamaChatConfig, OllamaChatError, RedisCache, Vim

Constant Summary collapse

VERSION =

OllamaChat version

'0.0.66'
VERSION_ARRAY =

:nodoc:

VERSION.split('.').map(&:to_i)
VERSION_MAJOR =

:nodoc:

VERSION_ARRAY[0]
VERSION_MINOR =

:nodoc:

VERSION_ARRAY[1]
VERSION_BUILD =

:nodoc:

VERSION_ARRAY[2]