discourse-ai/spec/lib/modules/ai_bot/anthropic_bot_spec.rb
Sam 4b0c077ce5
FEATURE: port to use claude-2 for chat bot (#114)
Claude 1 costs the same and is less good than Claude 2. Make use of Claude
2 in all spots ...

This also fixes streaming so it uses the far more efficient streaming protocol.
2023-07-27 11:24:44 +10:00

25 lines
617 B
Ruby

# frozen_string_literal: true
RSpec.describe DiscourseAi::AiBot::AnthropicBot do
describe "#update_with_delta" do
def bot_user
User.find(DiscourseAi::AiBot::EntryPoint::GPT4_ID)
end
subject { described_class.new(bot_user) }
describe "get_delta" do
it "can properly remove Assistant prefix" do
context = {}
reply = +""
reply << subject.get_delta({ completion: "Hello " }, context)
expect(reply).to eq("Hello ")
reply << subject.get_delta({ completion: "world" }, context)
expect(reply).to eq("Hello world")
end
end
end
end