Class: Legion::Extensions::Llamacpp::Client

Inherits:
Object
  • Object
show all
Includes:
Helpers::Client, Runners::Chat, Runners::Completions, Runners::Embeddings, Runners::Health, Runners::Models, Runners::Slots, Runners::Tokenize
Defined in:
lib/legion/extensions/llamacpp/client.rb

Constant Summary

Constants included from Helpers::Client

Helpers::Client::DEFAULT_HOST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Runners::Slots

#erase_slot, #list_slots

Methods included from Runners::Tokenize

#detokenize, #tokenize

Methods included from Runners::Health

#health

Methods included from Runners::Models

#list_models

Methods included from Runners::Embeddings

#embed

Methods included from Runners::Completions

#complete, #complete_stream

Methods included from Runners::Chat

#chat, #chat_stream

Constructor Details

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

Returns a new instance of Client.



27
28
29
# File 'lib/legion/extensions/llamacpp/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/llamacpp/client.rb', line 25

def opts
  @opts
end

Instance Method Details

#client(**override) ⇒ Object



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

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

#streaming_client(**override) ⇒ Object



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

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