Files
discourse-ai/spec/lib/modules/ai_bot/tools/db_schema_spec.rb
T
Roman Rizzi 8d5f901a67 DEV: Rewire AI bot internals to use LlmModel (#638)
* DRAFT: Create AI Bot users dynamically and support custom LlmModels

* Get user associated to llm_model

* Track enabled bots with attribute

* Don't store bot username. Minor touches to migrate default values in settings

* Handle scenario where vLLM uses a SRV record

* Made 3.5-turbo-16k the default version so we can remove hack
2024-06-18 14:32:14 -03:00

21 lines
771 B
Ruby

#frozen_string_literal: true
RSpec.describe DiscourseAi::AiBot::Tools::DbSchema do
let(:bot_user) { DiscourseAi::AiBot::EntryPoint.find_user_from_model("gpt-3.5-turbo") }
let(:llm) { DiscourseAi::Completions::Llm.proxy("open_ai:gpt-3.5-turbo") }
before { SiteSetting.ai_bot_enabled = true }
describe "#process" do
it "returns rich schema for tables" do
result = described_class.new({ tables: "posts,topics" }, bot_user: bot_user, llm: llm).invoke
expect(result[:schema_info]).to include("raw text")
expect(result[:schema_info]).to include("views integer")
expect(result[:schema_info]).to include("posts")
expect(result[:schema_info]).to include("topics")
expect(result[:tables]).to eq("posts,topics")
end
end
end