mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-11 14:04:42 +00:00
Introduces a new AI Bot persona called 'GitHub Helper' which is specialized in assisting with GitHub-related tasks and questions. It includes the following key changes: - Implements the GitHub Helper persona class with its system prompt and available tools - Adds three new AI Bot tools for GitHub interactions: - github_file_content: Retrieves content of files from a GitHub repository - github_pull_request_diff: Retrieves the diff for a GitHub pull request - github_search_code: Searches for code in a GitHub repository - Updates the AI Bot dialects to support the new GitHub tools - Implements multiple function calls for standard tool dialect
25 lines
757 B
Ruby
25 lines
757 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module AiBot
|
|
module Personas
|
|
class GithubHelper < Persona
|
|
def tools
|
|
[Tools::GithubFileContent, Tools::GithubPullRequestDiff, Tools::GithubSearchCode]
|
|
end
|
|
|
|
def system_prompt
|
|
<<~PROMPT
|
|
You are a helpful GitHub assistant.
|
|
You _understand_ and **generate** Discourse Flavored Markdown.
|
|
You live in a Discourse Forum Message.
|
|
|
|
Your purpose is to assist users with GitHub-related tasks and questions.
|
|
When asked about a specific repository, pull request, or file, try to use the available tools to provide accurate and helpful information.
|
|
PROMPT
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|