File [extends \platform\openAi] - (platform\openAi\file.class.php)

static platform\openAi\file::createFile ($string $object $file = null, $integer $purpose = 'user_data')
$file enthält die Datei als string oder new file() Objekt
$purpose enthält die Angabe für den gebrauch der Datei, siehe platform\openAi::FILEPURPOSE
https://platform.openai.com/docs/api-reference/files/create

lädt eine Datei hoch
platform\openAi\file::createFile('Anleitung.pdf', 'user_data');

platform\openAi\file::createFile(new file('Anleitung.pdf'), 'user_data');
static platform\openAi\file::isFileId ($string $fileId = null)
$fileId enthält die Datei-ID
prüft ob der string eine Datei-ID ist und gibt true zurück; ansonsten false
platform\openAi\file::isFileId('file-aia75zFVocj5R4TaKxy3xLfN');
static platform\openAi\file::fileIdExists ($string $fileId = null)
$fileId enthält die Datei-ID
prüft ob die Datei-ID existiert und gibt true zurück; ansonsten false
platform\openAi\file::fileIdExists('file-aia75zFVocj5R4TaKxy3xLfN');
static platform\openAi\file::getFileList ([$array $options = null])
$options optional; Query:
[
  'purpose' => null, // string, siehe platform\openAi::FILEPURPOSE
  'limit' => null, // integer, maximale Dateien die aufgelistet werden sollen
  'order' => null, // string, Sortierung 'created_at', 'asc' oder 'desc'
  'after' => null, // string, ID der Datei
]
https://platform.openai.com/docs/api-reference/files/list

listet alle Datein auf; im Fehlerfall null
platform\openAi\file::getFileList();
static platform\openAi\file::getFile ($string $fileId = null)
$fileId enthält die Datei-ID
https://platform.openai.com/docs/api-reference/files/retrieve

enthält alle Daten einer Datei; im Fehlerfall null
platform\openAi\file::getFile('file-aia75zFVocj5R4TaKxy3xLfN');
static platform\openAi\file::getFileContent ($string $fileId = null)
$fileId enthält die Datei-ID
https://platform.openai.com/docs/api-reference/files/retrieve-contents

überträgt den Inhalt der Datei; im Fehlerfall null
platform\openAi\file::getFileContent('file-aia75zFVocj5R4TaKxy3xLfN');
static platform\openAi\file::deleteFile ($string $fileId = null)
$fileId enthält die Datei-ID
https://platform.openai.com/docs/api-reference/files/delete

löscht eine Datei
platform\openAi\file::deleteFile('file-aia75zFVocj5R4TaKxy3xLfN');