/** Datei: plugins/openai/library/ARUNOX/API/OpenAI/Chat/Messages.php **/ * @copyright 2023 Sparky@ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\API\OpenAI\Chat; use ARUNOX\API; class Messages { /* ### VARIABLES ################################################ # */ protected static $HEADER = [], $URL = "/chat/completions"; /* ### PUBLIC FUNCTIONS ######################################### # */ public static function list( string $completion_id, array $args = [] ) { return API\OpenAI::get( static::$URL . "/{$completion_id}/messages", $args, static::$HEADER ); } /* ### PROTECTED FUNCTIONS ###################################### # */ /* ### PRIVATE FUNCTIONS ######################################## # */ /* ### MAGIC FUNCTIONS ########################################## # */ } /** Datei: plugins/openai/library/ARUNOX/API/OpenAI/Chat/Completions.php **/ * @copyright 2023 Sparky@ARUNOX * @version 1.0.0 * @since 1.0.0 File is created */ namespace ARUNOX\API\OpenAI\Chat; use ARUNOX\API; class Completions { /* ### VARIABLES ################################################ # */ protected static $HEADER = [], $URL = "/chat/completions"; /* ### PUBLIC FUNCTIONS ######################################### # */ public static function list( ?array $args = [] ) { return API\OpenAI::get( static::$URL, $args, static::$HEADER ); } public static function create( array $args ) { return API\OpenAI::post( static::$URL, $args, static::$HEADER ); } public static function get( string $completion_id ) { return API\OpenAI::get( static::$URL . "/{$completion_id}", [], static::$HEADER ); } public static function modify( string $completion_id, ?array $args = [] ) { return API\OpenAI::post( static::$URL . "/{$completion_id}", $args, static::$HEADER ); } public static function delete( string $completion_id ) { return API\OpenAI::delete( static::$URL . "/{$completion_id}", [], static::$HEADER ); } /* ### PROTECTED FUNCTIONS ###################################### # */ /* ### PRIVATE FUNCTIONS ######################################## # */ /* ### MAGIC FUNCTIONS ########################################## # */ }