Skip to content

Commit

Permalink
Allow choose which tags to generate the answers
Browse files Browse the repository at this point in the history
  • Loading branch information
datlechin committed Nov 28, 2023
1 parent 0ac7026 commit 891b019
Show file tree
Hide file tree
Showing 10 changed files with 573 additions and 71 deletions.
19 changes: 12 additions & 7 deletions extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,33 @@
namespace Datlechin\FlarumChatGPT;

use Datlechin\FlarumChatGPT\Access\DiscussionPolicy;
use Datlechin\FlarumChatGPT\Listener\PostChatGPTAnswer;
use Flarum\Discussion\Discussion;
use Flarum\Extend;
use Flarum\Discussion\Event\Started;
use Datlechin\FlarumChatGPT\Listener\PostChatGPTAnswer;
use Flarum\Extend;

return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js')
->css(__DIR__ . '/less/forum.less'),
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__.'/less/forum.less'),

(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js')
->css(__DIR__ . '/less/admin.less'),
new Extend\Locales(__DIR__ . '/locale'),
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/less/admin.less'),

new Extend\Locales(__DIR__.'/locale'),

(new Extend\Settings())
->default('datlechin-chatgpt.model', 'text-davinci-003')
->default('datlechin-chatgpt.enable_on_discussion_started', true)
->default('datlechin-chatgpt.max_tokens', 100)
->default('datlechin-chatgpt.user_prompt_badge_text', 'Assistant')
->serializeToForum('chatGptUserPromptId', 'datlechin-chatgpt.user_prompt')
->serializeToForum('chatGptBadgeText', 'datlechin-chatgpt.user_prompt_badge_text'),

(new Extend\Event())
->listen(Started::class, PostChatGPTAnswer::class),

(new Extend\Policy())
->modelPolicy(Discussion::class, DiscussionPolicy::class),
];
298 changes: 297 additions & 1 deletion js/dist/admin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/admin.js.map

Large diffs are not rendered by default.

152 changes: 151 additions & 1 deletion js/dist/forum.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 891b019

Please sign in to comment.