Sha256: bb6fdec2d6685ec02bbd7b4cc371df0094c60e632645bf573c1c73ab6102502a

Contents?: true

Size: 659 Bytes

Versions: 3

Compression:

Stored size: 659 Bytes

Contents

require 'zeitwerk'
require 'durable/llm/providers'

module Durable
  module Llm
    class Client
      attr_reader :provider

      def initialize(provider_name, options = {})
        provider_class = Durable::Llm::Providers.const_get(provider_name.to_s.capitalize)

        @provider = provider_class.new(**options)
      end

      def completion(params = {})
        @provider.completion(params)
      end

      def chat(params = {})
        @provider.chat(params)
      end

      def embed(params = {})
        @provider.embed(params)
      end

      def stream(params = {}, &block)
        @provider.stream(params, &block)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
durable-llm-0.1.2 lib/durable/llm/client.rb
durable-llm-0.1.1 lib/durable/llm/client.rb
durable-llm-0.1.0 lib/durable/llm/client.rb