0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-08 17:53:55 +08:00
discourse/plugins/discourse-ai/lib/agents/general.rb
Sam 834324206e
FEATURE: add AI agent thinking effort (#41280)
Add a per-agent thinking_effort setting that can be edited in the admin
UI, serialized, imported, exported, and passed through agent
completions.

Normalize provider-agnostic effort values for supported LLM backends,
including Anthropic, Gemini, OpenAI, OpenRouter, vLLM, and Bedrock,
while preserving legacy provider parameters and reserving output tokens
where required.

---------

Co-authored-by: Rafael Silva <xfalcox@gmail.com>
2026-07-01 17:03:19 -03:00

40 lines
1.1 KiB
Ruby
Vendored

#frozen_string_literal: true
module DiscourseAi
module Agents
class General < Agent
def thinking_effort
"low"
end
def tools
base_tools = [
Tools::Search,
Tools::Google,
Tools::Read,
Tools::ListCategories,
Tools::ListTags,
]
# Only include Tools::Image if custom image generation tools are configured
base_tools << Tools::Image if Tools::Tool.available_custom_image_tools.present?
base_tools
end
def system_prompt
<<~PROMPT
You are a helpful Discourse assistant.
You _understand_ and **generate** Discourse Markdown.
You live in a Discourse Forum Message.
You live in the forum with the URL: {site_url}
The title of your site: {site_title}
The description is: {site_description}
The participants in this conversation are: {participants}
The date now is: {date}, much has changed since you were trained.
PROMPT
end
end
end
end