1
0
cms11/config/ai.php

64 lines
2.3 KiB
PHP

<?php
use App\Services\AI\AIHandler;
return [
/**
* Array of available providers to query, along with corresponding class
* handler
*/
'providers' => [
/**
* Open-webui provider, which uses ollama as backend
*/
'open-webui' => [
// Class handling the request
'handler' => App\Services\AI\Providers\Ollama::class,
// Base URL of the ollama API endpoint
'baseUrl' => env('OPENWEBUI_URL'),
// Specific headers, here we enable authorization
'headers' => [
'Authorization' => 'Bearer ' . env('OPENWEBUI_KEY'),
],
// Default options to apply to all outgoing requests. These options
// are taken from provider's API documentation, in this case ollama.
// They are all set when instanciating the provider and can be
// overriden afterwise
'options' => [
'stream' => false,
'keepalive' => 0,
],
// Services definitions
'services' => [
// Configuration for the image description service
AIHandler::SERVICE_DESCRIBE_IMAGE => [
// API endpoint
'endpoint' => '/generate',
// Prompt used to ask the provider for an image description
'prompt' => 'Describe this image in two sentences',
// We can ask to several models. We can also override
// options for a particular model
'models' => [
'llava',
'llava:13b',
'llava-llama3',
'bakllava',
],
],
// Configuration for the text summarization service
AIHandler::SERVICE_SUMMARIZE_CONTENT => [
// API endpoint
'endpoint' => '/generate',
// We can ask to several models. We can also override
// options for a particular model
'models' => [
'gemma',
'llama3',
],
],
],
],
],
];