dolibarr  21.0.0-alpha
Public Member Functions | List of all members
Ai Class Reference

Class for AI. More...

Public Member Functions

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

Detailed Description

Class for AI.

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

Constructor & Destructor Documentation

◆ __construct()

Ai::__construct (   $db)


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.

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', ...)
mixed $response

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

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