Sha256: ce26c5056f2521892ace39668c471d6131a1195f0f4ee195afa7826e2117ffcb

Contents?: true

Size: 790 Bytes

Versions: 4

Compression:

Stored size: 790 Bytes

Contents

# extensions/omniai-localai.rb
# frozen_string_literal: true

require 'omniai'
require 'omniai/openai'

module OmniAI

  # Create an alias for OmniAI::OpenAI module
  module LocalAI
    extend OmniAI::OpenAI

    # Alias classes from OmniAI::OpenAI
    class Client < OmniAI::OpenAI::Client
      def initialize(**options)
        options[:host] = 'http://localhost:8080' unless options.has_key?(:host)
        super(**options)
      end
    end


    Config = OmniAI::OpenAI::Config

    # Alias the Thread class and its nested classes
    Thread      = OmniAI::OpenAI::Thread
    Annotation  = OmniAI::OpenAI::Thread::Annotation
    Attachment  = OmniAI::OpenAI::Thread::Attachment
    Message     = OmniAI::OpenAI::Thread::Message
    Run         = OmniAI::OpenAI::Thread::Run
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ai_client-0.2.2 lib/extensions/omniai-localai.rb
ai_client-0.2.1 lib/extensions/omniai-localai.rb
ai_client-0.2.0 lib/extensions/omniai-localai.rb
ai_client-0.1.0 lib/extensions/omniai-localai.rb