-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.config.php
More file actions
74 lines (71 loc) · 2.4 KB
/
Copy pathmodule.config.php
File metadata and controls
74 lines (71 loc) · 2.4 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
use Laminas\Di\Container\AutowireFactory;
use Laminas\Mvc\Middleware\PipeSpec;
use Monarc\Copilot\Controller;
use Monarc\Copilot\Factory\AnrCopilotServiceFactory;
use Monarc\Copilot\Factory\OllamaClientFactory;
use Monarc\Copilot\Service\AnrCopilotService;
use Monarc\Copilot\Service\Copilot\CopilotKnowledgeBase;
use Monarc\Copilot\Service\Copilot\OllamaClient;
use Monarc\FrontOffice\Entity\UserRole as EntityUserRole;
use Monarc\FrontOffice\Middleware\AnrValidationMiddleware;
return [
'copilot' => [
'maxRecommendations' => 3,
'maxSources' => 6,
'ollama' => [
'enabled' => true,
'transport' => 'openai-chat',
'baseUrl' => 'http://127.0.0.1:4000',
'endpointPath' => '/chat/completions',
'model' => 'llama-70b',
'apiKey' => '',
'jsonMode' => true,
'timeout' => 20,
],
],
'router' => [
'routes' => [
'monarc_api_global_client_anr' => [
'child_routes' => [
'copilot' => [
'type' => 'literal',
'options' => [
'route' => 'copilot',
'defaults' => [
'controller' => PipeSpec::class,
'middleware' => new PipeSpec(
AnrValidationMiddleware::class,
Controller\ApiAnrCopilotController::class,
),
],
],
],
],
],
],
],
'controllers' => [
'factories' => [
Controller\ApiAnrCopilotController::class => AutowireFactory::class,
],
],
'service_manager' => [
'factories' => [
AnrCopilotService::class => AnrCopilotServiceFactory::class,
CopilotKnowledgeBase::class => AutowireFactory::class,
OllamaClient::class => OllamaClientFactory::class,
],
],
'roles' => [
EntityUserRole::SUPER_ADMIN_FO => [
'monarc_api_global_client_anr/copilot',
],
EntityUserRole::USER_FO => [
'monarc_api_global_client_anr/copilot',
],
EntityUserRole::USER_ROLE_CEO => [
'monarc_api_global_client_anr/copilot',
],
],
];