Module: OllamaChat::Information
Defined Under Namespace
Modules: UserAgent
Instance Method Summary collapse
- #collection_stats ⇒ Object
- #display_chat_help ⇒ Object
- #info ⇒ Object
- #server_url ⇒ Object
- #server_version ⇒ Object
- #usage ⇒ Object
- #version ⇒ Object
Instance Method Details
#collection_stats ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ollama_chat/information.rb', line 19 def collection_stats STDOUT.puts <<~EOT Current Collection Name: #{bold{@documents.collection}} #Embeddings: #{@documents.size} #Tags: #{@documents..size} Tags: #{@documents.} EOT nil end |
#display_chat_help ⇒ Object
98 99 100 101 |
# File 'lib/ollama_chat/information.rb', line 98 def display_chat_help STDOUT.puts nil end |
#info ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/ollama_chat/information.rb', line 30 def info STDOUT.puts "Running ollama_chat version: #{bold(OllamaChat::VERSION)}" STDOUT.puts "Connected to ollama server version: #{bold(server_version)} on: #{bold(server_url)}" STDOUT.puts "Current conversation model is #{bold{@model}}." if @model_options.present? STDOUT.puts " Options: #{JSON.pretty_generate(@model_options).gsub(/(?<!\A)^/, ' ')}" end @embedding.show if @embedding.on? STDOUT.puts "Current embedding model is #{bold{@embedding_model}}" if @embedding_model_options.present? STDOUT.puts " Options: #{JSON.pretty_generate(@embedding_model_options).gsub(/(?<!\A)^/, ' ')}" end STDOUT.puts "Text splitter is #{bold{config..splitter.name}}." collection_stats end markdown.show stream.show think.show location.show voice.show if @voice.on? STDOUT.puts " Using voice #{bold{@current_voice}} to speak." end STDOUT.puts "Documents database cache is #{@documents.nil? ? 'n/a' : bold{@documents.cache.class}}" STDOUT.puts "Document policy for references in user text: #{bold{@document_policy}}" STDOUT.puts "Currently selected search engine is #{bold(search_engine)}." STDOUT.puts "Conversation length: #{bold(@messages.size.to_s)} message(s)." nil end |
#server_url ⇒ Object
135 136 137 |
# File 'lib/ollama_chat/information.rb', line 135 def server_url @server_url ||= ollama.base_url end |
#server_version ⇒ Object
131 132 133 |
# File 'lib/ollama_chat/information.rb', line 131 def server_version @server_version ||= ollama.version.version end |
#usage ⇒ Object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/ollama_chat/information.rb', line 103 def usage STDOUT.puts <<~EOT Usage: #{progname} [OPTIONS] -f CONFIG config file to read -u URL the ollama base url, OLLAMA_URL -m MODEL the ollama model to chat with, OLLAMA_CHAT_MODEL, ?selector -s SYSTEM the system prompt to use as a file, OLLAMA_CHAT_SYSTEM, ?selector -c CHAT a saved chat conversation to load -C COLLECTION name of the collection used in this conversation -D DOCUMENT load document and add to embeddings collection (multiple) -M use (empty) MemoryCache for this chat session -E disable embeddings for this chat session -S open a socket to receive input from ollama_chat_send -V display the current version number and quit -h this help Use `?selector` with `-m` or `-s` to filter options. Multiple matches will open a chooser dialog. EOT 0 end |
#version ⇒ Object
126 127 128 129 |
# File 'lib/ollama_chat/information.rb', line 126 def version STDOUT.puts "%s %s" % [ progname, OllamaChat::VERSION ] 0 end |