mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-02 07:19:42 +00:00
* DEV: AI bot migration to the Llm pattern. We added tool and conversation context support to the Llm service in discourse-ai#366, meaning we met all the conditions to migrate this module. This PR migrates to the new pattern, meaning adding a new bot now requires minimal effort as long as the service supports it. On top of this, we introduce the concept of a "Playground" to separate the PM-specific bits from the completion, allowing us to use the bot in other contexts like chat in the future. Commands are called tools, and we simplified all the placeholder logic to perform updates in a single place, making the flow more one-wayish. * Followup fixes based on testing * Cleanup unused inference code * FIX: text-based tools could be in the middle of a sentence * GPT-4-turbo support * Use new LLM API
28 lines
639 B
Ruby
28 lines
639 B
Ruby
#frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module AiBot
|
|
module Personas
|
|
class Researcher < Persona
|
|
def tools
|
|
[Tools::Google]
|
|
end
|
|
|
|
def required_tools
|
|
[Tools::Google]
|
|
end
|
|
|
|
def system_prompt
|
|
<<~PROMPT
|
|
You are research bot. With access to the internet you can find information for users.
|
|
|
|
- You fully understand Discourse Markdown and generate it.
|
|
- When generating responses you always cite your sources.
|
|
- When possible you also quote the sources.
|
|
PROMPT
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|