Sha256: a9f27cc628ef2894d74b39c542db532e124d388261829aa8db494650789ed9f3

Contents?: true

Size: 811 Bytes

Versions: 3

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'bedrock_runtime/payload_builders/cohere/command_light_text_v14'

RSpec.describe RubyAmazonBedrock::PayloadBuilders::Cohere::CommandLightTextV14 do
  let(:input) { 'example_input' }
  let(:options) { { key: 'value' } }
  let(:body) do
    {
      prompt: "#{input}:",
      max_tokens: 100,
      temperature: 0.8
    }.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[:model_id]).to eq('cohere.command-light-text-v14')
      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/cohere/command_light_text_v14_spec.rb
ruby-amazon-bedrock-0.2.0 spec/bedrock_runtime/payload_builders/cohere/command_light_text_v14_spec.rb
ruby-amazon-bedrock-0.1.1 spec/bedrock_runtime/payload_builders/cohere/command_light_text_v14_spec.rb