Class: LLM::Hanzo

Inherits:
OpenAI show all
Defined in:
lib/llm/providers/hanzo.rb

Overview

The Hanzo class implements a provider for hanzo.ai through its OpenAI-compatible chat completions API.

Examples:

#!/usr/bin/env ruby
require "llm"

llm   = LLM.hanzo
agent = LLM::Agent.new(llm)
agent.talk "hello world", stream: $stdout

Constant Summary collapse

HOST =
"api.hanzo.ai"
BASE_PATH =
"/v1"

Instance Method Summary collapse

Methods inherited from OpenAI

#adapt_function, #complete, #embed, #models, #server_tools, #web_search

Methods inherited from Provider

#adapt_function, #assistant_role, #build_messages, #chat, #complete, #developer_role, #embed, #host, #inspect, #interrupt!, #key?, #models, #ocr, #port, #registry, #request_owner, #respond, #retry_budget, #retry_errors, #schema, #server_tool, #server_tools, #system_role, #tool_role, #tracer, #tracer=, #user_role, #web_search, #with, #with_tracer

Constructor Details

#initialize(host: HOST, base_path: BASE_PATH, port: 443, ssl: true) ⇒ LLM::Hanzo

Parameters:

  • key (String, nil) —

    The secret key for authentication

  • host (String) (defaults to: HOST) —

    The host address of the LLM provider

  • base_path (String) (defaults to: BASE_PATH) —

    Optional base path prefix for HTTP API routes.



27
28
29
# File 'lib/llm/providers/hanzo.rb', line 27

def initialize(host: HOST, base_path: BASE_PATH, port: 443, ssl: true, **)
  super
end

Instance Method Details

#default_model ⇒ String

Note:

The default is routed automatically by Hanzo. Without a paid plan, it defaults to enso-free.

Returns the default model for chat completions

Returns:

  • (String)

See Also:



81
82
83
# File 'lib/llm/providers/hanzo.rb', line 81

def default_model
  "enso-auto"
end

#name ⇒ Symbol

Returns the provider's name

Returns:

  • (Symbol)


34
35
36
# File 'lib/llm/providers/hanzo.rb', line 34

def name
  :hanzo
end

#files ⇒ Object

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/llm/providers/hanzo.rb', line 40

def files
  raise NotImplementedError
end

#images ⇒ Object

Raises:

  • (NotImplementedError)


46
47
48
# File 'lib/llm/providers/hanzo.rb', line 46

def images
  raise NotImplementedError
end

#audio ⇒ Object

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/llm/providers/hanzo.rb', line 52

def audio
  raise NotImplementedError
end

#moderations ⇒ Object

Raises:

  • (NotImplementedError)


58
59
60
# File 'lib/llm/providers/hanzo.rb', line 58

def moderations
  raise NotImplementedError
end

#responses ⇒ Object

Raises:

  • (NotImplementedError)


64
65
66
# File 'lib/llm/providers/hanzo.rb', line 64

def responses
  raise NotImplementedError
end

#vector_stores ⇒ Object

Raises:

  • (NotImplementedError)


70
71
72
# File 'lib/llm/providers/hanzo.rb', line 70

def vector_stores
  raise NotImplementedError
end