dolibarr 20.0.2
Ai Class Reference

Class for AI. More...

Public Member Functions

 __construct ($db)
 Constructor.
 
 generateContent ($instructions, $model='auto', $function='textgeneration', $format='')
 Generate response of instructions.
 

Detailed Description

Class for AI.

Definition at line 33 of file ai.class.php.

Constructor & Destructor Documentation

◆ __construct()

Ai::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 62 of file ai.class.php.

References getDolGlobalString().

Member Function Documentation

◆ generateContent()

Ai::generateContent ( $instructions,
$model = 'auto',
$function = 'textgeneration',
$format = '' )

Generate response of instructions.

Parameters
string$instructionsInstruction to generate content
string$modelModel name ('gpt-3.5-turbo', 'gpt-4-turbo', 'dall-e-3', ...)
string$functionCode of the feature we want to use ('textgeneration', 'transcription', 'audiotext', 'imagegeneration', 'translation')
string$formatFormat for output ('', 'html', ...)
Returns
mixed $response

Definition at line 80 of file ai.class.php.

References dol_nl2br(), dol_syslog(), dol_textishtml(), getDolGlobalString(), and getURLContent().


The documentation for this class was generated from the following file: