discourse-ai/spec/lib/personas/sql_helper_spec.rb
Roman Rizzi 30242a27e6
REFACTOR: Move personas into its own module. (#1233)
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`.
2025-03-31 14:42:33 -03:00

18 lines
500 B
Ruby

# frozen_string_literal: true
RSpec.describe DiscourseAi::Personas::SqlHelper do
let :sql_helper do
subject
end
it "renders schema" do
prompt = sql_helper.system_prompt
expect(prompt).to include("posts(")
expect(prompt).to include("topics(")
expect(prompt).not_to include("translation_key") # not a priority table
expect(prompt).to include("user_api_keys") # not a priority table
expect(sql_helper.tools).to eq([DiscourseAi::Personas::Tools::DbSchema])
end
end