Sha256: 7c032d6fb1ce572422c59ff40119414f56e2d6e82d2986c9f3cfbad95b9bc958

Contents?: true

Size: 715 Bytes

Versions: 3

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'bedrock_runtime/payload_builders/meta/base'

RSpec.describe RubyAmazonBedrock::PayloadBuilders::Meta::Base do
  let(:input) { 'example_input' }
  let(:options) { { key: 'value' } }
  let(:body) do
    {
      prompt: input,
      max_gen_len: 512,
      temperature: 0.2,
      top_p: 0.9
    }.to_json
  end

  describe '#build' do
    it 'returns a hash with the expected structure' do
      payload_builder = described_class.new(input, options)
      payload = payload_builder.build

      expect(payload[:content_type]).to eq('application/json')
      expect(payload[:accept]).to eq('*/*')
      expect(payload[:body]).to eq(body)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-amazon-bedrock-0.2.1 spec/bedrock_runtime/payload_builders/meta/base_spec.rb
ruby-amazon-bedrock-0.2.0 spec/bedrock_runtime/payload_builders/meta/base_spec.rb
ruby-amazon-bedrock-0.1.1 spec/bedrock_runtime/payload_builders/meta/base_spec.rb