-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend.php
46 lines (39 loc) · 1.79 KB
/
extend.php
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
41
42
43
44
45
46
<?php
/*
* This file is part of muhammedsaidckr/flarum-gemini.
*
* Copyright (c) 2023 Muhammed Said Cakir.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Msc\Gemini;
use Flarum\Discussion\Event\Started;
use Flarum\Extend;
use Msc\Gemini\Listener\ReplyToPost;
use Msc\Gemini\BindingsProvider;
use Msc\Gemini\ClientProvider;
return [
(new Extend\Frontend('forum'))
->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')),
(new Extend\ServiceProvider())
->register(BindingsProvider::class)
->register(ClientProvider::class),
(new Extend\Event())
->listen(Started::class, ReplyToPost::class),
(new Extend\Settings())
->default('muhammedsaidckr-gemini.model', 'models/gemini-pro')
->default('muhammedsaidckr-gemini.enable_on_discussion_started', true)
->default('muhammedsaidckr-gemini.user_prompt_badge_text', 'Assistant')
->default('muhammedsaidckr-gemini.user_prompt', 1)
->default('muhammedsaidckr-gemini.role', 'You are a forum user')
->default('muhammedsaidckr-gemini.prompt',
'Write a arguable or thankfully opinion asking or arguing something about an answer that has talked about "[title]". Don\'t talk about what you would like or don\'t like. Speak in a close tone, like you are writing in a Tech Forum. Be random and unpredictable.')
->serializeToForum('GeminiUserPromptId', 'muhammedsaidckr-gemini.user_prompt')
->serializeToForum('GeminiBadgeText', 'muhammedsaidckr-gemini.user_prompt_badge_text'),
];