mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-09 07:33:30 +00:00
This change moves all the personas code into its own module. We want to treat them as a building block features can built on top of, same as `Completions::Llm`. The code to title a message was moved from `Bot` to `Playground`.
22 lines
793 B
Ruby
22 lines
793 B
Ruby
#frozen_string_literal: true
|
|
|
|
RSpec.describe DiscourseAi::Personas::Tools::DbSchema do
|
|
fab!(:llm_model)
|
|
let(:bot_user) { DiscourseAi::AiBot::EntryPoint.find_user_from_model(llm_model.name) }
|
|
let(:llm) { DiscourseAi::Completions::Llm.proxy("custom:#{llm_model.id}") }
|
|
|
|
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
|