mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-10 13:34:47 +00:00
* Well, it was quite a journey but now tools have "context" which can be critical for the stuff they generate This entire change was so Dall E and Artist generate images in the correct context * FIX: improve error handling around image generation - also corrects image markdown and clarifies code * fix spec
21 lines
761 B
Ruby
21 lines
761 B
Ruby
#frozen_string_literal: true
|
|
|
|
RSpec.describe DiscourseAi::AiBot::Tools::DbSchema do
|
|
let(:bot_user) { User.find(DiscourseAi::AiBot::EntryPoint::GPT3_5_TURBO_ID) }
|
|
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
|