mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-18 01:14:53 +00:00
1. New tool to easily find files (and default branch) in a Github repo 2. Improved read tool with clearer params and larger context * limit can totally mess up the richness semantic search adds, so include the results unconditionally.
30 lines
844 B
Ruby
30 lines
844 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module AiBot
|
|
module Personas
|
|
class GithubHelper < Persona
|
|
def tools
|
|
[
|
|
Tools::GithubFileContent,
|
|
Tools::GithubPullRequestDiff,
|
|
Tools::GithubSearchCode,
|
|
Tools::GithubSearchFiles,
|
|
]
|
|
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
|