Class: Legion::Extensions::Ollama::Client

Inherits:
Object
  • Object
show all
Includes:
Helpers::Client, Runners::Blobs, Runners::Chat, Runners::Completions, Runners::Embeddings, Runners::Models, Runners::S3Models, Runners::Version
Defined in:
lib/legion/extensions/ollama/client.rb

Constant Summary

Constants included from Helpers::Client

Helpers::Client::DEFAULT_HOST

Constants included from Runners::S3Models

Runners::S3Models::OLLAMA_REGISTRY_PREFIX

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Runners::Version

#server_version

Methods included from Runners::S3Models

#import_default_models, #import_from_s3, #list_s3_models, #sync_from_s3

Methods included from Runners::Blobs

#check_blob, #push_blob

Methods included from Runners::Embeddings

#embed

Methods included from Runners::Models

#copy_model, #create_model, #delete_model, #list_models, #list_running, #pull_model, #push_model, #show_model

Methods included from Runners::Chat

#chat, #chat_stream

Methods included from Runners::Completions

#generate, #generate_stream

Constructor Details

#initialize(host: Helpers::Client::DEFAULT_HOST) ⇒ Client

Returns a new instance of Client.



27
28
29
# File 'lib/legion/extensions/ollama/client.rb', line 27

def initialize(host: Helpers::Client::DEFAULT_HOST, **)
  @opts = { host: host }.compact
end

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



25
26
27
# File 'lib/legion/extensions/ollama/client.rb', line 25

def opts
  @opts
end

Instance Method Details

#client(**override) ⇒ Object



31
32
33
# File 'lib/legion/extensions/ollama/client.rb', line 31

def client(**override)
  super(**@opts, **override)
end

#streaming_client(**override) ⇒ Object



35
36
37
# File 'lib/legion/extensions/ollama/client.rb', line 35

def streaming_client(**override)
  super(**@opts, **override)
end