Sha256: 85be2faf6c9aafd12e585025e2a260172247340ffb37eda9604ba27d9c0f436b

Contents?: true

Size: 628 Bytes

Versions: 1

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

require "dry/struct"
require "active_support/core_ext/module/delegation"

module Types
  include Dry.Types()
end

module Roseflow
  module OpenRouter
    class Model
      attr_reader :name, :id, :context_length

      def initialize(model, provider)
        @model_ = model
        @provider_ = provider
        assign_attributes
      end

      def max_tokens
        @context_length
      end

      private

      def assign_attributes
        @name = @model_.fetch("id")
        @id = @model_.fetch("id")
        @context_length = @model_.fetch("context_length")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
roseflow-openrouter-0.1.0 lib/roseflow/open_router/model.rb