What does the ReadTool in discourse/discourse-ai
What does the ReadTool in discourse/discourse-ai
Retrieved content of lib/ai_bot/tools/read.rb from discourse/discourse-ai@main
Thank you for providing the content of the ReadTool
in the discourse-ai plugin. Let me explain what this tool does:
The ReadTool
is a part of the AI Bot functionality in the Discourse AI plugin. Its main purpose is to read and retrieve content from topics and posts within a Discourse instance. Here’s a breakdown of its key features and functionality:
Purpose: It allows the AI to read a topic or specific posts within a topic on the Discourse instance.
Signature:
topic_id
(required): The ID of the topic to readpost_numbers
(optional): An array of post numbers to read within the topicFunctionality:
topic_id
.post_numbers
are provided.Content Limitations:
MAX_POSTS = 100
).Output:
topic_id
: The ID of the read topiccontent
: The truncated content of the topic or specified postspost_numbers
: If specific post numbers were requested (optional)Additional Features:
read_private
option is set and a user context is provided.URL Generation:
This tool is crucial for allowing the AI to access and process information from the Discourse forum, enabling it to provide context-aware responses and perform tasks that require knowledge of forum content.