Sha256: 74706f2ef3f06a84510a1ec0761b73eb60a78c2c25d225350da7de3b858a2482

Contents?: true

Size: 747 Bytes

Versions: 3

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'bedrock_runtime/payload_builders/anthropic/base'

RSpec.describe RubyAmazonBedrock::PayloadBuilders::Anthropic::Base do
  let(:prompt) { 'example_prompt' }
  let(:options) { {} }
  let(:body) do
    {
      prompt: "\n\nHuman: #{prompt}\n\nAssistant:",
      max_tokens_to_sample: 200,
      temperature: 0.5,
      top_k: 250,
      top_p: 1,
      stop_sequences: [
        '\n\nHuman'
      ],
      anthropic_version: 'bedrock-2023-05-31'
    }.to_json
  end

  describe '#build' do
    it_should_behave_like 'a payload builder'

    context 'with custom parameters' do
      include_context 'anthropic parameters'
      it_should_behave_like 'a payload builder'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby-amazon-bedrock-0.2.4 spec/bedrock_runtime/payload_builders/anthropic/base_spec.rb
ruby-amazon-bedrock-0.2.3 spec/bedrock_runtime/payload_builders/anthropic/base_spec.rb
ruby-amazon-bedrock-0.2.2 spec/bedrock_runtime/payload_builders/anthropic/base_spec.rb