-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
40 lines (36 loc) · 1.61 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Redmine::Plugin.register :redmine_ai_summary do
name 'Redmine AI Summary Plugin'
author 'Tolga Uzun'
description 'A plugin for generating AI summaries on issues.'
version '0.0.1'
url 'https://github.com/tuzumkuru/redmine_ai_summary'
author_url 'https://github.com/tuzumkuru'
requires_redmine :version_or_higher => '5.0.0'
# Plugin settings
settings default: {
'auto_generate' => false,
'api_address' => 'https://api.openai.com',
'api_key' => '',
'api_version' => 'v1',
'model' => 'gpt-4o-mini',
'system_prompt' => 'You are a Redmine Issue Summary Agent. Your job is to summarize issues given to you.
Each issue has the following information:
- subject: The title of the issue.
- description: A detailed explanation of the issue.
- changes: A list of updates made to the issue, including what was done and when.
- notes: Comments and messages about the issue.
Please summarize the issue in a short paragraph using simple language that anyone can understand.
Additionally, you are welcome to use bullet points.
Do not repeat info like subject etc.
Also, make sure to summarize in the original language of the issue - do not translate it.',
'max_tokens' => 1000
}, partial: 'settings/ai_summary_settings'
project_module :issue_tracking do |issue_tracking|
issue_tracking.permission :generate_issue_summary, { ai_summaries: [:create] },
public: false,
read_component: :issues
end
# Load patches and hooks
require_dependency File.expand_path('lib/redmine_ai_summary/patches/issue_patch', __dir__)
require_dependency File.expand_path('lib/redmine_ai_summary/hooks', __dir__)
end