Class: Legion::Extensions::Mlx::Client

Inherits:
Object
  • Object
show all
Includes:
Helpers::Client, Runners::Chat, Runners::Completions, Runners::Embeddings, Runners::Models
Defined in:
lib/legion/extensions/mlx/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::Embeddings

#embed

Methods included from Runners::Models

#list_models

Methods included from Runners::Chat

#chat, #chat_stream

Methods included from Runners::Completions

#complete, #complete_stream

Constructor Details

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

Returns a new instance of Client.



21
22
23
# File 'lib/legion/extensions/mlx/client.rb', line 21

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

Instance Attribute Details

#optsObject (readonly)

Returns the value of attribute opts.



19
20
21
# File 'lib/legion/extensions/mlx/client.rb', line 19

def opts
  @opts
end

Instance Method Details

#client(**override) ⇒ Object



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

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

#streaming_client(**override) ⇒ Object



29
30
31
# File 'lib/legion/extensions/mlx/client.rb', line 29

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