2023-08-30 02:15:03 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
RSpec.describe DiscourseAi::AiBot::Personas::SqlHelper do
|
|
|
|
let :sql_helper do
|
|
|
|
subject
|
|
|
|
end
|
|
|
|
|
|
|
|
it "renders schema" do
|
2024-01-04 08:44:07 -05:00
|
|
|
prompt = sql_helper.system_prompt
|
2023-08-30 02:15:03 -04:00
|
|
|
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
|
|
|
|
|
2024-01-04 08:44:07 -05:00
|
|
|
expect(sql_helper.tools).to eq([DiscourseAi::AiBot::Tools::DbSchema])
|
2023-08-30 02:15:03 -04:00
|
|
|
end
|
|
|
|
end
|