Sha256: 3b3d7af7f9d371b8b2faf9129a33e094cc1822ff39021f34a8ed632c7c6f9664

Contents?: true

Size: 397 Bytes

Versions: 2

Compression:

Stored size: 397 Bytes

Contents

# frozen_string_literal: true

module Roseflow
  module OpenRouter
    class ModelRepository
      attr_reader :models

      delegate :each, :all, :first, :last, to: :models

      def initialize(provider)
        @provider = provider
        @models = provider.client.models
      end

      def find(name)
        @models.select { |model| model.name == name }.first
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roseflow-openrouter-0.2.0 lib/roseflow/open_router/model_repository.rb
roseflow-openrouter-0.1.0 lib/roseflow/open_router/model_repository.rb