mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-19 18:04:51 +00:00
This splits out a bunch of code that used to live inside bots into a dedicated concept called a Persona. This allows us to start playing with multiple personas for the bot Ships with: artist - for making images sql helper - for helping with data explorer general - for everything and anything Also includes a few fixes that make the generic LLM function implementation more robust
18 lines
534 B
Ruby
18 lines
534 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe DiscourseAi::AiBot::Personas::SqlHelper do
|
|
let :sql_helper do
|
|
subject
|
|
end
|
|
|
|
it "renders schema" do
|
|
prompt = sql_helper.render_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.available_commands).to eq([DiscourseAi::AiBot::Commands::DbSchemaCommand])
|
|
end
|
|
end
|