fjffk简å�•的咖啡店科开å�‘2方法2 环æ»�皆山也。其西å�—诸峰,林壑尤美,望之蔚然而深秀者,ç�…ç�Šä¹Ÿã€‚山行六七里,æ¸�闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  Â¥2" ÿÄ     ÿÄ J    ! 1AQ"aqÂ�2‘#BR‚¡Ã�Ñ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3Â�±ð#b¡ÿÚ   ? ¼QxJQaÃ�uò¸Zö Úü8,Ã�Úú "SSn<rçù–´âE—^ªBÖ9À\†¸Â�ÔÂ�Ã�T­ÃÛ5 ëd´³Ã�#Ã�;Þ38ϔÂ� ¶H£M:wÃŽ3…³…âpÔF&‚FK¸9„â4àGEõªfÂ�ÿ ‘ñ(ßw­pŽF|È¥ù®häðÃ�Ѷ¹‘[Ã’inÙW¶ùñYËœQ{›K"išÒ[Ú8žë\F¹@-?v"ÔUâ€�,ìöžkÿ {I‡£šÃ�?e rÂ�íV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dsdfsrc/ValueObjects/ResourceUri.php000064400000004303152665621660012720 0ustar00uri; } } src/ValueObjects/Transporter/Headers.php000064400000004224152665621660014351 0ustar00 $headers */ private function __construct(private readonly array $headers) { // .. } /** * Creates a new Headers value object */ public static function create(): self { return new self([]); } /** * Creates a new Headers value object with the given API token. */ public static function withAuthorization(ApiKey $apiKey): self { return new self([ 'Authorization' => "Bearer {$apiKey->toString()}", ]); } /** * Creates a new Headers value object, with the given content type, and the existing headers. */ public function withContentType(ContentType $contentType, string $suffix = ''): self { return new self([ ...$this->headers, 'Content-Type' => $contentType->value . $suffix, ]); } /** * Creates a new Headers value object, with the given organization, and the existing headers. */ public function withOrganization(string $organization): self { return new self([ ...$this->headers, 'OpenAI-Organization' => $organization, ]); } /** * Creates a new Headers value object, with the given project, and the existing headers. */ public function withProject(string $project): self { return new self([ ...$this->headers, 'OpenAI-Project' => $project, ]); } /** * Creates a new Headers value object, with the newly added header, and the existing headers. */ public function withCustomHeader(string $name, string $value): self { return new self([ ...$this->headers, $name => $value, ]); } /** * @return array $headers */ public function toArray(): array { return $this->headers; } } src/ValueObjects/Transporter/Response.php000064400000002270152665621660014573 0ustar00> $headers * * @return Response */ public static function from(array|string $data, array $headers): self { // @phpstan-ignore-next-line $meta = MetaInformation::from($headers); return new self($data, $meta); } /** * Returns the response data. * * @return TData */ public function data(): array|string { return $this->data; } /** * Returns the meta information. */ public function meta(): MetaInformation { return $this->meta; } } src/ValueObjects/Transporter/QueryParams.php000064400000001626152665621660015252 0ustar00 $params */ private function __construct(private readonly array $params) { // .. } /** * Creates a new Query Params value object */ public static function create(): self { return new self([]); } /** * Creates a new Query Params value object, with the newly added param, and the existing params. */ public function withParam(string $name, string|int $value): self { return new self([ ...$this->params, $name => $value, ]); } /** * @return array */ public function toArray(): array { return $this->params; } } src/ValueObjects/Transporter/Payload.php000064400000014240152665621660014366 0ustar00 $parameters */ private function __construct( private readonly ContentType $contentType, private readonly Method $method, private readonly ResourceUri $uri, private readonly array $parameters = [], ) { // .. } /** * Creates a new Payload value object from the given parameters. * * @param array $parameters */ public static function list(string $resource, array $parameters = []): self { $contentType = ContentType::JSON; $method = Method::GET; $uri = ResourceUri::list($resource); return new self($contentType, $method, $uri, $parameters); } /** * Creates a new Payload value object from the given parameters. * * @param array $parameters */ public static function retrieve(string $resource, string $id, string $suffix = '', array $parameters = []): self { $contentType = ContentType::JSON; $method = Method::GET; $uri = ResourceUri::retrieve($resource, $id, $suffix); return new self($contentType, $method, $uri, $parameters); } /** * Creates a new Payload value object from the given parameters. * * @param array $parameters */ public static function modify(string $resource, string $id, array $parameters = []): self { $contentType = ContentType::JSON; $method = Method::POST; $uri = ResourceUri::modify($resource, $id); return new self($contentType, $method, $uri, $parameters); } /** * Creates a new Payload value object from the given parameters. */ public static function retrieveContent(string $resource, string $id): self { $contentType = ContentType::JSON; $method = Method::GET; $uri = ResourceUri::retrieveContent($resource, $id); return new self($contentType, $method, $uri); } /** * Creates a new Payload value object from the given parameters. * * @param array $parameters */ public static function create(string $resource, array $parameters): self { $contentType = ContentType::JSON; $method = Method::POST; $uri = ResourceUri::create($resource); return new self($contentType, $method, $uri, $parameters); } /** * Creates a new Payload value object from the given parameters. * * @param array $parameters */ public static function upload(string $resource, array $parameters): self { $contentType = ContentType::MULTIPART; $method = Method::POST; $uri = ResourceUri::upload($resource); return new self($contentType, $method, $uri, $parameters); } /** * Creates a new Payload value object from the given parameters. */ public static function cancel(string $resource, string $id): self { $contentType = ContentType::JSON; $method = Method::POST; $uri = ResourceUri::cancel($resource, $id); return new self($contentType, $method, $uri); } /** * Creates a new Payload value object from the given parameters. */ public static function delete(string $resource, string $id): self { $contentType = ContentType::JSON; $method = Method::DELETE; $uri = ResourceUri::delete($resource, $id); return new self($contentType, $method, $uri); } /** * Creates a new Psr 7 Request instance. */ public function toRequest(BaseUri $baseUri, Headers $headers, QueryParams $queryParams): RequestInterface { $psr17Factory = new Psr17Factory; $body = null; $uri = $baseUri->toString() . $this->uri->toString(); $queryParams = $queryParams->toArray(); if ($this->method === Method::GET) { $queryParams = [...$queryParams, ...$this->parameters]; } if ($queryParams !== []) { $uri .= '?' . http_build_query($queryParams); } $headers = $headers->withContentType($this->contentType); if ($this->method === Method::POST) { if ($this->contentType === ContentType::MULTIPART) { $streamBuilder = new MultipartStreamBuilder($psr17Factory); /** @var array> $parameters */ $parameters = $this->parameters; foreach ($parameters as $key => $value) { if (is_int($value) || is_float($value) || is_bool($value)) { $value = (string) $value; } if (is_array($value)) { foreach ($value as $nestedValue) { $streamBuilder->addResource($key . '[]', $nestedValue); } continue; } $streamBuilder->addResource($key, $value); } $body = $streamBuilder->build(); $headers = $headers->withContentType($this->contentType, '; boundary=' . $streamBuilder->getBoundary()); } else { $body = $psr17Factory->createStream(json_encode($this->parameters, JSON_THROW_ON_ERROR|JSON_UNESCAPED_UNICODE)); } } $request = $psr17Factory->createRequest($this->method->value, $uri); if ($body instanceof StreamInterface) { $request = $request->withBody($body); } foreach ($headers->toArray() as $name => $value) { $request = $request->withHeader($name, $value); } return $request; } } src/ValueObjects/Transporter/BaseUri.php000064400000001477152665621660014337 0ustar00baseUri, $protocol)) { return "{$this->baseUri}/"; } } return "https://{$this->baseUri}/"; } } src/ValueObjects/ApiKey.php000064400000001051152665621660011630 0ustar00apiKey; } } src/Factory.php000064400000012055152665621660007475 0ustar00 */ private array $headers = []; /** * The query parameters for the requests. * * @var array */ private array $queryParams = []; private ?Closure $streamHandler = null; /** * Sets the API key for the requests. */ public function withApiKey(string $apiKey): self { $this->apiKey = trim($apiKey); return $this; } /** * Sets the organization for the requests. */ public function withOrganization(?string $organization): self { $this->organization = $organization; return $this; } /** * Sets the project for the requests. */ public function withProject(?string $project): self { $this->project = $project; return $this; } /** * Sets the HTTP client for the requests. * If no client is provided the factory will try to find one using PSR-18 HTTP Client Discovery. */ public function withHttpClient(ClientInterface $client): self { $this->httpClient = $client; return $this; } /** * Sets the stream handler for the requests. Not required when using Guzzle. */ public function withStreamHandler(Closure $streamHandler): self { $this->streamHandler = $streamHandler; return $this; } /** * Sets the base URI for the requests. * If no URI is provided the factory will use the default OpenAI API URI. */ public function withBaseUri(string $baseUri): self { $this->baseUri = $baseUri; return $this; } /** * Adds a custom HTTP header to the requests. */ public function withHttpHeader(string $name, string $value): self { $this->headers[$name] = $value; return $this; } /** * Adds a custom query parameter to the request url. */ public function withQueryParam(string $name, string $value): self { $this->queryParams[$name] = $value; return $this; } /** * Creates a new Open AI Client. */ public function make(): Client { $headers = Headers::create(); if ($this->apiKey !== null) { $headers = Headers::withAuthorization(ApiKey::from($this->apiKey)); } if ($this->organization !== null) { $headers = $headers->withOrganization($this->organization); } if ($this->project !== null) { $headers = $headers->withProject($this->project); } foreach ($this->headers as $name => $value) { $headers = $headers->withCustomHeader($name, $value); } $baseUri = BaseUri::from($this->baseUri ?: 'api.openai.com/v1'); $queryParams = QueryParams::create(); foreach ($this->queryParams as $name => $value) { $queryParams = $queryParams->withParam($name, $value); } $client = $this->httpClient ??= Psr18ClientDiscovery::find(); $sendAsync = $this->makeStreamHandler($client); $transporter = new HttpTransporter($client, $baseUri, $headers, $queryParams, $sendAsync); return new Client($transporter); } /** * Creates a new stream handler for "stream" requests. */ private function makeStreamHandler(ClientInterface $client): Closure { if (! is_null($this->streamHandler)) { return $this->streamHandler; } if ($client instanceof GuzzleClient) { return fn (RequestInterface $request): ResponseInterface => $client->send($request, ['stream' => true]); } if ($client instanceof Psr18Client) { // @phpstan-ignore-line return fn (RequestInterface $request): ResponseInterface => $client->sendRequest($request); // @phpstan-ignore-line } return function (RequestInterface $_): never { throw new Exception('To use stream requests you must provide an stream handler closure via the OpenAI factory.'); }; } } src/OpenAI.php000064400000001303152665621660007173 0ustar00withApiKey($apiKey) ->withOrganization($organization) ->withProject($project) ->withHttpHeader('OpenAI-Beta', 'assistants=v2') ->make(); } /** * Creates a new factory instance to configure a custom Open AI Client */ public static function factory(): Factory { return new Factory; } } src/Testing/Requests/TestRequest.php000064400000001025152665621660013601 0ustar00 $args */ public function __construct(protected string $resource, protected string $method, protected array $args) {} public function resource(): string { return $this->resource; } public function method(): string { return $this->method; } /** * @return array */ public function args(): array { return $this->args; } } src/Testing/ClientFake.php000064400000014070152665621660011507 0ustar00 */ private array $requests = []; /** * @param array $responses */ public function __construct(protected array $responses = []) {} /** * @param array $responses */ public function addResponses(array $responses): void { $this->responses = [...$this->responses, ...$responses]; } public function assertSent(string $resource, callable|int|null $callback = null): void { if (is_int($callback)) { $this->assertSentTimes($resource, $callback); return; } PHPUnit::assertTrue( $this->sent($resource, $callback) !== [], "The expected [{$resource}] request was not sent." ); } private function assertSentTimes(string $resource, int $times = 1): void { $count = count($this->sent($resource)); PHPUnit::assertSame( $times, $count, "The expected [{$resource}] resource was sent {$count} times instead of {$times} times." ); } /** * @return mixed[] */ private function sent(string $resource, ?callable $callback = null): array { if (! $this->hasSent($resource)) { return []; } $callback = $callback ?: fn (): bool => true; return array_filter($this->resourcesOf($resource), fn (TestRequest $resource) => $callback($resource->method(), ...$resource->args())); } private function hasSent(string $resource): bool { return $this->resourcesOf($resource) !== []; } public function assertNotSent(string $resource, ?callable $callback = null): void { PHPUnit::assertCount( 0, $this->sent($resource, $callback), "The unexpected [{$resource}] request was sent." ); } public function assertNothingSent(): void { $resourceNames = implode( separator: ', ', array: array_map(fn (TestRequest $request): string => $request->resource(), $this->requests) ); PHPUnit::assertEmpty($this->requests, 'The following requests were sent unexpectedly: ' . $resourceNames); } /** * @return array */ private function resourcesOf(string $type): array { return array_filter($this->requests, fn (TestRequest $request): bool => $request->resource() === $type); } public function record(TestRequest $request): ResponseContract|ResponseStreamContract|string { $this->requests[] = $request; $response = array_shift($this->responses); if (is_null($response)) { throw new Exception('No fake responses left.'); } if ($response instanceof Throwable) { throw $response; } return $response; } public function responses(): ResponsesTestResource { return new ResponsesTestResource($this); } public function realtime(): RealtimeTestResource { return new RealtimeTestResource($this); } public function completions(): CompletionsTestResource { return new CompletionsTestResource($this); } public function chat(): ChatTestResource { return new ChatTestResource($this); } public function embeddings(): EmbeddingsTestResource { return new EmbeddingsTestResource($this); } public function audio(): AudioTestResource { return new AudioTestResource($this); } public function edits(): EditsTestResource { return new EditsTestResource($this); } public function files(): FilesTestResource { return new FilesTestResource($this); } public function models(): ModelsTestResource { return new ModelsTestResource($this); } public function fineTunes(): FineTunesTestResource { return new FineTunesTestResource($this); } public function fineTuning(): FineTuningTestResource { return new FineTuningTestResource($this); } public function moderations(): ModerationsTestResource { return new ModerationsTestResource($this); } public function images(): ImagesTestResource { return new ImagesTestResource($this); } public function assistants(): AssistantsTestResource { return new AssistantsTestResource($this); } public function threads(): ThreadsTestResource { return new ThreadsTestResource($this); } public function batches(): BatchesTestResource { return new BatchesTestResource($this); } public function vectorStores(): VectorStoresContract { return new VectorStoresTestResource($this); } } src/Testing/Responses/Concerns/Fakeable.php000064400000003734152665621660014734 0ustar00 $override */ public static function fake(array $override = [], ?MetaInformation $meta = null): static { $class = str_replace('OpenAI\\Responses\\', 'OpenAI\\Testing\\Responses\\Fixtures\\', static::class) . 'Fixture'; return static::from( self::buildAttributes($class::ATTRIBUTES, $override), $meta ?? self::fakeResponseMetaInformation(), ); } /** * @return mixed[] */ private static function buildAttributes(array $original, array $override): array { $new = []; foreach ($original as $key => $entry) { $new[$key] = is_array($entry) ? self::buildAttributes($entry, $override[$key] ?? []) : $override[$key] ?? $entry; unset($override[$key]); } // we are going to append all remaining overrides foreach ($override as $key => $value) { $new[$key] = $value; } return $new; } public static function fakeResponseMetaInformation(): MetaInformation { return MetaInformation::from([ 'openai-model' => ['gpt-3.5-turbo-instruct'], 'openai-organization' => ['org-1234'], 'openai-processing-ms' => ['410'], 'openai-version' => ['2020-10-01'], 'x-ratelimit-limit-requests' => ['3000'], 'x-ratelimit-limit-tokens' => ['250000'], 'x-ratelimit-remaining-requests' => ['2999'], 'x-ratelimit-remaining-tokens' => ['249989'], 'x-ratelimit-reset-requests' => ['20ms'], 'x-ratelimit-reset-tokens' => ['2ms'], 'x-request-id' => ['3813fa4fa3f17bdf0d7654f0f49ebab4'], ]); } } src/Testing/Responses/Concerns/FakeableForStreamedResponse.php000064400000001524152665621660020602 0ustar00createStreamFromResource($resource); $response = Psr17FactoryDiscovery::findResponseFactory() ->createResponse() ->withBody($stream); return new StreamResponse(static::class, $response); } } src/Testing/Responses/Fixtures/Assistants/AssistantResponseFixture.php000064400000001243152665621660022465 0ustar00 'asst_SMzoVX8XmCZEg1EbMHoAm8tc', 'object' => 'assistant', 'created_at' => 1_699_619_403, 'name' => 'Math Tutor', 'description' => null, 'model' => 'gpt-4', 'instructions' => 'You are a personal math tutor.', 'tools' => [], 'tool_resources' => [], 'metadata' => [], 'temperature' => 0.7, 'top_p' => 1.0, 'response_format' => 'text', ]; } src/Testing/Responses/Fixtures/Assistants/AssistantListResponseFixture.php000064400000001764152665621660023331 0ustar00 'list', 'data' => [ [ 'id' => 'asst_SMzoVX8XmCZEg1EbMHoAm8tc', 'object' => 'assistant', 'created_at' => 1_699_619_403, 'name' => 'Math Tutor', 'description' => null, 'model' => 'gpt-4', 'instructions' => 'You are a personal math tutor.', 'tools' => [], 'tool_resources' => [], 'metadata' => [], 'temperature' => 0.7, 'top_p' => 1.0, 'response_format' => 'text', ], ], 'first_id' => 'asst_SMzoVX8XmCZEg1EbMHoAm8tc', 'last_id' => 'asst_SMzoVX8XmCZEg1EbMHoAm8tc', 'has_more' => false, ]; } src/Testing/Responses/Fixtures/Assistants/AssistantDeleteResponseFixture.php000064400000000421152665621660023605 0ustar00 'asst_SMzoVX8XmCZEg1EbMHoAm8tc', 'object' => 'assistant.deleted', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/Moderations/CreateResponseFixture.php000064400000003403152665621660022047 0ustar00 'modr-5MWoLO', 'model' => 'text-moderation-001', 'results' => [ [ 'categories' => [ 'hate' => false, 'hate/threatening' => true, 'harassment' => false, 'harassment/threatening' => false, 'self-harm' => false, 'self-harm/intent' => false, 'self-harm/instructions' => false, 'sexual' => false, 'sexual/minors' => false, 'violence' => true, 'violence/graphic' => false, ], 'category_scores' => [ 'hate' => 0.22714105248451233, 'hate/threatening' => 0.4132447838783264, 'harassment' => 0.1602763684674149, 'harassment/threatening' => 0.1602763684674149, 'self-harm' => 0.005232391878962517, 'self-harm/intent' => 0.005134391873962517, 'self-harm/instructions' => 0.005132591874962517, 'sexual' => 0.01407341007143259, 'sexual/minors' => 0.0038522258400917053, 'violence' => 0.9223177433013916, 'violence/graphic' => 0.036865197122097015, ], 'flagged' => true, ], ], ]; } src/Testing/Responses/Fixtures/Audio/speech-streamed.mp3000064400000153640152665621660017325 0ustar00ÿóäÄb<9¸YÀ6–3€US%s޳¾ó®3\°ÀÖÉŠ©ÃiëÉó™ÒØ)v|YC$s2ר:C–̳k<(Þç4¦z”!:$ ÐcÍÎ%\iȘê'±pa{<Ķ|!©†æŒ !q˾YrÍ  —ÓF/FÇa†(B"¢‚2È}Ûklí¯Ãôò·mv*EØâR»líÇŽ,:ÇgjfYó*Mi:†^m*ÏK&ÚÛ_£vØz™¡,¶e“,Ú?ÃIŽÛ²î�\K_ú8ÜÒä.àa: Ô$#äÒÒ峌Îs”R88؃ °ºbBl¸ênýÓ¾êÞZ³Î8@ÜÃ@‹á¬;/’"yeÀ!-—½ü-!h F�î½J¬ ׺ªJ;CZœ,‚ 9%«7@árŒÄ0‹¯û�ä;’ɶ¶ÎáäL3œÊ…0$ ˆ8[t]r9CùŒ?Ž\?oþ½¸âÂ-×\_9\7/”3¶¿<à%áw Àµ™lÓ*ÓÜvøv€Bb"ƒžr:y0Pa‚ŒšiÙ÷- Ê-˜È:ß2”“}M4³«JU…ÿlàmà 1„£R13ƒ¶o?V$* Ñ¡ð}ÿóäÄJy”:0›ØÎ‡FkTgŽìÒ~�ÃçÍtvKGz¦bElRfÌŠd� ÁÃ)Dq/KÐ}Öi†è„aBhLd¡†0Pb§aPƒ,è銌‰$„NýúYø8Ó€«��B q!1À!Šà1Ñ¢ê,ÀH¡„ @I€¥òçâ î`Ö È˜ÇHID�ÁC†(4 DL*á2…£Ù†�¿¦˜dÕX:ì–NJK³Ì¡’HÍ8èÄED(�bs @Œ˜Hªl¤ÆbD 3`32²£I01˜(tÀHA·ŸlË(ÔQ{öãÏB£†c¡i€,D`�ÊZ!/�`(``¥F@Hc4 1q=2¹‘AûqˆbqåQNßÂAn‘–CÆƆ_n( ²# -`yˆÄQ¨»©` 1Ñ´K/(ÁÀ.à0ÁÄ ËE²;èv,Š1 Š–Dª$©Qè ø±|‡*Hȸä0<)1üš1åt:Ò•:T¤4 r3Ä„8`…2”3Qá4Ψ2�ç1ðM28¡2tê&…ÿóäÄ6_\:NÝÈ�ò ÐÁ`N|‚fZõ³PP©É ÉC€a³Ä™�¦)¬š¥2¾;u=`”M:”¸(T&V÷…@UµDaˆ Â$(� �.r©È”ë”Ñ?KµaUÌ©þ‡¢Ô´ÞÿJëF¥øLÇ£ïú°*TŠ%AE� p \2Àç¡û­y¯Ý¥gí!ÉžLÆ–° M¶fb@‚D/S U­ºÕiÉj®\X̵Ù]™ë‘×eÉq_ØÎ1÷õ¬µÙlš††A”ü5Z4ךó:aÎíWeé†fyœjv4ý?Õ¥ÏóÌû3—¥x�ØÜ®’[KÅZt‘õ´ÑÙC†Ò–ª3Wí’¶ì­ê‡!ö)Ê]I=¸)Õ~¥÷b±˜6S |áOìË`Xzyº¶® ® x]·qȉ¸°ÌAèv㲨£[�¥Ž8�¼ ÿ5Øô<ùÃó¹C `?$a2žb’¨hj"  d·ƒ°b”d% ~` ‡ôa€Þ`æ Jcu `"…€a2�¼`.²`+rs@æ ži&BÐ4üZevHcãÀ óHe5€ÑaÛ0èÉ‘¤�Ú!Éê>aÙÉŠM‰´ÐtÓÍ88ã[Œ,(ØYÂÀÃ@Åå1ÿóäÄ‹w<9üþô”ÃG ±›plcšYŸÉ¤–B@ ý º»¶¹KQ¿v"�Ò¤„.‡×ÄUjKr€AÀav‹œÌ ÀC@B Dap`˜D$  `q` 0|%ðhÐ- Gò¨:˜L†%é0)€£@Ñ€ƒA•CAqÀ°ÂðxÀàc‚›Ê!ŠPè6c{ªvÿêqÊ^eá¼"ÌCƒÂ üÃÀlÄ€ôÅT40¼0`S100ˆW1„z2Tˆ1Ü`B" „ÃÅð,h£&YÿóäÄNsD:,­ÝØ4f’FZk¤æ¾Šr,çÆo¡fŠc¥frŠ”fŒÆœ,e†°„`&Úr4‚8T 0Ós1tX1€Ó1à@0¬ÐR̤,À€Œpp!X Œøx²‚ 2!£1�²A“?E2qT[&鉎˜èùqŒ4T&¢Æ »AÀê"\„0 X€e'À €çÈ@*c¡ñ‡@2"${Ü k½¯ÃWXšò/â6;«5 PrÛÊš)��‡±UƒTì�K × ¯¬�‚–ýh!£qL6ÄY@Pœµ†ê°ò6�º‡%¯ ½{H„„d”ÏIuË^Ù hî¡-5áÛoã,›‡›£ x6òÄep¹ZWŒAÒØ›¦ÿÊ4ÿ7xÿ2è²ê ÷]€C¯kMX® w…¼PI„A—`¨ew½ÌEË•: ÉÊiëUH¯èjÄf^÷:‘7ö•Úšòîw›´1:ѹt~…®fÕ†ÌÙ‰6ú¤ÌDlÆü§LhEDÑ”žŒ€Q”ÔåwMPÎÌÆŒBÌVCdÀ”9L}ÌÜËÌŒï“0Î0FŒÁ\Åæ“W³M†O2±xÇÆC7 ¤ ÀÓ‡`ÃL÷ÿóäÄTq„:0÷2˜2ÙTÄ C!ÐŽíÞ1¢´3Va£ŽS&›$šX‹7 ,=˜MapR¢ŒÚ*1H@T�dj O˜ü’˜l< �\e~pF𸉂0� 2p[”†,;HDP1F)ˆOð¸ÈÌÇNVz¿0k%ì$Rüi$Â-š“˜%@I‡Ð¦ZñKpm]Ú4šJç –U ­‰ D¬®*†5Ô�¸ï¤ŠÝZE®_Kü³( [ì)Ζ¯챤«tI RéLûMz3NVM»Ómù·ì‰º£êÊAåöà—�³Z�Šò`ÐÜ�1�—eÅ‘5õyÀÏ«3jó`‚–e!ŸÙ:ñjmë™rYÚ&ä¶Þ¨y‘ «Q0.ëh­9¦G]Hi•1A” ™µªÇ¡»QéCX|ˆü] òS"q%­B&Ù ùDî@Œ™z¦= L•Ä�GUûJN�“<ŠR�À€DÁ¡TÉä¤ñpl8ö¥ªH£#îcèt3DÉQ$]4Å`&„žd"äÀK ²F`,üfà \`¸a�¯jùò˜Ú%GÄFh$jä&$@(*dÿóäÄahŒ:`îò’„E¥â`'A0î±uÍB S@ §(¡¦N@¶i�#ŸÕ|EáCEÔ.ã@@a†ZfXº&˜�’`Ž0¶lH*Jš5í¢rn_AN<+�N_ÖÁ0Y“C`MmV: ì/Ötî@P²Ò& 9ÖìäAñ‡&iðk1ªl_øyå†�¸…‡"Zã90§5¹<,Ñ‹¹pcîõ½ ÝÍ·+}ZS?]—ñaö]§J òF^w¡ÙÉ]ÌA±§Êzäù?�EçN‹JêÀÔÎt¾�´·nZÜ”0TVF[÷m•�‚a¡Òî&JõºŸO`e†0Ç,ÂÕb1Å$‘ ]­©’tD‰ˆ¨(¡‰@š`gÐ\h"ö� %º_1ŠuÖ»'Pòê˜$0ÐP�qÆHH¼¬&8€d r¨‹v -žU@$Ôip°ÐX( 0H°Ë”³O 0aÓ  3`I0Ë#’Î6Oó1�TÍ2ã)Ì2R6·Lheç4S¥[�e¹¹  щ%›EIþwŸ›1Ç™8$yá$Ì=èØ 8Bb¥†Ov¥g$˜d bÁ¦ Dh(B~jÂÿóäÄ‘b”:Hç¶(6:\_(‚]i|,¤”蘔(ç^$೗ɲÌȧ]Ôª‚T—=XšÁ…Š-µîa‚†H ¦€°‰&ÃÜÚÀ"‡4‰f3®[°Ë§» PJ'é®ò5KWR׿“+qžPV­ZS†_Ùl¦íìipÊÔ»ªÓÖi«g„õ{Ò¨j].½jüªÕÉš Üš±’ORÃPŠtaQèzäu ¼� eëwã-ÖˇA ¾YðÔBD™²¨´ý<Ã_m¼7¢lù¬?ò螉eár9-vZÄÔ=r'fàyS/¼Î{ÐÂ#Oüº�?°Cv"2ØËñvLAME3.100UUUUUUUUUUUUUUUUUUUU0)ã pÉ€:†9ƒ‚|&!úóf˜N‹ “†ü×]™¦‡é�* %—P i0G*ðh`‘çyÒ’:Á– ¢Š`ÀŽY‡”˜ˆ‚?–È`ÀŒDœã(Í`XÕP‹ÄA†�F|ݧPŽ:a"„�¦(blÓ'¢¡â@ôX‚ÌÖÒƒ�ÜŸ`‚¸ŽóôÒaդП٫qš sq~¦™SÍ,C$Ön*•„¤Š+y ÿóäļcÜ:,÷v(�¢qx‘ìÄHŒœ°Ëʈ€€+Ð*a Æ�2‡)ëX®,;EW Þ‡ŸéëÒ«R™ÚYß”ò#f¶õùwÇzÇ_ÞóëeÚ\y¬ñ«K¬é#Yvõ,3; _�CÑÖ³=‘ô¯:gNU˜“:zYË-`LºýjðNƒV +U‘ö´“ªžÖ d ,Fí@ÑÕmBJ`Èå5aÛ°êÒ~ÚK½2ÈQ4¸¨ªÉh¡K™1�y–"‘9:”($¼™²˜©Š@*õ`•ó*KâÙ ´žƒªLAME3.1000` ¶c) ²`Õpaâ€ðcVb4 jW 0c†ža‹$`’|`V„6aD*a �` „`Y€\Q ÒŒaæœ(4‘…L$<Á!‹ªb@£$6aBd˜‚&�1iÁƒ*÷ `Ê:#�L1Ò"íe£;æœ$g°ô1¨Ž)7YQsº *ZÂ"“VtÀW%È•PBmAÓÈE5 ¬,�ªE›Š¨1Y(Q'iŒCj„Ò„nXfl‰ñ#¦5™&•,ÉC9Ù}кXK̘Î*A—U3Ø¥ˆ‚U<š¢ÿóäÄörT9Øþ°˜É:˜€�ŸÆ'´ÃzÌ|Ež¯Ä©ˆ¬ˆ£$r"P—Bt ',À$Ïcé à¯u¬µ’¡½`K™0¡2÷…®f�Ä—T©©5™¨»_¥¾²é@—šH±†´¬ë¡îNW=@SI‡™P”hณ‰òHäGHÖžæXiÉÌÑ`ñËêªêiR_�‚ÊPQäª0Q„¾ª…ïARç/ôØZ0K,�I�a`rÚòqÖ�„ðˆHiÄ€ád¤ýRÕºà  àÅ—Ò á5ôd5‘ZêLAMEªœ >ÛÐÄELN…ü°Œ0�ˆÅ|AL:ÍŒÈ0= >†ØÊÑÌéÊìÉüÚÌDËTËÌéÍlÊ$\ÌRElÄdLD Å|CÌÂè#&ÃË`Æ(I’�ùc‚�ê"y!Û™k F¨nÄ+Ã쨽"�%¡†rÊc’él€‹œ$l Š [ÐQ¦@‘ !ÐU€ó(È1@‚‚[`‰$F Px ((‚s€PéÌ`s@i�xS½1ÄE�FŒYÓ90ÃÈ–\�‚6¤1j‰¶m@‘XÍ)/ºÁ¢´âƒOöŒ½ŒcP�‘²P+ÿóäÄúsT9Ä öpÜ æË•z —º€†¤X÷à^BXâ"¤ˆ€ó*hC>,‚¸Geâ€a@ éP;%cHkÎ_fÑ2W¹5¤%¤¶8},Œj$³Ž*ê@| : 0áÀÁSF$À\¶Cq÷_¨ˆšì"@T+æ]!⇼‰Â\'�Uúw°ÇÝ=Q5¬¤4Ii$ÃCŔ䭂a@¬Íh§[4Gîá-k«Å·&¸¶ D€'!«�C]ÒuTSMLÕ+þ^ÖJ»ŒToãnH<ˆðȹZ40ÉêLAME3.100ž mD@Ï1ìL�NœÙ¶¬ÚtT̳ˆàðÀ hêùØæK¼Á �ààÄÕC Ðç¤ÈF´Ç¼Ô#”ÒŒȱÈ@˜¤'˜ /ÑDKšÙ„`CTÃÜAVIÊCSdó$�@ãÀÉ `]àïÐðµÀ73.)¦Ñ¬u€ÃÀ+�\aÌf¨5`$MrÍ‚†$P`hª�HN2� ¤” ŒòRF ºY¦"Æ·Õd6Ò“%2‰—V($*…Š©Sœ:eä‡d’_Èž_2豈°MÍUT¸@z€-o™ò°®†î<REcSùœ¸¯ûôê½�m/šú]Ä™r�²É¥òü.‚ê^©Vç‡þ=EËfŒÙÿtRN»/p”¡×u]Æõu'ÒýyY£tP…aJQç Ý�úÇkn¢aª‚ ¥ÿF�5¦�èÔ`@`PŠæ ‚fµŒ5²x'éÌÉ•„®„8_B`�0"1ŒT(M73æ™Ä=.Ð4 †f š&n”&CÆ€¥¬77Œ+I‚ KÚŒà Ù‚ÀÁ`hë¹|ÖqÔƒÂ_¯£üð¶ÁP t †C *54´7q‚2í-8à74œR6ÑB§ù3÷C•8S_€à<0'P’ۥɘ#@°²dq4fb¨`“Bn9¢hIË~Ë‹-¯ †`y|ïÇ^ñàT¾F  Fl �a€Ä!ÌÌQ¼ÏÒìÌ¥øÊ�\Õ@î3…©Ü1ÿóäÄÿ{œ: �è±vŽæ8µU/ Ú² ¬wÙ’.Æ~�e¿4L£28¢%'„hñäe82bðÌ LV D‹s#ãJ�¥œµ3{”˜Eè­Gù.—§¢¼¼—!ƒ»q)b¼‹¼�-c-“5Js!°äœÆÁ F&+˜*‹ ÁÐÄÐôˆB`8^"­Å°Ë;7êöW¹ªXÌ®ÍiÄCí'C‘3K»-}›AË jP…Y®„€]ñfo$‰† #E †àÙ„A0P"€æF Cè@¬dhcpÈ`¨fa&\à ÃQ¶`ˆTa�<`0ƒLAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUU€°¦McdÄ+†1 6g c›'¶e0f âðd¦—’,k¤æd§Xa~KæJChjmF½@èa† † @À` f-¡Dc\æ èa.æÀÐb@&=¢¼b`+¦Þf6‡†7BD>F}ÆN†k­fºš €Æ!„ÈÑÔÂQ°a˜~  £SŒC H00daøha€`BÌ0BáY€ 9@:$,˜ d@Ñe£h´’Ê¢Èò×$æÿóäÄÀdä:4¡ÞèŽ3v€ÄÜ5ã¿­-aÙâú*C#À˜¡Á€€!@*šâ€Z 15'Pâ®UUÌm¦¼Ühal©îƒ/¶«¶SÊÚ¿Z )k¸¶Ê–3j‹^ŒËq¹ZÔj×f]–³]ŒÆe6yrUK�Ù«f´ª%«rv�§ú]w »ŒÍ-îe¼«jÞée0í®óšæ34¶»üÆÍëÖyË4¶~äºzôÅkö÷w*”÷íT¤©SV·•T×÷ˆË%0ÌÍZkR©ª¼îUªgWuYlFS»jj—[¥Ç:j5LAME3.100UUUUUUæc bÁra F3ð@d~† à^` ÆG'VcV!f!ØaŠÆ„f´ô@«¶eôc!–dú€§ý&æÃ !tÁÑðÉE¬Ò´ØÍ2€È³TÕt<…g6Y½9Bk5ú 4²â1 ‹9šŒ3„�4ïÉäë–Ó Ønir=�û¿a�ËÚCñ¿ð{¹¨Ê!–WµˆL-¯Ì·7öe’–ŸJxÜüû¿NüF)*W›—Æ¡ˆÅ<®¤®$×(³ÕJMC‹5æá¼ùRJḴì7RmLAMH Aà`¾¦Ædm˜…f'@àLF`f(x¦`¦`¶Fö`cÆ�ÈcŠ-€]1�ÃgÉ1´h0Œ1P±1`2¼Hˆ&•¦jÞ¦æ!…Ár”Ûú´ÜBäÍàdűøÖLXËÿLõëDÖ6pÎé ê£0×´¸ÏSǰøÆgèÛS€ÈSÉc(ͧ°ØiäÂxÍq@Ó7”Þ“�ÐÁ$ÅA<À‘ÅQpÁ¬\)•&eÝ‚kЂ8ÇŸ �tÍIºXäØL##,ˆÜ;h]Á¦pF Ý¯6FÌÐ2á„€_ Vì%z¦Ó™ò€Ã*^ÿóäÄüsä:=D÷t´¢-º°˜‘dÀЦ Àä!A††Œ „—"Š^ÅS4§�†³g호Õå�VÿÇcqéUYcÔñÉv¦ibR+2ëq™Ù¨z¼¦ŠS-ÕªyL¦¬SOÌÆkSSC6_ÙNz·%½v#3gbCÊ qÊ9‡f_Àòø¬Üü¿(z ¥†1½/—K¯LÃ]~b¸ÃÐÅHË»~!ˆÄÔ4ÿ» ­ükA^&æÓÖ‚§@U4GÕ*B(Ás§”ûæ\òDÿeí}@TÝh¤B,äpRJj¿�ðÕ0&ópD0>ó49;,s �ˆ0DóÐ13o/Ã`zj‚H0x“  Bó` 2¡beP0„ £ph0QsPA‰� ©‘è¤%€q�˜˜)Q¦ÀñxÈ("Ì GüÖT® gC°À\LCÉĶ Á¤ ?ŒƒƒÍNL ‡ƒãL£<Ã7J#ã Hs‹ ó.�S. Ss#Óƒ²"|Ä`”ÂEpÄP,�€F•ƒŽ`¡Œ8K^)™˜T Àr„fN JP€ÓWU˜‘’õù€ ‰AÌŽœšd¢(NdÿóäÄÿw4:8÷w(äÊiNæÎÅLP m 0È…@̦P`fgC¥ÆOTÈ0Ð3á =…0Fš$¦Î:ï_îÊÞXFHÀ㌟̾Q{²Ã’ÎÚí7)¬áÌuô¿Ëš½‡1Õßîëý»uµOMj¾­Û•F¥Ó¦¢ö!™c“�¹L}Ô’È%lºNàÊáÇ>~gOì;+hÐܪ6ý¾³îS(µ*‡bKµ”³Î�X_�u܃¡åÐö@ 5^Ê`ï:ì[Ë¢ŠQØØwÙL�ýk­Õ\Ubê™ÎS”É•Ä Êç¹LAME3.100UUUUUUUUUUUUUUUUUPB@/04£ Ó79‹#�Ã1v0´ù9jÙ — L)Œ¥É�– >Œ!M0ÕÏ(MŒ7%ŒÌ„9ÏXELqŒ  ($ÎNã(JðH\qËÞu8Æ�ŸýŒ›¦K�Æ0&@æ©à Í‚6 ó0‹1h0˜ÅFÍ hÁAÌ…(ÅB XË�Ì…èâÉ <|˜XÒmŽ´˜I0±ã;¾É�Êé…“œ1›»è ÕØŒL Ö ‚�€¬ÒF z8�Í› ¬hÉÕA¦FÿóäÄÛk”:<÷v<’$ÈDF`"CÁ!`ø€¶yÔM–´ÆŸ(ðÁ‹: cÀ€Bƒ$µ/ÈARÄ 5$®Gb`7&wÑá—rîdL™ÆkÑ—V•Mn¥6°¥»ü½_xc†ßoc�ÍßÏV~­ûøÕ±—á«ùU³…ú¼­ž[ÝlqÞ_[*µ®MZž™¿)¥«;K#™˜» ³¡Š>³°Ì¶!Ë`öuýpa¹G\Fö•µÜXÙsf\²¸iN«¸ÃV»îü2V.¨#Ôé°íÕàGH%£Ù…·ìúLÜ"NÆÈLAME3.100UUUUUUUUUUUUUUUUUU!€˜$)‚¨’éìcx!ƒˆ ˆÐÃÙŒwÁt ŒÂtšŒaÊÜÁ4 À¼Áð9ÌQäÅØŒ €ô†fxbžd `d †!cß›±—&s8�%ÓªLAME3.100˜L3ŒðšLMz0H(!(äla°A0Ä$a¡‚@`a!‘æRt dð $‰Ä „SMX¯>[*jÏ ETÔ%¥jÏ›tMÐ(ÿóäÄör|:_à1@�‚€¦–pÀ࣠€ à4º§¬\�]ÕäÜ]׆BÖ_çÙ‘N´ô$æç•Ô1Ê®Íè:àCô¯Ü©Â†!Oü¦iáyoÂ^§¾¥v ¬ç>øPRGËL¹—G1‰O³&÷:‘èn?“ÏÒ?o<®§¿DÓkØë �\¸%Ô‡®_·ÉTr†Q~‹ süáCöìP<u¼åRW¶XáFep+û33.m§¯Ö¬ðÓN;òØüB6ÿCÞ×eø.¹À2ÈiþrsvYkË551^žOB `HïÂ`Ì9O°ÕÔº¢\b"F›€ad á…`–æà`>æà´`ÊÁ` �P’¼ÆB‡–Œü¸ÉN� Æ<^`Áì,À̤ÊC‘Kø—æJaBÆD™L&c@áqAÀ"€EN”Eæ414Áb¡)¬“˜Øi†ˆ…ÇŒT(`< ÇX�mÚWe  e!åð00õ˜É•‚0)�€šP4~1/íí:žQw-Ü =$M@S�™„Š™éŸµg¥L_É\ÅÀ( ~�sñGq’C ^dbfJ".0àó+˜Á(@™2Læÿß7ÿóäÄÿvÜ:,žØÝ}"Á©»–‚t“Pw)jÍÒ½t˜YˆX�yd†B£Eb@R¡`!¨+S¤&~¯eüËTÖ³×ì'6¥ ð8¼Kæ±JV¶ñ?( 1 “&1á“1�ˆÁÂ"&–`¡‚P#='0qÐ`}ü«ó»§·_;ÔùçS ;ÂÃȱ€ˆP$É ˆ\ÖAŒhph@˜Ša©òÜ ÀÁBm¹‚‡a0Ù *±Lä Ç¢Œˆ<ÐÇŠ‚LD�—% A€–µÿ ®ÍFB‹4 kàÇÍÄ)š‚,q Æ &a@‘iˆ^œ fX(Ë鸈Ä“Y¨áRµ²Ç5Ð01(dPÜc©PÃ@y+ò�4͇F€�UH¨ê@,Ã03-BÏ2€Vƒ(2¡õLAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU-•8x [’Pd&·꠨ƯÐõ¢†9 ŸT>Kæ¦ÅRM ìYS1S¡ <®“LÌÒ²0…Q\ìUn´eòœ*é¬ ¹jë§2µ6B¢Þ2ô&ã¾ÚµáI† %èi(®˜ —ÑV(*ß@rÒF_˜ã)�@ÊÞâ-&€Å›Î­ëÜ '>˜lyL–ò5¡”M]=*žn›47ÕŸ0ç»ÍÚ w•ä “%£t9J�°×( ƒÆ½�=ÿóäÄ·b´:J ÆqÐl½ÅÎRë«”¿Ä@±zK¹|b_3fì�$Ô‰›ÐRâEõ‚[¬eLAME3.100UUUUUU`hÀ „B�2ˆ<ž4ˆ2€KSâ£yÁ¤ $ 4NÒÒhÌ@ÇTé$Tu° ¢ a&”eóqLåM4‘2,ÔÃ-ˆ˜ã€£63U1¬Ši¸c¤ÀcˆTf¹}3ó!®ÁÐ/ãˆv!(8�„6QÌg¦ÉR<@S]D’&J _åz‹ÐñŠ uK0‡îášÁ„˜D@fLÁÝEG`Å, ©SqT‰ê™#�€™Tªw1S1¢ C‰œ æí.…B3FH(¡‚“ ™€À�bMb§p\$�°£¡VFC`ªÿóäÄðpÌ:5AYÈ¡Ú $ƒ„S˜!ƒ€KT2�4\€sÊÄ 6ÓÄ¡¾‚›Bƒ [àÅ—ë7W«ìDià %M]fœ[ÒÙ, eYÓ̽’€Ëæhªb ‰8�ÀAÑ¡¥¦ Š¢‚œˆF6V *)¦€b„ †-JB­ØášsBEeÖb¦ª[½(01¤&…6Ì^mà t04ÂKa¦�$M—dsI4‚HÑÀN%Dšƒ–EÜ�•Z*že¸3 2…jTËB$¾a¤<±PJÐZÙxQEw*!…9ŒØÍ˜ ©‰"w9ñ•Áå˜]ƒy’ÙC˜¼™qš9˜pŽ™Šèh™(Œ™€È9c¤a›Y3AŒ¬™·’y�¹˜º…ù£(3™3‚1Š¢ „ �Øê�)„xd˜k„Y„H„ÉŒ‰Ç˜ÃƒHˆ ‚0ÄÐX̨@@Xˆ Â%T�@&$€0<!F J e 0 �P5 ‰�ˆ!�™‚8 ˜‚9‚(˜$á‚€Ð05 Â\Á¬ŒÁÀ°Œ,Ád>CÀr0‘ r:0p ³ 0b€ -ÿóäÄÿ}$:Džð�@ é �p\@ ó�Àœ A<ÃAj`‚P@§¿p-9Ëæ;Š¢ 7õƒ¨¹€€èÀìL$dÈ€Eʰ_³� €‰0€±i†¿ÜLïÛ¯~Xt1Vê¢À—©ÖË™›cÍ»�€�Bt* bÓÝ·F~•Ñ«´Î!ËÒÈĆ݉_r—׀屹\; ¦�žš±M1S)D%žÆe.í,fvvõ6Ê«ïwwŸ0þScVj‡³X÷ ¿ª Ë,XÂÇË&éð¯nýHüŽ]¯¦Ï*<þÕnêµ<í-Ïù©ºLAME3.100ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª%c° 0£0&"o£�F óàÌ2¤³ÐR‘�¨{0 )„ *˜9ù… š$ ‹X¯r „  � ‰hY0ˆŒHÈœ 8ÁxDšÄ1Ÿ:Qf5v-‘<*˜8 §1�£‹àÀp<¥àÐôÄ015›�ˆ–›%°0èH P �LÄQUy3“ASÊÓDÂÿóäİ`ãªLÞ賂 xÖ� ƀƊæF�F æ†$+A$Œ,KŠ”Ã€90Ô`@`pÿ˜B˜ ³ò°À Á UEõ�«z’‹EŸ(¬jE×}Úok8…ÙSVfÀ�AV3Ðh[—)ã[²¾dí :U™§¦û¤Ä™mÆòkñ¨‚Ü®ž—µ7Ìòå~sñýsXsùøó{ïó™ã»½ÿçwúÿçÿë ?ßᆽ×ÿ×þ¿?Ö·¯Ë,wÎã�Oª¹Y[,gÈÕÚLAME3.100ªªªÑÁ^ …9RšIƒ@`1˜y€P†é€h‚‚¼æh àa„€Î:6†µ%.bnÀ�”0¹³ñh�`.€¥xsh‚€°S˜)዇y ‚øs—8Ãä E¾¤Ã pÄÈJò‰šAF n˜Ô±‹¦L™€,¿ÑüÀÇ �0`2!&,>© ‘‰ª Æ ˜�,›Édƒf ™!ÀdOi±$Gu|q“�ÃÅ$\Üb0¸\,¥�S��À&'@þZ 0$X$;˜ì„F 8e`ÙÜC3C€ÿóäÄóq¼:@÷1Œ8P¢­éCG úL„CJH£û&.Â+§ €"7† iŠjsB( \õ#9‹ b¢ª'-d9ÚVäöLè9™º)¯4èÀ\²ˆÌÌv&ïÓ僱…$¦š®¢ÎåjFV‘�™¬5ÖÕ‹ÃlrSÅž7I]ÎÅàEÏ#pà(uä‡"­¼ªô0ÿÃô�>”‘x”‚ž=RÔÜ=(ŒRÅ3‰Å¥*Ëñ›‡ëD0�Èâ”íbÌ�»ÉŒßWÃ�­@+$¾Ê㎌yÙ�ÝY;‘ W¹…È%ð×LAME3.100UUUUUUUUUUUUUUUUUUU Èð/‘ a Zné `è–H,˜0˜.&Ɔe€Pqo4vh0¼0c @E5ãp0¡`2˜C R0<3À2 :ó `}0]£€ ɽKèl`‘ •—5*ÂÀó,‚H€�€ H´yÐÐááø.CE5 8Âà4 1ÀhÓÄ´ªHà ô«0phH.$V�a¡¹ŽDæ*­˜±ˆ‚@ÐÈ$Ö *ÒP„À  ã=Oä á*¸Œ¢`°uD 1‘ˆ²¨ÿóäÄãm¼:L︨d,´g8d ,Z84‘ +É~º‚¿˜g’%š¾ËºÓa•ð€¦E-EàªÊа­»uRhèÅ µî–Ž´¹¸8öY”À˜‚îi¬å�¯Wõ”Á.äeâªÌw5-X[´°3^ˆD ø¼95Nè=ò¸iࣗ»Ñ 8¤ ·š¤b£Ý-‚çã—†Ô-p¢®Ìüj †ã°ûþì>Ñ÷Mü«¿”ñÚhr!/‡ÞGA HÝ9 bTûÚ¡•ÒW–ÅêÙ‡¥‘È´õz§—ÀqIDªÂä‘ù”áO÷§¶LAME3.100ªªªªªªªªªªªªªªªªªªªªª‹Ü`â ”`�‡¦>L#s.0Oó10ò0d@ÀQ02s-€S00C0a« ×˜ƒð˜GŒñ¦é,˜&°„0,¾:$5 71,d1Lw:[‘5kÌ:*€7AX]àÀà mº-p8k\.ª™(꬙]ÌM›‹e«šú»5~­™r™MmÚµ_z¦åÞPç«RÚ*Iu©u¨âTÒÜkË+aœæë¸Æ%¸\–Fi2œ­n9ƶÛ5&'ñ‡>˜—ÒI¬Q¿”³vf£‘:š›wò±R#.–r?=CA…=wãzÝä®5;vž96þ]‹óu©åuLAME3.100UUUUUUUUUUU"Ô q‚Èo˜Æ²É×°o˜+„(˜›™Ÿà-˜{`”˜aÑ—¨5:q„È3˜¦Qª¹ªp�1�˜X�é›™¸ AìÇÈÏÌ”�4ÁD B˜ÂT CÄÀ¤L€ØF3æ|Fúaè$ L£‘°0=q`<0¡¸ƒ0Á“ /3£q2%)žIœ�i…‚€ Í'Í€ `a+Ì…´éÌôÇ“LÆ`ÙÏŒ`pÐG�ˆ&¼Ž +%+1ràRr]'B[—¥àL`¨ (I›5‘ �ŽL§¡@P\˜ÿóäÄëo”:,öÙ>0l˜ U ¤y3Û1„…0Yñ 0€PÅÃ\ÂF�ãAnYg�ÐØÓ�iŸ’@b錀€Á@‚rÊ�Xу�,Á¶ µ„Ék²/„T,F†ejÄè@­»^�_˜›Á?ƒÞÌïV�׉ÊaÉØ/é%šU4Þ;\j™Ko}kU^|¾Ê™g#-¢x­Ñ>¡c}ëÎcq[ÇŒŸYâÌO=’E箓+Gc”L¡�ÍÍÖ«Æ¿‚gèc™É-c'FD•Pݘ-¦,ÌÕ0Ô“ ±¹0Ô|SÕíí9ê?s4Ô 3 ã¥0è c a1óÒˆ2I  �U1dò1) s`ë0R„à†ó�ô Â}5pÚ­¡MôÛFi-N4“ŒÍÂ*\ p6+Ą̀ó) Dé:åìÛ³$Í@+2¹ðËãc†…€D 3Ȇ%€b¢ã)Ž�"qca�Š`á¤L�QH`dÑ�ÜÉ‚s Ž#…‘ƒAÈ4Ÿ&tÁ  Š\×fšË@Ÿa¬©a†BÂÙ Ý(ØsÀAUjLâѱfÓ¨�U á`y4Ô7ä1Í9NŽÿóäÄÿu$9ü÷2¸~Ùá-ŠSÀ2q7VPc¨=© ¨F8ðJc°{P’ai(aß DFœ\åDˆå@Íņ"”3§m!Z´ZfÜ—Su/êtÃ�%@S¦[�<Ö¡œÚì;.‚žjhM’ê´ë<%í/ ‹Y&a€¯$Sgé|®¨}ù•LÆeQ§âm°ÉéX«éA¡µ1JR³‚õ>0­ Ap25S à­0+S@%ã°*0NsÑ02 Ñ�X˜‚€ q€P€Q� ,�‚�0ð!ràH¡©� €¹BƒY\ 2â1£ã‘äD4D¼>DbàJ, ƒˆÇX aÑ‚� ¥Á€ /pàÒÿed.Êò" 'z]Œˆ—¦ ¥xÅ€’ù¥2Ú¨ b&µ3TeP†0MQ´ùWá@43dIÞ(¦ã"@QHTÌHÀÁ€‰�ˆ‡Øh)`ÿóäÄýv´9Ì^Ø• '!D�ÆXpT5ÜG,¨#+~‡€‘ùž¥bíXª6¥-’d ’É[Öp÷2Df{HBEBZ£4gÅèD…¬# } n€•cW˶,7Ì][@`IP4ú�L�†(AX" eq"tQñU–Ȩ ™¤›.j[%‡*‚(ûnOé}PÔp-RCÍ�¬E£ŒU½^�ò©$•4ƒëFÜ["Œ©²ÑXGMû-öHû �Ÿ†ÕµXŒ%P2èwZ Mr¾ì¥.‘år,,¥þ€ÕÛlÇbÌ…b@¬Uœ$ †„B#– oBsc>ÍY Èv&c „ž&¢"æ_ƒpk¹,0S0O0Gs°ß0w3p˜~œv`Šf Z`†  :1ã #G¥H4Þ*ƒbT�•Û—Ú– �˜ ˜€ €à—¨,™Z0A¿0…iˆhhÙ�Ë�á€à8ˆøØ–¥ÓC0+£Ð(8@‡û—;ƒÏ-ëçb0™å¨N`C1P R·cýÖ¼±^ ÀºÒýk—9Ëæ\C°[0a³` 06C ,€*˜3€iƒH!ÿóäÄõ{Ô:$�ðþ¿yÙüéõk¥œKˆüYÔCK´²0 `à20³  0i³°?i� Áƒ0„nÐÀ˜(Fw;ýßþî÷†~]†h׺€Š;ñ¨  øWoù€Ð‘‚àr™Á@ ƒ€ÐÀ˜ÌA´ÁÌLÌÀ´ Ì@<ÀøŒ@oûý½½åžxþýþ­óXËî°õ®� ¡‚0ÇRrž7?MÛ± ®Óæ"‰Ä`¢àP 1 €qeÆ€¤¨Æ` Æ€ ×Ëä£G pP4Œ€!LU¨¨’T0$N S8¶+…ÝyeQúÊ„Ð0WE1YË9†Ÿétjw�æ½ME2ü5¥nH¥J�ÁÔÂ)«,¸-ë]BA47Q`¤ügRË®|RH£êé®H×N ÝÚÚŒ¦HÐà‚ǬiY"'a!ˆiû_Ì6 O ¢Á¡b§%ÔÚ6ÒV²ÄWðسŠû¨Úâah"C´K§˜˜A¢Ê P%8òA�ed(¨sæ&1¦kFe&C€ `�ÂPËœ­¢ɺÿóäÄØk¼:qÿÚÈ"D•@6…›8ùµ‚"P9U®‚ÆÀIÌnmªºi#@0B©¯Á$ �óMÊ1Mo™²à²ã€ˆ\±‚ÓL.‚� bžQe/; "=¬)C¾‚ 0¨HÇ 8�"ˆ„ù,Ø8p )^ˆF0‹Q˜ fž ä–]ßBRœ.Àj£Ã¨Š«¦X#X5U* ÂA Øa"`©ó ¦¸`âǪº5–|ú b�ŠEyz 3’Ù�(@ –&„bˆŒ3˜¤lclº>LAME3.100ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªÙ-ÅÂ@Td2C& À¬€eÆVFâ+,=–¢/‰¡I²Òø ¥�å_ƒÃÒdÒÒœfJβ¤e‚á¨G`Éåã¸�%‰jHÒXÖBrÜ•.£µR8™¢î¬´5LAME3.100UUUU߀�@.c�wµ#TÕ¥Û¸ÿZ«½R]—Öµ�aškòÚ}RãK‡1•_¢‹MJäªÓR»‘¸—’˜ÓýrdN̺�♋¾.C+iîsÿZ‡BÝqâ µe!«Œ»¬À×8¿¢4ŠÅÀ£�ÀV"JàÕÀ4PÆàçL² ÕA •‚sN@9t ÌRF”7¥2cÒ$"Ù à9¨€€ žehÆ$:e€¡€¦ÄRC0ógt0±3 <t:5ˆà@癹`fJ6ƒÌƒ¾ÂGªŒæ|¡•nžŒ›4E‘lˆi“ 5ÿóäÄòq|:Y€Îõà,<‰nÄ# Ñrá¡*® b ˜òà ÃŽ 0% ÌÂS(<1B.2JÌÀóH$½AÍL`SF @dÊ)0ÂÊC´��ÚÁ%Pà Æ(©Œa‘‚€,á‘bÔ 12ÁÁŒ(C,a€F Æä9 “<Œ”à# "f̬`a0r`ˆMšD&f˜`&+˜Ã 9“ `P˜­Aq!Å›Öê^&†Â¸ MÄG�)T±1�&®LAME3.100ªªªqšÈå.œÏܵÛ9ÞúŸûåªÙažz»„f—cIZUÚ‘®Ü­‡âS﬚8Ó™“&›b2g)¤°ÖiÚeLÙ”°WhP  ¿—È €YkrVÔ„0B°;'Z; ¹ˆ¡ITtʊ̬èÌÍ ¼� 8ÂÌŒ`¬ËÌ]ËÌtÇ„CBㆊÀkgBé…BŒ¤À„!æTncÁá¦8f#fŒzX)3 ±B£‡`@ñ‡ ¡4X  WÿóäÄÿwä9Ô^Ø ã ȱŒŽ8†‹°øÐ[fpÈ‘=8)•ø�°ÈˆT )iL:ìý“,3¬†/<âKz¥±ùС*T¯K„^&”ù¨#„¹•ú�:Š>¡ïKœ…J)0¥ê_æè^(u|B‘iiSiFR¥/Kêׄ (êÁ´ª®ÎË8³ œãÕÙP±·q-!´õWŠ…í Ÿ hÐ8Pþe‰Î‘ð »ÛÅÉ"²ÎRÔÍy�„Ƽä7Œ1t­e šòb°Ù˜ŠÓž�0Ú1‡ Ph"'4"‰b=­s4&Àø¤/�¸`@\ÜÊÆê5È™ŽÁÂcƒHˆ-€ÚDÛ�‰† ø-2cÀQˆÆ&[ ˆÊ‘Ô AÀð(ÀÍC=�a4@09 È€ó €áúD˜L7T `™„LÆWW™1\c˜Aª™&Ý™ g£�ƒÎ&—šÈ|T%½îÜÐðAW£àp`á"Ãy ª¥4ŠÔ�ã�L¨]0¸ÒQ@u´ÅICVRŽE<9ƒiîGĸ·sdRÆ€ba”ÇÓ…Â(àˆ"ÿóäÄò{ô: ã›à™@ô*šle@AŒf`˜l.™hé±òi‹Ò�øŠarŒÂÃÀxV8a�)„CDC FŒæ" €—!@Y‚Ë@Xd`�jæT‡ Œb "^Ýü*rµ‰ ªIid†h·m�¹4”Ž—Q#˪Ëm)¤¬ ÀŒ •h‚Å�‡::“)2‘(\“©Í9arAr1ÞdóÙ�¼öeóüýêîô10�4 PÀxb˜h &AB J?”Õo±÷SÔ#Z†ŠáѶ`˜hŒËËÐ]7áTyˆ0f¨�ÈÈ  Pa(eƩƔn­%”‚V‚Ö!(*Xs �A€é‰±ˆAD °mJÁÀ!€zsM(xp,0,Q Þ5˜m"Ù£ßLÕŒ&0,0Ð9-BÀ Abo,|‘(ÁáV"…&/–p³#CóÌ(1 hÃ@ÑT·ÌH8h`‘Òz€�3,�!ãÁƒ) Ì �"Á³ …˜€ 1Á FjO<gÂ�˦I LFF<à–  $€0àÿóäÄÕzô:nC™à!‰Æ˜4\$8Aá€Ù‡Âf™à{Èæ& ¼4`ÀɈH‚Gc�Zp0�è0H Ó MZ§… xWh$a°‘` b É09 $`  –A&¥ªk˜aQôTÁÀb`9† !t¹] 2‘­Ä૯ €îN;¤×ìP ä €Æ¬ªàpV0ÔÐõ�H@"  x8T„E€E”0P 2ˆƒ�“}šbü–<ï?-MØ{¯ ÝwàתP7^_c à«c€¨’�|-÷i8Ô·ŽŒ¶¨š¼¹ž[vá†ç?#€° ÛHTÕ‘§RŒ€°ËÞÁZShØü®¼š�ŸHh`aY£c§9a˜9h1€ÊæóÌn.5#0ÚIA¥¡€†8 JW’cĤ�¸n])kì–×�•¾�é,ø8Z‡xi€M "¥"ÂA ƒ:n€Ñ'õ¢­`P!rü†0C X *a+À«#£I¦)ÕV°pa%·1AKŒhFÀ˜D& žVnŠ˜²Ti²‚q�Vó,´¬dÂ1BSÅg¶&e‡!*�1ÿóäļfœd¡ÜÐL ñ!«ä¼-tÁ3g ¨F.ìèÃ’3èI’5¦Hɘ,!™YlSÐH0\hŒ£"0I³¡4Â~Á€L0T­Œ#Ò›BŸ0ņÑYlqaŸ$2Mh%[Kº¿bÂf !ƒ’Ut*<©™ÒrµNmÞUÌÛUŒÉTAQ5:b yþgSwœ')Êu±ˆ»P5iuÚHµ,J�‡B©p”¹-uɦ¶þØ�_¥”ÕÉö~£SñWJ-‡³Æ…ÝÆ3¬¥2I]$ºÔj{ ³4¶a—öŒÊi†å’Õ@4 äÁ”N�6—ðÌD>Œ7 Å,9MÜÉ8Çt< Ä$ ÍmdÎx¦LpÄÅž ©‚´ Æâ†OƒE‚ñ‡0d•„ØLP¨3Ø(À€s4­Í~2i8ÊÃk ǧcÕc‹QŒÔæ9ª Ó5C˜MMêh3ŒÖ‚“;…̰A1˜(Òió Œž$1!tLJC#L˜W1Ú\ÊÆ Œ†)1@ØyÜgĉ·Žg¬$ir™�‚†Ï›Ie£!—€S™�6`ÐY ðFƒ0àÌÐ"ÑpÆKÓ#!@†�AøÓº,3'Ì’3RxÿóäÄôt\:8÷4ØÌ ;iÍùÓ €Lð_1ŠÔñŒ"™ab†HøÓ…QàApK ´uÖUKÆú²øZ¶DRÔ-}Vw{Î>4‘¬i¦jY�0’LNHy”Ëaœâ2ì›±Ù‰uHµû³´XÖ–––šzíœ3¹M•q¥±M[9]Ú“ÑÙliÙŒCÑfuÚž»•áG(é©fâÓ¯ünrzÆMhÍë�>óI_ÖG�·'vg_‡ù4!†œã¼Œ ;¯ƒÈ¥0ʶA±yK^n��™5Õ"ß÷©Þ‚ŸØ£ N7<ÿÀŠ@XƒÈÁ° ÍúBpÃÐ"ÁÂŒ`°œ&r¤D`ºf’&„l'5¦‚†)#ýZ&  †2ˆ†:;禦/‚F§m‹ÆPæ Ä*y¸„a‰ @PH3ùã4¬G2¼¯3+d40�1PÞ4m®7æ¨1�,H“ JƒeÍ£„Ì€*LTHW†š † %��FJIƒÀiƒ†Ì“€S|h”ÀÁ‘éÀ`HÇFÓ:+Lz 0xèØê㰳̼l28ØÍfUŒø2XÊê‚'À:J1±2à$Î3?ŠE�&*•e¤G Œ( 0ÿóäÄõs,:4÷xXÖ.aoL #0$F ÄÀøŠÐ¾,[bNäC ‚ñ ©‚ I"D¥/‚›å¨Û-8J5;£«KZQ„f–é¨íO_–ÌRUµ…j÷®rÆv.gÚ[Yû˜k·°Âíû]¥µ�H´šõº8ߦkBgá»Î+ÿ1Ñ8 î<æDÝ÷B#Âòřܺ™qŒ-ƒ—óå µ—v+#g�ô=Œ¥Õr[úœÏSNŸå3rPit=�?ŽÂ§3Væ³U{ÚŽTÈØØ›hؘ�LAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUž­¥È #‡ÙžÓ ™†éƒØfI¡P,˜`�¸`66�9ƒðG˜Dƒ¨XdŒƒBpÅÀóÂÏc†&E@F7œz j)±Q&|IØ9\:L;ÏÈå`BLP64ÉÐÈ- 4jc"lÙ2Íæ2†1Q@æ±jÂ�5@kE°/q“TÀŒ á%©µQ5†/d•D!=c!f( 2ßC1ŒYƒW Û-4DÐdÍ!3WBJ¡ÔÌ1f ƒN9ÿóäÄÀdÔ:@÷4Œˆ—8Áˆ-­&#O#r`Yl}\¾ÌÉ1›jXó•nV×)ƶÿÍ.µ_@àNê1$swØúš­­Å¸ï?ÙV©Ú[´UT‹ýˆåb,Ë©i‹Ê_I}¨ ͎ο°åITª­Ì!ë‘({u�èjj�¤�*K&™�Þ›Íyâv©ÓE’ö:½`ʶž–[w¨e¶®åÚÒš)uÉLª]©Tmù€¦c.Õ5CT·¡îËu^3‹A´�õWuêm®ÒÞŒÐV•5¨%®Å(ÜV’¹štfÅ4Ìaþ•LAME3.100UUUUUUUUUUUUUUUUUUUUUUUUU0%Àà0A‚!0>G 3C-ª2¶Eè0jÁ[15Õ�0§À–0,@0ÚG¿1ºÄT1d60„7*º7Ì] á1ƒ�ñ�á¨XP1”…1(0XK1Ô8'ä=d1D«1�8•N5@)0Ü 0$q4X*0C¡à¶c@pbHŒD?Sñ¿�|L!§6Ñ`(04H81É� Ý Ð†ÌU¡ÔΠ@E�PBÙi M2ŒY¼Q%6Ipáê“*Æ#PPh€†™ @‰ ª„ÌØlQ\ÊÍÌàÁ GŒÿóäÄÝl: ÿvtE‡Œ($ žÌ=l¯Už`5*Óûn#”Í]µuÛŽ—À°��À�)`Óx¼‰Œ®S2BÿÀÒÚ婨ÔÍ<‚U~S‚âq%m‹7%@ˆ« m¸)KŒÂó®†.CŠŠHnJ"˜¨ªé@3­v@ïÊî–Ð<ñ«ñ(v’S�Äg*¸¶aú“8fÃÓZy­Æ£Ó•Oj’›žž‡íÉ®ÐÒÆj\ïeQ¬¥Ð|Ô« öaªo±KO3W¯+Ë#<±S²›×©ièãV±Ã Óxå±�ªYNJLAMEªª0O¯0ÌÄ¥0RBB>ÞÈU4Pƒ0©Cc1w®¦6UÊT1«Ã¤0ˆÆ­1æê0cC_0�ß0RÃh0WÁ0‘Ar0+@ó0[@æ0E †`4LÀ+|Ð4” ƒ4“ AsDžóª ³Aƒ³Šsˆ3CSÆÃÁaÑ\àTÄ�”Ê!Ü0h0<00|0´0&XÁ‘V6c ÂAá8B ‰ãÕ�Ÿ¬p.>…ñq4ÝšR«'2êZÕ¢ ¬P¬i(`È(`0>`( aÔM0ræ¿0¼ wuÜ‚imÿóäÄùsD9ô_è·& òP5ÙÖe<ýO³÷‘ÀUH×L2V¤s_­�Ûu`E³@P|Ž-_”4xn>Üdµ¦“ÔˆDìYBóBÅvú¸å@H°Îâ 4õgXŒ«s²ÊÔÜýIê(L7¤›Ç)ê�$»’ˆj[I$p¯Ü¥w`&ù÷r­Õ½oáPÔõ=ÈzÔ­”ÎÄçÞÉT†Ur£P41K;Ï´ËKk²G¡þ€e¬n¦u¶þYƒÞ,a.Ãäø»±–<Ó_› ¾w!¦‰Î38Ó?”[4À1jMeÆ/æWŠf€%†8�†™ &�f8a…ÙXl`˜F,•à Âr犀DB4iB™"� $@kQ|Ü�¢HàD{�D`ʃ)‚±µšÐ�HH`Lb 0 (Á"d«hBý, ©vVc‘©�Ç&/˜¨8`à@( �(`bAŒ„b )ãQGã~ã™<†c0Ø@<ÍÃ.  1hÔÇ@³– u3Ù,ÄgKÀ Ú dBõŽÆ¡À‚Ø0`à1o Ç"Ó€YÁ•ƒÆ‘„˜Š`ÁAƒÏ&‘@&&7µ’l§¿3ÏÿóäÄÿ{ä:A�àês}¿¬9˜(bðÉ�À` ™†‚Fh`pYƒÀé& ´:j’ ŽÉF¢DÀ haÑ�ÈáPÙ«†f=  D‡Ûþá†ÿÿÿßõH��¹*ë^—o±fõ]¾ò=‘X tŒ3Áh N2àLÇ"³R!Œ€$* žG1€ˆÊ‚#1‰Ì:1¨LÀáó’ÿ÷ÜÿšßŸ†óÃZÃ?•¦˜³×ºøW–ZB–$[¼š€ "K¥Ú)ªvž³'áÀqLÂÀc ÀÊ0`ÄÍ#S‹Í@^ˆÌ^10ðÆAc‹Ìø:3À28\À"µäaòÙ•HåeÚLAME3.100ªªªªªªªªªªªªªªªªªªªªªªªªªªªªª‰[Ž7tסçú]*d�ŒK]˜võîs1™l¶–÷ö¼·—«J©§á«2 ŒÐýZ™Óv¶èyËš§Æ¯);$¤Ë*ÚÊv il;´˜¥›e±–Zš(¢©TÄ»­ëµ¡É–‘J‘Ùº–¨F%É\–ft°åºdÁ¡!F@Æ“X»¡—ƒž‚G؆bLLd“l€œ@+zBÌNY£�,ÅÔü›¡æ$ʉ@§DÂw”D¦!dŠÿóäļcÜ:i�ÙИ%Œ1çCˆÉ+òÌG) �TÆÇ!*8fÅD„@ (4ðhùp‚ÂÁHǶ„w2�ÅO˜rÆ$*V P 0PÂ`¦x`9š¥LÄmDÌ”x!ƒ´Ä…¹m‚�F$FTD aF¶â2ƒ@Rþ""â¾(䌬!P¢Zˆ+¶J,¼Ot+lÐ1QUUõö,e@‹ÂH†õ¤• ,@„DÁÀÓ5‰®Ÿ]%µK$.jÔi»1·•�£rŒ­œ_HÚ•êújõLAME3.100UUUUUUUU!á&e๼�;å* Q(¨>NF…‡�/?´Uœy'›L[]˜ µ´º‰•\ȲÂÃ:«T+ŽJËD�>Í3Z¶ÈC#D‰Ä!É�k+díí#ÒØÙ’-#Ã-@Q‚���£`\  ФP9Tà ˜c„A!ƒÂÔ0„# 3bCD…™‚Ð8 Í ü|æÀ ETÂÌz0Ê�ÉHÑ‹Àª&f¬h‹Æð|h!ff fJ@‘ñUóV23B41À3k4rA@4üÎ�ÁbBæL:b,Ã#£†da£ �C)1âÿóäÄîp„:]@~ñ°àÅ5 $ L ‰†€$$ÈÄZ “‚™`¸¨Ù�Á† †€‚ „ÔÉÃÀ !D“0q£'-£a‡‡†˜ˆ`Tx¿æ6F‚‚¦f2L110òá`ƒó H×PÀZa`'�t *Ù Xg™ˆ ¨Ñ0ç¤Àà@l—y¢ÅY�E[Ì+8bÛ«"&6f¶œ†�Pšˆ‘ÂEaqME7PСÑ$ r†ŽRæ0"B ò<„P‘ZÈ9$JQfpËŽ˜¾åÁceFÇr�ºtÉ�5¶EÉ;f¬©…(t¥d¢ËÖ`:#>j5KœRWj2×ßø]#îëÐ#bx®Å8/Š­Æú8“j‚®ñ¶î ïg’Æ¿J÷Ë!Q÷f$¥-9KÓîLÇš|Ö¢,¦Jý³Vu°&G ©�nA“ (JP,­‹,ÈŸ1‚ –a ˜áf0YwAF¦B``ÀÆRx  ˜"¡‰;˜ˆ‡$3Ù¦Ýê�…:˜ Á… ù¹Í^š²àb1±5›a¹ÚÁq)“¤ Ñ�¥,q�©®ÃG6ópY8‰ÐŠ�às5¸ 3é…–J!œ�yÜñ¥L!ÿóäÄÿw|:TÖõÄRt«™q&É9ž* DoÕ6FÄðÑcèÍDŽæ0YŒ2k�šæ'J‰“$gÈ 4Á©�Zr©JLË#0, Ï_;�M´€¬XÒ�4³�±±Ñ ^»øÈaÐæ˜F*|Ý0!Õs—¤½©Êb�¹"€LPpX�Å¢„S&„ª¦yŽ`€“�d e+ ê» BQ»…îb ÙŒ–öZ䣲—)´�¿ÅÂ,Ò%ô-ÚÊ NÄN‚î2òÒª¤L À”}Ä}Øh:ãc ÔÌ›d%éCÐJ€. A@�0#³Qƒ3(ƒQT0ˆ%ÃYbj35Ã11ç2S¦01j3S1 ‡3�6ËC[4� ¬ôÉŒL|Ì@ P úkiæŠ.+0jþÞ;ã×—>nC…=2÷c8%c 2TÀs-™H¹1���¢Ø„\‰}T‹°2 ƒ ’L–8âˆÊÔLh°<ØD®V]#ÉàX ×®!`-ÈÝE0É ˜# ].à ˆáÁàêy@–3‡[¤²éGZìª~3F^v†‰ÃŒ: „;4’(f[A ¨+vc ü;)nNºõP&b¶X#œ×a¨Ì·¸c*Î ”F©+ÐGŸWê¼…ækªMv?pr�Æàfaá„3ö¾ºØšè zaÓx“âe‘–_¨$†&ÈÖ<Ž‘G�ƒ“P6&ÊH d�ëz]7Yýfðcõ)�ݧÖ<îC2Å)+GŸÚGêŽLAM0  �40Yƒ¥€0Ú óàp0ªr£0ÀÙ1]ƒ cÆ7Œj3=ÁÍ0þÃÒ�4 s9M;-¨Ðij+$ÁN79èǤ£8: äåh0Jgxù†¦° *�qi—çk¢sZG&`…à2“a"0»QžškÉ‹  JHÄCŒ­lÒ ÌDDIÓÐ H8tdfq k6££‡„ ˆè�‘‹V¡ˆƒ‰€ËF Tb &2*ÍV1tÔ°,F‹†�2J~âi'FD"c%&heÂ!áa @°X‘$ ÿóäÄòq„:,÷6Œ F (Ù”†X2G˜Pj/²öL]Ø a°ý¨„¾žöÙûôôZ™£¢™žŒKâq)TµØÍás衪>)�RÓgMÝï<�Êå\óß0þþ÷z“tòžg'â𺱈ûO�5Æ“Hø¶Vì¡ÌI¯¶­qîƒC~»•¹Ž „º³ë­H½KÆ.ËAeàà̬D³ÙJl²Àpe/Â×@ÀPg¥aÌTx¹x�ŒˆdH @„”ù� ×á…2'õÉpeOÔ­à]1ÝR:X²ºC‡âÑ'RLAME3.100ªªªªªªªªªªªªª0) u0»(£Ø6ý1Mc`]5;.3Q€¤1÷jš4m0 0³(ƒŠ&¹1æS4AcW%sBó Bž£A‹óÃAT`q£hÀãÀËߌÎÐäÅ`ÝØ¸Äñ\À@hÂÐ$DÃ`¤ õVåív®_V¥ªÖmØ™»bÎ9µñ~;.iT«µtư¶ó9,ÇW³-k mž/vã²FTø½ÉÖ˜Œ™sµt°b.ú18sŒ SÎÑ[DÆH–‚‚ÎÕ§ÝLXí <²Gu§Jâ ž]?}<úhju/tÐVfB¹VÊfÏ£t�¦m]x&Ó¸Îå®âaßLAME3.100ªªªªªªª0|3Ëá³°]ô2µó'ø=ˆá³Z¡51á £Í6G?ÃRW®#{t$2¿£‹ƒ#únÃaÌÓLƒÄÜãfDók_sa8#òÞƒ>Gó©«£ìåc3”'•C&E€(ÔbÈúb™4t³†N6g†¦$($`"¢ìl,Âs#1ò³,*“ÎVhè¦ÎÀãÝŒŽ4͉@ ¦ <8€œ0,ÄDT( Œa‚ %r ìa…=ÉØ`  if.�¦c¦F $0²…eH# ¥Ó@£šoÔXºNÄ5ÿóäÄïp¼:÷vŒhÐӌԗ÷‰;i†×äIÈ­“‰Î_5`T’×ÓwärGóQF‘&Ž»mm™²—YwÃî³ø¸"Š^�îäV/ŠÁö¥qHTaœ0ÇcqyN‡%ñyø*[w'êÚÊ‚šÊ7D b%ÃÔt��Mšó‚à/&– NÔ™s ´© ³ £ ædÿóäĪ_l:V>ÞŸ<˜@&TáTPÃpâÆ�(¨sƒ ÞŸ4€ p“ŽˆÄ–6‡MyE0Ñå\D!j=Â�†�¨J~�-.q�,…kaëÓVu*ó_AP°‚ÑÔ—x Ä\˾-òr@¨4·¡ —gSëµ*™›[øs“©0y¤™•Gr¹K0kQrv*#ãvκ] J†ç£B Îà–Y7[®N‰ì‹éÒr\^¬æUi¢x§^½\5·Z‡u:UÊr2É3 ¼^�¤©eêóLAME3.100UUUUUUUUUUðŒ1¾ #î#ö1#qÎ6¬c£7ðÂ0¤3C¶8/c�I0’=3ó&0‰�<¬N…Bf#™@xâK¦bH L4 �„Œ&/Uo¡V…„fÈù‹…¦Û)˜ qáé„Dæ4œ­˜˜a‡5�“^ÃP²) ” •XhèÆÄÃÀ�¦P6aÄffeãF.ö['lˆ Œ÷m,ÄÛM\ü.:,7 ˜ˆ4@ˆéŠ��9˜TF4B@4(c¡!c4'3‘@°¨!1‚€‚€¢…À®÷ÿóäÄìp:÷6�@q‹Ì•U%Pl4„h´”‘”Å`¦.ã+ƒ0°W| $-8ÐSV4¦qÐ]I#² 17•×uسZlPæ}å|µ,ŒK°“Jie?JÿÄc´Ð¸¬=µ.håµi»E Ƽ.r®ÓrLþ_Ôä®TðT‡žy#•<³PãLn+glHj„CμôŠ!4Ì$œkR˜}î}!ÆQ?1ÞOE`GÙç äšL�Ÿ°@å)“TËæ]²W ­Æa†¶ã LAa€8m…ù†Ã»]° ‹�{Š™ËI® …�ˆ‰E˜<,I¥! ˜†!„♲‰‡ð ›‘˵¨AT4Ñ͸œp8Ä”M™<˜”Ä µpÅ Ìd¸(:n®f>Æóc³f� z!&>LYã fJH4U2R€Âç¤T8ÈEŒ<(XÃÑ1PqzŒ±\×Ç–L ôÛ†GŒEÈL,€µàKj§–㠈ÔöÜ™c"wVJ\³¨$„#e£L` ´¦ó$ÖŒ”€6B€¢ËÙv¿²‹PÒ�)²î™‹=Okñ×Ål–ä ®KÓ”,TLÍ ZJÿóäÄýt4:öòž6Ë„cƒ3H1žb‚†qÅ…Ià(QsA‚�„šÂ2Jƒå ” öéÅXaáHHeŒdt¢‚ˆBQwí”–}-ÂÌ"Hª¨D¡©LèÂ2‘@êlÌ"2ö'° hê™D&AaCAOD'ÐÓ@cÊ\ �(ÒÄDÄÔV®Õó4h΂—½S;ÜÎ�©#ù@ "Q*S8¶Z‘·ª0ÏZM¹Q†ÊÚÊ€Ãð‘É]±~FëÜm,>ËLñ²ù#Üø@0ˆì}L0}£€Ÿ2¡c«°'1à ¥3Ï9£ð1dsWQY1åÓ ¡\1D)£àÑ0³³aB Äà21xÊ�¥0ˆdÁ¡“„LˆŽ6‚ÊÀ’hcÀä3»n6!Ðêú:ì̈# ÄŠ0àBA¦|™1qB� ´ÎÜôgZO«]pæ«‹ø,!A…œQæ(0T8)ˆ aÜœ·cʌхš°õ|ÙBÄ”«ˆë†Šëù (]’ý¤AÅ߀‘æ½ØÓ !œ—ˆ´,��'»B2ƒ` ‰à\1”—è, %’é… D…Y‚,,8àZi�¥¸B XbÇ›q¥L˜> цEX™„Πe�˜À`ÉÐbÀ©k|©Á&¢¨ÞvÙܼ‚Ð+¬¼[ ÕAeÐ`˾ xÚê«F•zfÞ6°È!ïp!ç– Œ2æ±6˜­1Ð/ë/Xt a�b•®GÕw®ys Î!È 0-Ã@Y0Í+CÁñé0™³h:Š“ €t05ók¥)1;C ~3§“2°j0¬CB€ 4¶àÖóŒNÇ4pÄ`ÓI ¼O2�ØÀ‰cÔEL‡.ñžnjá)—ÂFuw‰`€`Tü §I� &)Âã£J (XÄ@q€qL.G‘ „� Z®0°rLR0`1À¸ 90˜`ÇŠc‡Ì„0±\Ë¡À LÁ 4â0À 4)£@O7=ÔiEý5eKÀš°–l†qdÏ5Á¬J¾ˆ¡M%{—\F·~‚EjÍ)},ÿóäÄÿxŒ:÷2¼£0„ MP)féÖKy#¦ØfJÀb€‡ˆ×2O9!$ËÙœD 0 `ƒ-X@` Ûà,¤&¢6m°ºsC �$ £ä’‰ÿ-˜ÀXq ‚•¾Dõó0uhd,‘$‘¨·e­ ‡çE�Œ^"é7…ýp¥ÌEïušr¹ªÅWëÜ‹/š<%Ò OxqN^DÍæŸ—ɦÊVhæ²g=ûX�">,‡nX]M~VÇ`Fw ÙXGùÚJ¶cU¥¶6~ï)ƒÜ×S�¤K ri‰Äñ²´h�U,Qf'Ó\/Yo!²î*LAME3.100ªªªªªªª–æ@\bÞyçM£Èa>fH¸c®g&8a4)çà¤aZ) f&cÛE `lgäš0 dÐqØÝà¨ÉšÎ¦=­‰M\Þ6Õ¨'1`Ûsƒ@B“2ÆŽ&j–ûS((�8‘Ô12…‹[&@ œÃ–UõA‚Œ³’â£Ö"¢B]V1á“©°˜à¨vj¦\bÓ;Fd1™|g§™Â`Pq`Ï"38­¹vzÔ ô_Ê\„@¢¥¹4i€N®††›–á“B ¦ND~^íÁÚ�Ð9öÿóäÄßlœ: ÷4ŒaµF¶). <è däoPA�ŒH ©* 0¤ Ò`„° R•C¨â�*Ü[V²ù®e_³2åvr�DÔ¶:û3(ðfHl�Oúj¶°B3F~£�}fµ©çbP5«p+)� 5Ðø+§’u iSUhs0<8®žÙUœô¸Ž”ã·m§³‡yÆx_É·b3,x”%ÎYùqd²¥=̹¸¿E;LýIª;±ˆúÃ^�u¡™ !ö~—t&Û½J+Y¡fM«qhÌ™ÂnìÖi•LAME3.100UUUUUK˜é�ؘL\9ñè‡C™’ôñ+�±…ø6™-¦Q͸äc1†Œd�&Ù�0dW ù”èŽ�™ ËÈ`¡¡é§ù_±¤~z1Мf@ˆTÆÔD˜¨@dÐÀ4xcñ!ˆHaÁ�„Cæ/ l4Œæ �…#ÁÒ(�…©KÙKNUPVº’{˜’[•mÊl-vl‰¤,-I‚‚ aIƒÂÆ-(„ Œj:1P8�ªÃ°ëÊÄQ™K˜<ªCM!³+Ö3­>)�k�4Ç Ö2 �¬Ô%!ÉB iHÿóäÄñq : 4÷2¼êÓ_F(�;¦Ò^8q=‘:}UEJdª�ðB©šKüœK(’A-êX€b�ˆ/–® zi‡ºîõ”/*g .îÂæЛ*«8ͅɈå1¦vYm íiÚoœ•òΜf¸ÌU+9ê•O=pÔÜø›ÍÝHfÎÄRõ(2æ¦UeÜË vêì´ìIš´v"Ë—’k4V"À^ç%µSX“ò ÊÀñ_¸’51~ÛÕ“]m§ßŠ‚y£ïJÒ`Ð3úÄ^™3鯷/]|¦Î´ª ÌÁ6LÁð9|Ü« ÄÀþ ÁAb8Öc\Á tÁ©,”ן„ÁùhÄð!,y8Ô“”6ƒ “ü“,"“4 ãp ÃÔƒ4ÿÙLž*?¢ØÍçs ¶Oh¬1HüÀESÈ�ÆPU‘ƒ™1Q�Á '‚âÀ1 -/_ó ˆ¬@�t' €˜%¦â†²O5„¥qWêú§tÁƒF„"2q�É”…O؈$€а¹Ž„“,”{D²Ú˜ð“ šb¹¡‰=š)Ï�š„¦*††:¹F„ØB¤nˆÿóäÄÿ{49ø*ÿ6Ä‚[ Øo—>,_·$˜= F‚y€ˆ$H@@èôƒ¦ 3“: (2XÈÓù“‡˜Ip“á‰�ˆ‚I‹Í„`B€B4‚aÆ DHaáeèdôî¶»ÈøÐf¾ä<®Þ3´’¥9z!K¦Xÿ»®ÛÆê¾ýv¶Çulnk}=–E,Áò` ò š‚à9LJ¢¢‘¸QåÇ•±w¯8ù[ Ô\‡…µp\7±|%cÊÑÑü» ê`5”ËfìÝm+• Î¡ù…0÷«Ê®*7°ÀÔçN·‚W KšÜ4òKV!�H0˜w±‰ò˜k�ƒ ÃvçÈ&jèu2Ó†_cÒe¼ÐÇ H¦e^�BX3A`z0© “³† ¤-6Tð2XasÁœ ÆÊÍ‘uL–é5 Ü•£%¤N Ð1q¸ËÁó|ÎOG7‹L莃\( |-3úd›1)ˆc³)“Äf˜HL<0h|ÆA&��è`ÀÂ`˜T"¾Ì:-1lÃâ0Pü�4c ñ�Nf�@™äBp« ƲUQ�:lZ¬T}d`ÂH`_ „÷,»'-úM„$ørâÊgQÿóäÄåz$:÷4¸ß(a•˜ø™ÁÖ°c�6¦9pXX0s " …nÚ³²õÂÌ Ìû0FíN†<[†¸Ç�‡ß…À©rí,"h:\Â$VaãNêhB€HKHq!Ñ HF¾Â&^2ó¦#q~Ù£+’¸PË„íÈ"¤^®SzÊW©~äô®ì73"‘ÉnÉpÊn9�ߌ|Š-”³¸iÄgé×ânó,x‹¨_Lw^‚ç«¥OuÃI4‹„ !`C‚…º¨ÞL-@‘A ˆ† ¥Pæ4˜$BˆqúAÂÜ „ m9ÒÐQ Æ„²ä 9ƒèÏ]˜8¤3eîYjÞ|^Š@ Á„êNPÁÀ 5€Ô¼3„A a˜ÆŠá’ (Éê2K ðš1A³À!XÈÉ€ƒc€£Å`Â�B!@aX˜LkŒ�€@`ȲˆT*1 ZZÌLX*L²ULLjLCLôT ¿KL81N+mÍ LrKŒÿ%L_L"L_ Ë.b�P[ó#Ã@ò°(ÁàÔ0g T ‡£ cŠ£Á³‡ãZŠC �‘Æfؼ Œ%ÐÿóäÄÏ}¤:$ ÷t¼€”Ð!€à�àzÈB"cH¬�ˆÖ>$½‘lÃ1â„Õ@AG!(è±� цlˆ1Œ„ö³*ªe¬ëKŸfõé‚àÙ�)C6….…šŠèšºÆD„ À¡¡«áÎB`X( :x¦ò-"³„Ô˜Œ6Óãl^*€)%rZi<ý%\(¤U_˜ÜNU'ŠÒá/�¤ ˜ƒ(*LË«>•r¡&¡‹­Í‡Ãí%óW Ý’¡’˜ª‚ÇLðàI¢Ê’üh3-Q‚ Žà`J:a>9bÀRþ«jª"2+�?iJ�!€"`A4q ¢ f XÄ ÎÀ7"«æ²X¦@€ËM°ÁF©t â‘/CZ ìè7 AlLÀÁÐ=�@À( ØÐÑ€Á€HÃvî0Åxà^(åÂ8ð$Ä„D,6¿Æ¢È ÂÚ‘wÌ(…&åÆ*î…�Øëž`ÁðDˆrâ1ƒ± Q ³6 DÍæèÏ C“ÌSxä ŽÖÔçHL øÙ‰HÁÅŒ”tÓÃL4°Ó¢›©€‡›L˜añާƒ€Ï†6a¤jM� š¥[’ÓZ{cÿóäÄ«bL:<÷v(gÍ‚c|`-™ßEQÀ ˆŠ :G„EcAÁ‚À •âœ�…ƒ¨;äµ"³ùCùË)° »=nŸ8³ù¦g#ˆ1FÖ+ïUåe¯ý¸þoã5w&àª:HI,©§¦½ÍKkÌÒwÿVùV­Û—®[³ÛôÝÕÝòÞtÚJû¾òJãW Zò1å:ܤѦFþ×o\§Ñ�Æ×ô:“Í⎪úé Ýs’¸Žºý€a¤õ~`§ðOfü°$/UHò ‰,—ñÀ‰ØcJ¦ÿ³gu*]2k·�Ù=X ºÞA µ·}¨ÍÕšd˜I Žjq2渑J…íù„8`Õ–G°)30„P�¸SXx@ 0@¦Í 77Y_¶g)ö�ÉãÿóäÄôqÜ:,÷4œº‡j.†nË [i £Ä@SõTÒů%{W0ZQ¬çÉ0£SÜ mfégjC²Š²›¶&.ÐaKoVw•‰LÄ/ ¦–Ãñ‰[q‘ÓÉékãmâ«aÝ�6ϫƌŠÜÚ©²<²Bÿ·Vºé±Ëê:°ªL„(2ßHÒû*rÌ#’Õ € ‹  ÁÑ^L¦È¸[rëÂŒH@bÚŠ€S±„„�#‹3Bþ—Œx"—ކÚ?°ÚÌjÖËTqÌg€ p„$6—å¸Orù&œ}-Ô¹JLAME3.100ªªªªªª€ ¨` *0œVãsp)0 Ç’2¶£ [2•q37PÈ0r Óã 1ì p02é«Á ¨\µ%^Âh(Ý‚aÑÐP@9ü‰ƒR‚A#ŠØEC$Ã%ˆ(0 ñ �P\Ä#s$L*-0ÊDÓ”@^~³!†‹&¸ŒœœHe Œƒf¶-˜¬"bey“ÆmÀg¡±ŠA!1œ@`J š µÂBÊK—iJ^�.˽lwŸU-‘@,òøÈE–Éç2Â`((¸I ž@ɤÁ&Qí>̘’™.š'A‡9L©©.ÿóäÄðq:,6÷2œØË¤ß¯$CȽ™À¢“-h8P­Îsn½›ÜU2q±¦2—�ÝuçZ[o^ƆÏÕ3R�C°ôÔe¸G]Ø­Wmf¥QªÖ¥“u_·¶I"u ©öåYßqÖ dlÝ=âíãv”‚­Cº!"‡£dÊi9 µ0£‚Æ�˜¢‹Y‡ÃåýN×ðåñ . B’ %¸9–W, ­âй ¼ÈŒ™/ŒuA3ðÛ�!!± é|©Ð ° $1y!ýô aaÄa°©bé‰.äê,³€C `Ð1^$C+éh8�S ²‹5_#=€Ô0ä#g‡1O £ÀZ1” s€0 ³ P²0Y¤ÊM5†Hp :ª!)c+€Ë^‹Æ ŸhJ/(€FbAîÛl‰¦ 2:c¡�`¤Du›ÃI…†8Ž�áÓi‰šrH,B�š§˜Ú`A°‘ }•ŠEp*zÔ>ÖeKi@„>ÐbPà l¸¤ÁjÆ [Ú‘.¨Ð°@9Ð¥™,¦°ÉIÚ,—!lÐ}"Ô�»oÜ�r)9ÖÆ ZJÄÜphH,ñ‚AÌÿóäÄÿv4:$Q^ØT ï…Ì b$&>6baæ&aàe¯�·!¦*"`á)ÖZsƒ’ý-ÀÈ9‰Š˜hZ –| ~^µ‡€äQÙt#æcpL¶FÝ]õpÉ'¦^Äàg̻⠩ZP� @dP\tN( I€Á@E¥+ + ,$ŒµmSfÜ*D‚¯Ê„ªv¨Ú«]EEzDµÅ1ZEòuÒ` ÃŠ,¶P¬D ¹šÒt 9f£ÓÚù%£WK™Å¼—MÔ*YV€î±å¿¬GVwø‚@Á-xÍx,Å›hÕ¡œÆÚ8„ŽDÌ2ȈB…„0ð0/退 X/²Õ¿_s5ì?³ðõ=$Õ62+´ôÌÕÇÕ 0K5— ƒƒGLX&þ@ÈBàX-kJ¥ÆÌÜšR¦bZhvkêž’]^3Ei²‰o!¶€ÿ*¼:Ö%eFÁqÐ�¹N2ÕVCÀ¸" €„ÌH XÌ0PUØ }#„"ÃÄr!`±ÙPd.4`bFF@^PXð*™1…)NAÚj„�¦ (:cBËÝ3èXôÕEÍ4hØ$†lQƒT`¥•P0ÿóäÄù|:E‘�Ø " áŒ‘¬€…$ÖèÎ�üžÎŒ åbBÀ !‚åßLv:` ¥ö@ÑÀDà Kà¸9¹ !ÄÈÚ�HÖG…�Lµ4ÕÁÄ�ˆœ€fØB4^ 4HÑòP™J †B¿ÆJ kY`†At3.781s\N1!3„'1bS00Ò –…�Éy�OÈ08P ž€‚IB›'‚ïVÖ@Ð&Ÿ0y¢•˜h0:P8 2ÀÔ9І˜0I‰‚‡Ð4ÀŠ �Hµmnˆò �51‚ƒ]™ áˆài…º0óD'2`fcàƒ¢%¶! |êLAME3.100ªªªªªªªªªªªªªªªªª)©LL�ËG�85q!c¬ÂÜÛMbAbrÔ1±5„nyœ9Ymˆ ¼;1óË ã^¬—Ž»¨òµ'Rjž]-§—ÓFoêb1„!¥Æâ˜Ðüæ7kGi©¡©ìíÇã—àI÷-‡ ‘¼kÌ™“æÒ™tÒÇN˜0#í:f ªŒVTõ] "0&` ³Œ(�°0†  ‹&%1âÂ0Â�  JlK„L1$A€Ìè`ÿóäÄÁeD:Y©ÛЃ¡P`#&„+³!N‚¦É1£¼× Â[Ój�Ç# p(}Þ2 Ñ¤¢ñ™`2fÉ�F0&�ÑÓvÓ*6¡ÌJà ¡`&ˆ€è¢ ’çÉ|(,¨ÂŽ„*\Ç 3[Ã2K†@XDF6›†�i0Ð�ÂDL93'LÀ˜ùBöP äÄDߎJTªItõi/ºå`HÆÐ·°Ô¾hÍÕ¹73 —´sub Ý´k4¬¦…÷ìb qÓdb1çIÊ�uÙ¤¢LAME3.100ªªªªªªªªªªªªª(a0( fÕüâÈ#"�Ä 1"°Ýethê}Žmf`m Å!q§"ÕMN^šÏ:{¹ÛÝ&tõ§Ÿ:�K CQÂÔ,f$V� \0(X08¢ˆ¤›¬Ÿi6ä ø’¥TLbô¬–‚ÿJÝ™ØÝ)èti»)’B—t¸©ÓU"‘ ¸Ž.oÑñ @àK}º)±s–`\(´¦� ƒ¢0Œµ| 2AÒ`ZaU•�Å—!‹(gÇ ŒÉ%TF,Á‘0hLðF9)”"bšh¦Ày(°!ƒbxÆžŽb™Ã„�*ÃÿóäÄéo:Bæt\@œHÒ¦4b˜Hà£^°˜QgLC“‘È´q2œã¦&AÝ�hD‹B2AÂç z€ás<ŒÑ*Š0@HECšbf ‘¿xrqœF´1Pa›Np˜ˆ[×ÂKŒ“DÄÑœ2¦ ˜AP&`È�ë2 MôÝL@0§ž0¦ÎˆÈC&AbXÀ„Weµdª`À)&” E–YÉRaƒ€‚ ºÅšE(RÀ�—F tÓã|™Ô[:Y$À‘YÎrd’ø£~±ÓêîÆ]˜­çÕùš�K¯Ùûõ00@Ñ0#ƒ2Ý�1_�0=C22‰0¼›0F 3E!01A¯0¦B¯0N€0+Àb06ÀÜLZ‹ €Á†m&Ü6õ6L$AYwAŠˆ¥É—M§Ë>`p(À| Ìw Zb„ÆY}R„æ`,I²á졜1ˆ Ÿ´žeᕨF˜‘X*f1ß®FÁ2˜`hÓøñ¤H2iŠÀ©��q‡D.—&ª–»Œ¹1`¼‹L®ÌåÁLfjÆØ†*´w ÂF£àŒ`àpHÃ#—¤€�"œ|’Ôˆa ½Rd P 9ÿóäÄÿtŒ:ÿ2œ‡0ÀQ±‘Ï( ³UÜ� €Äkn$0¨à¡ &rN:(0ãUC]Äën’°¸@ç€ ›�³€!m6xÂ#�‡–º@\i4$JKC4#*£P«T0ÆRõˆá EáPT1UFN Ã`…ÅÇ�Cbæ‰ °JéÝ ÉBK]`°cÏÍþ�à‰íHg)dUÅÆWÊßÉ;tu¥q¦_3w£ümùŽ~Oõ ¦@ý¿ò¹\7+¦Æ%,ÆU*äª�÷}_<–C ;Yÿ}'f9zbAªLAME3.100ªªªªªªªªªª0\0‘Áì5^_3FB‹0üJÕ7�×€0¨0¶ 49CF0�g0u0(À30? 0¸Ÿ0€�0$ÀSà`# Ã@¢ uUWã HE0°QW  2#ÀL:©R5‚À3iœ€�á|ÂX`PXhj0<1˜=1ì 1,ï2aH0#2Ír6×b>å7tÞ6Pù4.$4ìy4`–9T7Ó0¤�5ý¶6j3\#0 1 £2H0ÌËrc Á� Õ.sŽ€’Ü'â�4¼Óî¨AŠ‹˜d¸嘦qÿóäÄìoÌ9øÿr¼8D5¦7��’ 0qS‚âµ– ]×J­¦¬Ìcðå5@²vã[ƒéâmfQf‘ÉêŒÕLdÍ=Êe ¹ººRö¢ž¯+o5"¦�¹}Fbó?NË#|¡¦¶ëFbÔeú„3I{r›£žúí _€ø.+ph»7¤‚�Üh)bðÔn3!‹¿ñ+Ô»{íC×ýü†œæ–óǤŒ¶~´e‰2æµ”žEJõMGåTóëµ>®Û‰eä�=îë½0ï¾0›]~šD5^,C±ÆÞÄ¢®Ô6ÐoÕLAME0Ä�1´DC:¬ø€1k Ò2 ë5­ˆj1ù’2†N1­Áè0yÁš0¶D0q@\0oý0GA0Às0§‚Ã0"€{0 À0O@ 0 €‘@%Ë~` �Ei^  á�›Bq‰†„»Ð± p<Ä� Ã&dZU'00”ƒ?4ŠR2<8ƒg1×ã3¤4×/ÃqN1vC™P6k“’30¢0¡à ¾e‚&Z ã%'�F–ж)ôºZê/�Y$Ÿ¶¼ Fã\è,b¤Îz?™Ry“˜0qúÀ¬´m†*9m¢›@.êõÿóäÄûs”9à_ØA”Õ{Ù"0)ЦN&•EéNU J�d®Ò ƒ–¶0‹°‘cá•9γFH|ºÈdD€I`a)Õ •¸€[´2ã­ÅIwÙi±¶èÆdOëX”æ­ÌdŒIÉ}W»W�z_ŽXÀ ·2nàc?.€àG¤e¥Á0$]Ò…¬ ŠÞ,½¸rËK ~-YP/fî¯a˜}±º9'µ—%æ_òubq£4tÑÊÄZä[':É'‘Bdï¬;^-E�Ñ¿”¯¶¼|z ¿1wÕ@0 @ô®oÜ·&3ÑRaØ &/G^br=Þ “ ZaŽ�˜� Pà €h`J0r71÷ ×é¹8‚@,¹@ d˜A2€b(’øzIŠE�˜d7f2¢ÞbF&A˜þÖŒÎê pÅ€õ˜ˆ �ˆ�Fü�©Œø§˜]� ýAP;UšøGG±.gÌDCÁüÌ@ÄÇÐ_Œ<‚¨Âh+µØìû¸÷æY½\wXqt€bž#æ(¢þbÖæ·ÍÎ|¿Wìãµc0³ÐsÀÀ‡@0A€ˆ˜€*”0 w.4`"¦  ¯Ì@ ÀÔš0€!14Lf@Æ)ýJ1‰áɈ%!„ƒA…yÃ2YÑ’ù–B(„D0ÄD,Gƒž&<FæåÄ0 H¥¢`È(`ø a0R­æ‡Æ�Â�Qƒ9€ à00d 08]0œ 0ˆ0 _0,0ˆ12¼ 0Ìf1än00L4p2à+0d03‚1ˆ ŒXÁ!áŠA˜K0àƒ1d0(0ä410l™0ì!0”0Àfà øÇ@œÌÒ|(@`@@)˜D(…Ã# Ess"„Dgdñ!„ÿóäÄâ|KÚ<�èˆ&L- Gƒµ¢ÎD`0¨V` L<#4™úS˜;˜£˜æ Ș@¥aJ€Á…`H`„`(¦€êÊ0n.#̪Q*9&%Ý0p+€AÉ‚ÂH ”`Ø\bØL.Ì ´D4dK˜²N< R¢ç|C)45­^½.ÌL  6D ±��q‚À‰ƒ €T-0Tb|˜ w%ªöXbë4ôÚfML·4ÑÔ©€^X –jwµuAûçrÏõÎm%aQ`°Íe(ˆPãK‡d1¶í+yéчj8ku²¦ÜFv´Ôj·)©nSPâ5n¬Ú´ULAMEUUU*‡qŒ¨ÑêÕYŒ�˜9­¨5‚ù„�n˜³‹Aˆ g˜Íñ’©' ±–áÆ�!�ñ9áñƒ8”˜hØ`liက˜8a�;•AàˆŒÀLÈì³6� m4œÈ‡³mÝ΢0útâ<³°ÍÌÁ5“øÍ` ç©µ ær¨ T„ �„ �C‹F? hf`R¨ˆ&,Z1Q4 ì!–L$K ÜÎ``ù�‡Æ ˜èÿóäļcÌ: ÞàVL$H:HsrG@Ly¯¤ó†½Õ¼8F(„ @)$�¢1ˆtHrl$ÊL‡©U"ù@̾D tÒ_ê]û‘F»O•ŒècòükMJ†±Ê†Ž’þqh~S?{t²)úÔÔøLrÕ5õ=ü÷•ë¶{bÏÛÃêeI¼÷ÚßzÝ»ý×rú}ã[ ÜÖû—?óË:L0”W©fµì&ò±OzžÕ[ì^¹�N}=‹ºÂÞ÷jõmk8¥É‹ö§êîU–ù?wùo•d””°½„CvlªLAME3.100ªªªªªª0yq9T®£(P%0Ø,ÓH‘00 3òŠ0Eó,r�2ÞÓ B3ö%Ó !�4_H3aƒŸ2Ä=Ãu�^4ÍÑ:U°4T|62ä1Hm2UŸ7¬ä24N5!’3Ø<8#0= 3:sÒ=!å0í·5¾i2 ˜54¸4|(3¨o2Ð�1”C0È›1œl101H\2LX0(L1ÈU00|%2[0Ø1P¹2xc0�S2tÄ1„>1l¢3,22¬ 1,è0áVÇ£#†AâÀÍ@ôÀ¤Ãr ß 1…�"S4¤ÒJ6bŒx�ã€À82ä€ÊÈËÿóäÄðpä:÷t¸ÂÀ‰áV¦^Y–08hÔDp6þ P¶mm:!�•*ÂÚuŠ­h½ŠgšfްV°0š´q©Sô˦#’ÚX'^ {(aûôÐ|û­1Ú¸SÐãI–W¦ªT‹UÖ4òØÅŽ_™¤¥¦ ©=O7M† ÇÒz]ú'÷¸�ÄÌ?Ñ9‘wRÿ³¸ÔaÌÛÇðKõDÖ$pLŠž/C1*}aªEpqrߘ•\/Å©é'á˜j¼b/MÝ€é (v…Û¦�ãZ–µýV�?37µfýÙªLAME3.100ªªªªªªªªªªªªªªª!L€À$’ ¯ÛüÁIŒb‘@Ĭ(ŒFÜÈðLÀ< Ý €ŠcR¤F`<5&ŒBîa2;fiï®f`%FiêzcÞDàb,.f€øct$ÆáD`œ5FRâf`ÈIFH'¢c€+†Z¥À`L F3bîe•aˆÈFqU˜tneѱ�fE˜¤ ™†a4*c�9€Aà‘ŽÀ¦/ ˜è&™4(`Á�ˆA£“AŃLê54P°ÍDꪄsƒ¤ ´¶3Á-1Œ(HÌR!0@ˆÂ‚à †@pˆ2TÿóäÄçnÄ:÷˜`d�B¦k (b¡‚ @À€²ø3ä(`êrù»-ϰ·b ‰DŸùYMõŠH%8ÃÖýÃîü}çgåÃuâQ(CEŽÂݦ±3‡¶�û©NÄ�BòÙÍŽçΙ¯C\tYD”úDZ�ÌPX1?Å«ýµ>º°Ñ²gØ\¼’P'l�C�Á ©A/‘¼S%¬˜,î: .•¡óLT0P<Ê„!`!“ˆ@䱃ÆA •hÇ©3�N=3¨Øes²Œ³9Ž®p6Q”Ö%s"ÌJ�0ðÜÅå° <ÇÀc „—ÁÃÿóäÄàlì:÷@b�°à R£3QÐÈáq][Ë>“¬-€H׋\¶Ø§áˆûEÊ} øD¿;±˜u1m-UnkáPBªªþ]¢tŒ"NR ° ö-r6ÍÔ€˜.ÊiGå XÖò²ðüºñ¯K°ÈâEC KV7ª‚Á)žå�·”ý·‘>_0/ái[+[²ëFñª®»(%U‡$B-Ü9^�R; ™Ÿ¬©!„�zÔ'Þ1]Ue —IâZR|.�Q�¯#ºG8'¸\h©V]2:$6³–R<õLAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUy‚(Li¸ñX;ù˜& ÁŒ€W˜g!‚ј¹‡iŒø4­ˆˆ­˜Õ وؙ1 –86w!—p­¸‰¸w˜V‚á“�˜˜ ¹�تgi‹è–1˜‰€X—ØØp ƒ`Uš9IØ€‰‚#ŒD¨”d'ÁQÐÑ‹‡ °8´,:" 0`H©†àT ~bªNh¨XL5°ƒJÔ3Ã^¥3õsZ'3’s%0b´¶#øÿóäÄÔiä:ößqñ‘‰„%AŠÍ,8܉t^5¥LT6i±Vo3A~¶ºzÈñšëMLÆR™'j¢ðLÉÀ¡A79 …b¸Ÿ&Ó4~)q0T�9q²ñ`"…�8À›ŸìMï[ Câ5¿p´ì­³*™ŽiÕkK{tÕ[ºa�X7‡E+[æµ[ă¨Z€¦p„æÖÛ•Þ™ã­8æ+ÔJéˆì؊V«£ÝRä­ˆ‹9[ÇîФº¹½±:¹ŠÔ¼Ož0(šTÍ*Õ—L,S©ä:ãôƒ‚**qëÅLAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUq°h'0 )Á€y˜|�©‘/˜�q‰"�°‰˜Ÿ ‚X`˜¡Š‘ƒ˜t„…à•™—1…!+›O•qÃ!è‹Áœ`ÃɉKQ°Ã�‚‘–g©¡‘q£¹¤Ø¹ýsaÄ`qÀ"‘•å©¢cQ� Y„bñ�A!ƒ‹‚*„é`@¹é‚ fÂ3&�JT$ T À4e¦dé¼:,ØÚO1Ä�4³¨ Æí3óLÍÃÚ4ÁÊtë›P† B`p 0Ô>f`�CE’°Æ‚}ÀÂA ÿóäÄÖjd:÷t¬‘Ä’R$!œõ�ïFèoÉaP ¥®¿­y—FÜ)Kp§ydnÖþ;°EW’I¾ðuÈ gLI‡5çuÕy$êVÔBE#ŒÈÞV@Ò&Äû¬W±|²—MœFÜGñ]е8rFÏâÎ�V éîm\·EÇ©ªLÎÆê?ðŽQ×#¬!‡pDNžGIÊ5×ç“=¼üÚŠç.ä5+—BîÐKdµå1×n«ÆØB Ö°–OÏÓÞŸ™v¬J,ÊZÜ6ã¸ínVïÔ|¡é $¦=V–)”šš€¤!…LAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUL€$Ê ‘Mý¤ÇØLAüÃü·LAÇìpL @pÌ>Œ.ÂÄÊ Œ&¤ÈL”4.æpÉ¢ch¦’¥îa¼å`Àæ¢Þ`2"1!Ö*/F:à^`¢;¦Á4`4Š&L£ðaŒ.f=!¦†€t FR>oá¦.l!†6m£ÀQ³K"IóJ 1ƒ* 1AR4ö00 !“ƒˆÈǬ Ôà� ÅÔχ AäÔŽ ãdP@ßFŒœ€ÙL ÑC›¡™„‡—¬ÿóäÄ×j´: öß *Ž¥¦@±`�¨1‰˜ � U4L0¶vr€Áü^µåª¥JíDý‚!äÖŸCZŽg$ôx‰âvôÊ7LcÔ/ŒÑâ_×ÇA.§Ô‹+”é£P‰fÊ¥Xn®Ï×ÌÑȇ+Œv© éê™òAD)G’¹a9•ˆ$I¤¡nGÇn‚¡nÓ{¶y“›mïZœa¹ÄÜ;±·³'\["°5î‡Q|Æ1‰ÏÈi˜Nhä©.Å úxÈbD ¥9$œê<î§ÂœÿSŸÈaØÜ~8$âLËß·±ÝLAME3.100UUUUUUUUUUUUUUUUUUUUUUŒ$ŒÆï’ÍU‚À‰4 Á€È8L…ÁÆÑŒ-„ ÍHwŒ<Ä�¢L5Á@Äd{ÌH”|Îì@ ‡ÖØÒ,)N&�L`> :Y�q6Ì'H ‡'Ì«lŒ×# o[Œw`Í�>LµNva�J��*‡ŒëYL­Œt' œ ; ( @ÙA„ÖE� éóK1¢Ã:?1ÁP()�˜¹–,ãWWŠ™ª²�ñ»»™¡‘¤ ˜(pÂÃEB:´Z¤Ñ·Rê—$·²¥Â@u @À0\Y BÿóäÄàlü: ÷v¬v# 2�‘à)r#µP9¨%ûe/;Ýbsî×Äà,äÐDZSj§‰¼ŽêF …ßjXÕ› �¶9·®™iÕX�IlĺRíJ-ÌM»òYLj’ÔFô¿�åÙ ÃcŠ07íÝràI¸ü]÷�áønUCñû’ùØý-bK+ ‚è&wCo¯L’;'‡e3�É£íWúp^»ŠPé²M¿Œ5»0‡§!îry©L¦Q5Œ?ò‡Ö0ëP¶ÔѸ!÷|&f©¨¥ò¨þOM ªÌOsqHŒº"LAME3.100ªª¥8³¡Ó ˆ ³ TI£ CX£|ì9Óô%3¤ƒ¤@ÓÄRƒ Ã$B#+3È+S–ŠsXTc18‡S:‹p`aÈØaˆ b8àeLbÞaX„f¹°giàg*ˆqü(a:Zt%ºe@Äa1œ¬†s fˆ$Dɉ)™°Š"ƒ@Œ$( amév–ÐÇÍ FNXaFæ|Š5a¦ÆÂ”o¶6|`„æ `! }�!*Ú™G¡ÆfÍŸ )–%IB—ÕŒ¡À~“b€f̀ÇBá@tÍ0±a —ÀG�ÿóäÄôqÔ:ÿv�‡�KÞ­Ê.ÜŸØeR¼ú™,ðp$ëýWŒ䫨[½+.¤Ë&£u’æ\ÑÆ³4çCðÔ�Üt\ft� ÖTÜÚTZ4º' zöoD\gê<ÔË)‹,¨’ =ð-Ž?L‘ÖdÕ² ©×#wR†ÝÒ€Zs½ …»+¿Ü�œ:‘êgÒ‰ô{$.„¹Ð}\ØË³Vë{-–qÙˆEß×á¹»Ôî;n�ªÃ²F)ì².úP»Ð#õÌÃì9ëiQØ\aà‹Î5™‡fe¤qˆÃì±é‰EmOGªLAME3.100 `“‡üeJ>bkõ\a§ $g“Nd’‡dÿ–Æa£Rc,aŠÐaË‚n`[¾`¼a_„(`F�Úpð&=€b¯&Jâ‚h¥„)æ€&03  ‘™*q’‚‘¸ù³:™ÎÑí¢vy· À „T8¤óeêL$µ¸ÈÚŠò–ý€°€¹ž1Åš®®@  WqÌ¡`®üaýGPËÀ64àX!`±%Âó†R á ·¸;jùOKÁOBŒíÒ·šliVBWÃ�UE\»ZÚ˜#Âv¬c9Ö(‹ecåËØ&Ä”€Š�H(}|ÿóäÄörl9à*þð� )^1$5Tël ª^uf_‰j¶¥àÊTÄ ¦ª´Ý ó0òâ¢ÛwVÖ° ô,Ú¤KÐHDÑøˆ ˜ GÌŸ)¬ñ†4À5 £-( €<ŒÍ¯$d3,z°yhÀ‘EÜF5�u½BÌPÔCLÒÚ¥‹LZ+…‘¬å(J¡Ð/WàîÚÆ˜Ý€×]½ �Aß%à[ž©¢êW§B"&»ø”ƒHXfeHù9h–‚Ž“iX†ì±yÆZÃqPÂ÷ ÒòXD¦éñ ¿îõ| “ Ì)ãL³˜è˜“däc<$bƒ%HÃt²ƒ¬<Tó ”B£4ã„óPS¸Ó` P¨FHæ( ,ÑjÌà̰ÐÕX n¦,ØÚ†¢ MV\œ€3ÀG'¹ÈM0Sº¡¸iyÖa*ÁN¡¤Pqì pŠˆ¬ `hR„ÈÉTšû –º–0AÄËÒY@iâ€Â޲- �– Y€¸ª¦¦ƒ¢iš‚? iAë%!Ø]¶"/Ù€”“˜‚´Ä� Lô¨‘ i†­8ÐŒWq™AÿóäÄÿu\9Ø3_ÈAs“ËÂ.òZ¶Eï#T ÀÝP=:Anmi*Æ‚DP0fx©"†é~Ú'šG)ƒPUl†À…©€é‡U T@Ü�H‹´•ˆ™€ -jÃÏ 4Å#ÃĵWÕ­2AX‚±«(ÑŒ¥¼cLž0ÞÄf… ª0ˆü3èS2|!0„“1 é2Äg0ˆ&H…`€HÏ‚ˆÔAødMCIC¥é³‚Ù4Cf)&`ø‚0S( 50HC€n[ pöĄ̂z3%p71L £H2Ó-·ªi¦N`&  j`’F€(`F¦væZaR9†weÂhg¦a¨†L®´Ísp/-±€°(dq” I„èH\!‡ BH�8'%qyÎêr\·½ù}HC°`Ö ãÀ6`J` @�i�¨˜teøÆŸ’Ñ=04ÏP7ž94Ö-2S  Œ&“ ÿóäÄü|,:�ðy�`C„™„ˆH˜E‚™ƒÀG¯ÐÑQÕ·¸Ì3Œ<ÍÔídpü7…>n$û5ဠ˜!1�`Qƒ('˜!‚(`/˜ € A@ Yjö7/µ,¥ûïs’Ep¦�èNjhxGø~Ï0Á`u9‚`#�É�¸‹@°-˜&q€8˜ €Ùƒ0h €"Nå,Ëw-c/½y÷™~\þF%ñ˜Û·/˜³�çâýKôVr¹zƬ„�� ˜�) úI5Ñ`1G¤¬°0Pp¤;CcKí ÐQLåˆ,ÎÆÐNÆ™IŒM8䯙M¸ü‡NCüõ7N™èÁ M5èÜÔ 4Ï L×Í™dŠjQ�áà ùŠIÆ[,ŒÀe1�ƒÁ Ì 0ДÂã� ’0P`Ĥ#E¥� À7*˜êåãWDLhg4Ð Ïfƒ;¤Œ¢’ƒ V* M�7¤Ïc†Œ$ 2€üʆ3ÀÁ!À�@ÆUSFÕ†Ó¼ÒUқŚ-±€@ Š©z\Òä–U3W \£H $ *0lÂÂ3ÿóäÄÞoÄ2(ÛàL„ PC† :0H!£Q�A…‘0 ¬5n)KL`EÆKRÈ€€¨¢üêvƒ¥É�› á,2'‰«»**}˜’_+¦œÜ’)LZì4­¥Ý-ªšºˆd€W19“ È,á«k4/j|§²?:eÝH–J¼”ø\̰®–"ÜKª Î™uKj�¬5aTˆÐ¹2Ò¦tï>« Î�èi�5潜FŠÍ7Õ´iÚŸW&[g+]æ2˜eÉ�Æj]œEÚœ§)ú•Z«;f$å;P÷~·nÒÒÒØµºÑ'eý‡owê nAo„y¶V§òA™-Vnñ¡�á�˜0Æaó±�Â&51Ÿžde£æp™*F&‹—›lh¡é€ 3¦$ËDÓ@€AÀ$å �†‚ ŽP.¡’f(*b†„̦@Œ¤cÿá˜çƸ[™?Pi á”PÆYF”¦‹$p¦fÙ…Ìæ£(˜œxqæÙÍjfgAˆE€öeaÀŒ <| ,Xƒã�%à/ëQ/òÖ"¹�zƒƒU‘PŠ™)‰XÚÌß<ÃÅÍhXœ1` 26 ™­ ÓŒÎY+ÿóäÄòtÄ9üFæñ„7PtÂTë`Ó‚S¤Ò4ªPŠŸ^ÕØHðRP±–ƒ‚€g”�Ý•˜§šé`¡ÁYŽKxÇÐyœ@RE¤Pˆ�Ñ%8Yíi[¶¦¸b(„¼Ó]©®FÊÎ)šÛ±2B«bM½ÅJVZ¼Ö­¥ÔÁ©a²Ù¬²¶bÞ2ðÅHøÀe¬æ>î§jÙWMÁ�2æŒ !¥E¹d¢~-UK[‹_�dN3¦ ½–&"àƒŸd;2¦¶’í=5žöÝ%Ûƒ/pÕ™#×cÂ~bþcá `èn`XBŠÀBcÀ`lH@ ¨,˜BNÒœI˜ft™2³™⚺“œŒ1‰¤‡^ 'FÆ#�†·�F�æ4–�¦\ †‹fæZf ¦@§Âަt¨F&.³¦Ù8€˜Á1�ÃahÇ€ÀÈa ÍÃM!ÄåRMI(˜ähìÅÈ”ö/±�¨QŒª¨B|ÑQŽ8Õ UêÏÿóäÄòzô9ìîó„]PÙLŒ€¬ÇÌéÀ,L@Yóh²î�‰â"‡—�.Q§ Š€‡*‰@šJ�M¦EBZ¤XgñXidÒás´ÅV~ÑÃ@:|·$îSÍ%àbÍ…|¤ãb.Óu¥±²tÆd2úò«—¢4ë 2&¼ý06b°ð3= n®Kiδ¥’;ÊóÄå.²äS7>Ô MnŒÁ ¹�4�+ïl±ù[´Ø'Üȃ™h*ÒþµGqã�[ËܱªÐ¸Mô6á°XÛý}”EkÃjLAME3.100ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªª=.ÒmƤLj$àS ½>gG攲x/H4D—¡!¡Á:¨"¦rK:cH&~"L‘ƒêFßv— Í4äf5È#AB�ºlŠ¥s+XÛ�36šK!ÊCx²ÊDG¡†µ Žçj)œôÈ6îÀg¢1–Í5Z$½�dlC¸ù›åøXÿóäÄ�Y:>ÞøË•ƒÄ†Ëín³ˆ)‹;ñÙ%Œ[Q¥Àßt£.ä¹F˜äøªI.Žõð‡Œ¸¬ñ×B’Úe/ÓÉ,uFá =΄ò§<�”Â8ÊL¸Ÿ0ùÚLÆ)YL—®¨•8T„úÂ=hL ìeJ$醢4�Ôâ�…ɱœþ*´OHQž•x�XK›†ia@—Ô1 4´]¡G‰¶|)f'§ü(jeÓ;RÊ>bF’ s�?œJæ��™D$&ò’7Kº˜°äé [Jó…µ8­2ÎÑÒHŽf�qhnfLAME3.100ªªªªªªªªªª uA#cþ3t3a:1n“/Á½1ˆD#r€2¶ Ç5á£Qš0¦³˜q-áÕHœQ‰† 'Q‰ ™°¢ºfXV`EfOÔWªl%fv d¨Ê €“þ”‹ ¼)uE >!8Å8?`3áï 8èPXœ¤h”:'ÑfY´¸Ò±T,Ñd9 €ú¨œy$$ þš˜r÷¯Ded™2CÍLãA(/�"ÁˆT1Äo��¨‹l€•ò¸ŒrQá9�8)ž ¢LÒÒ#ùwÑma "ìe ÐP+Ef¨ÈÑܵÜ�㥎ÿóäÄìp9ÔôöòT¬���ËœÙ{rY�3âÓâÈÚÃà&ÌœsŒ®še^˜$¬%³±Õ(Ó‹b,¦‘IépÈI®QàÑx�PÁ,X%eAß·€,*t…C"•ÀÌ¡Æ1]�Cbü0º0ó)RÙ1‚+S ãì3 !ó00L3 ±b"0# � 0 dö0%É@™À€Ó†(á’gÆ$fÆ1ňi)�v'¢xj˜óGnaãäŒPÄc’dÖXŒ1¤‚¦,±‚ˆ’_¦åþTpÓH4Pa4)aJÚb,4ˆêŤLÁʈA2Eå,y$P1S/ú‹‚¢aÁÕ¦�nK4X@)š‘( KDñ<)eœ!ÅŸ!ä—‰†sn›äÅ5¤ÜHàHe%J(挰P RH„@Ó^‡aÔ–@•@�ÀÊÿóäÄÿuœ9Àö²Œ¦8±*R�íÈÇ8xa…ÉDfæ2 p²„I‚ 4 ¾]âaƒ� ZâÙ€#Á˼+ŒÁ Z Ôˆ0)Ú  !Œ ±4�JJ‹@YM w¢IXq/ù¼p˜HFœ¥%$‚4+Á—tF-—Iß]‰Ø %þ›D¡ç—9B(¼�Ʀ9ÒFB±Qy5!�—¡1KÐߢíGD9{ÐJ!X›LAiÕ€A`•  `¥,–èv¦â(T¥ˆ uÜÕø¥Jv,` ¥P”~4< 5LAME3.100UUUUU1J ³n2�ƒ:ô¸Y1i�Û`sñ.L˜' ¢ŒÂN0ø ¾fÍæ±`Âà Œj3cIcÁà€Ä« 4°�°_©¤2 �“J<¡Øy†eƒ<ã! ›,=!/¡‰‰3±ðĈ̬¤7 !ÐFM¹òBˆ1a¦i¥!5�/ƒ,´}dD .Ÿ ÑÍ ÈGñ\¢$#–ÅU*×2Ee¨þn…Q]ƒ¤µ¤Š†×émÒG�ŒKÐá P)XÁ¿ /A "Ê0!Ú©úB:q¤�%W ÎÿóäÄíp,9À÷2=ÍAÕTš!AABðB#Ú™qâKµì�–’'“ ©Ã $ªE0†âÀ]@qâC¦³>"ž…ÃVØp¡âРDkH%-@��öSd&4ERUÁDṞ$ê}˜b¤_(ƒ WŠ`©R J¢&C*bMy¬(0\� !Óİ0Ip_rA“”¼Œ6LxZS%| $T²”#.X8¦*àé"#Øô[œ²Þq©y<À˜pÔ{|STxáí-LÒf\ 14Ö¡{‹ÖÐ ACº0¢OÓGã>1F,£ÁC2Úcð\0ê S `®04ãYÉä;MÌ™DÄCÐç°4D p!@xÁ  J ¨!°É`A!R‚8A&‘X0+Ù’ÈJ+DÐaayUŒÉYv’j"$à:Ài@b@྄i*RòE—äØ Xs¤Au‚"@ˆU 8[³= £fA"S/ [&D‚(:[ ~d.€’ÀÀÒU˜J8Á ŒhS8àcðrI˜4q7Íd¼@CŠÃŒ´dJ)KŽðˆÎA6#Ãp B Ñ‹°=�°hm­!º’CÒç�#ãÿóäÄÿwÜ9¼ö²T:2(:åÑ,è9‘ç\äA$T'sb8+âÁ ³_|Ð@` T= R±v¡ÀÆ¡ef ÃÂB¢ç 4d¦@ˆ0 CgG H!À!( A€Ö†�mq…Ç0Á Æ,Ù@·å­1U@1gÃ%d0O3à DL/@ 1$ÈV1¬Xr-E¬Dó’þA E0’„¿«’âŸICRÕ.±¥'„°"íƒ�% õ*�&0Ý&\¥J[BMR@"1ÒÊ��ar½ÀPÛ ‘ ˜# ˜ÓuLAME3.100UUUUUUUUUUUUUUUUUUUUUUUUUUUoþêS9Ž“u;C€-…ÓƒÃÄ@�˜ˆ 08!+ Xó€�¡,¡ƒ€*c€�f!¡Á¥âZ9ˆ†^D ¦IC ’Ï&! 1ñ&€Ô¨ ¦-X rmx ‡$°“ʰ A��-)õ˱°>€¦Š[BˆÂ8Òþ,ɃšžúR>«YéÖšIVžÀÁ -ÓU²š¼Àëƒ3+ $�HõD�ª‡Š àÛËð wRuk+áԔ¾áÁLU ")ÿóäÄÎh„9Øôîp\mÈ,¢0”ì©ÉXÐ)t €)¾D¾Ô~0ºZˆ UKWlQ­q2‡ÊïCEÊT­ÞPÞ)“Œ� @2Xq5k3–VX{ÖŠ¯TìBÒ�«YlßA⪚°6�s4AvÕ‰£�(h nü2Çuo¦rÙvZ„<×™*FCR§qR-„‚Yku_/{œï§2gL…aÖ3“ kìC¢ý*»c©¾‘QŒ#üôÀ ‘ÍvØ“C\‰|Ãb-Í�¢#þ¾PÍ R`'«`~›3?¤JïLAME3.100UUUUUUUUUUUUU,£$�Š3!I“‘½(Sðp³ °\C€tÀÀÐFÉ&"B8p‘ŠaÉBb¥°˜h„i—ˆª`eÅA€Ì‡ >BÁIG-R!j^!!פ9wÁ¡—ÙE“Jì›3ÀAD`ˆDƒFªQS>ÉŠ¦"Ý ¸&i‘kDd8 …†Ô³Ñr@‰OZK`Hªr÷—<»*kË›Õê‚ä%R–ž›)ä^T´/ó|YpW’_E•�´ U(+C§Bh % ‡p Mâ�~¨‰¤ 'C�ÿóäÄéo9È2ö°|]‚ÆÄ9… 2*´�…×5ãa+”½@ለ™ë¬jÆ´‘‘ �Š $ Í„  ÔXU�!J39U31eXP (y‹Á‹¬rö—‘éÔíšCsî"̉,³Ó4%þ”(Á…”³�AH„ƒL0pGCäÐm¢ÉÆ¡DY"„,–žž³ËåÀ.ŠB�R•Ú`hÂA!k p±ûœ†ËÁþu�!@ Ú±"ðX¾¬J¦eì4åaì Ýb(�¹¼ARá£"qz•LAME3.1003a;CÃÈ4¸#ú¢£’DóKsDp@Ì O7Áª˜'™O¤�c˜¡F¸�DÓµg‚´*‚XFÁ‡q‘¹k y„ï2Ï-ÀéEÇ@`Ž"²¥ë˜ž ¾e„ThPÃÌ!IÜ“Aà-­Zá  ˆä\ 0€ftLØÐ¥³@˜ÈÄÃ/¡(\q �ž$AM4@0Á4Æ$íÌ"…•(ÄH¤©RÔ5 žÊ[ÉBË*ÖˆŠaA‰´`2Å”³KüXS(ðÄŠ(dd€”ÕZVÄB¦Š“’ŽŒ‡é—X. Ò%MQ#È–ÿóäÄör\9À÷r >žËDÑ(X6bŠ, = .úe¶Jçņ¸¨Ì£«ð@ ð(t` {9ƒŒÄ 8¸«¨‚ƒ©$D Yz‡# jE0H4ƒ`â2 ¶ 2Õtµš6�HJ›25¦é—%O—( 2j¡!¤€—)KK€4!d‹„PZŠ8†hÁ 2áÁ@̨B À5N™ú>•PÖŽT"HV`€‘†&y,‰9§È¦ �–0 �†Lk“J6~k! ¤H`ð3fJLAME3.100ªªªªªªª nÕìåRdÃZb«4d¸¤h±ve±beA aèX`¨Æ^#�¡!™ LÄ@€Àƒ8\20a@à |ÁU ¬HRE@ƒÏ;a7O, Cu’Ø@A4ÂÒªxO8G�úuœ4;IA ðàØ„d—¸Ô®Âs¶šÁh¥Y˜Hâ]!c´$)z ¡   (:èú¦hr##ˆ‰ép­b£N²›LF(Ò �ˆÿóäÄïp¬9Ä*îp¼5:9£ €i0a ;Å£”˜\pºi ‘ 9–¹tÕAHTŒŒéU—37kÌæV–ÈZm2Õ\-ãDY¸qøä4 òÖò@S1"’ ¢/ó*OVxÑH¡Mh(v$M j6H®…�Ì¥>�Í_ÊÐÍМ�@°…~É@SÑC!´ŽQd��¥¸€È Óˆˆ:!�–X1Ea$(±Kš„åmઇ„1”†E$�uÁ�hë�  Y‡S ¢x™X›¥Ê„§ÐŒˆNYá¡ :µLAME�p}>lãän,þqªjfŠždAa9XjidcðxzzB3áD¦”šR,À :¢D¨1 #2Ì΂4Ò áIºH* Ñ%;0W 8(ˆ\E¶^01‡ë HDkÉ™BåëY¦I· y€¡qŒñ¬14Ç2‹3 <|™®Ò!@¾˜²—á²ÀW1·8.‰@ P¸á›!™àŒ"�bÔ2H‚ Ñ¡äÆS`ŒYÉvb†Yo%0 �UH!`#@šÃ=„�‹Á7D�y}L0$e£Ž ›Æ±c*™ &\‰B“TƒÿóäÄûsÄ9ÀHî²T p¢¥Ϫö*™I²DSOHR#ĉ¤¯€hia¢´†…`‚H˜¥KÔ<¨°ÆN‘h`ôgQ-)…¡ À©j¢!rK–]LH“JÅî]ô4DáaÄ­Q4�Ä„R–p‰Eè\„´ñ Ç“’#èÀƒ',Û4–«°±€CYfàlÀÌK…ƒ( 4L ‹ÌèÆ¤ŠÈ,i¥b/øò¥¤]#)#� (i¤ (=v°&À 4Áĉ]�z˜"¢"(¡l‘Y­a��D(JÐàââ1†‚1ªa#&B�3*9<°�0£  ž1�f婃 f©“àRt d’ ÆŒ¿ ¨.Í@t&¦S©>mž¬è˜ñ¥³;M ¶la ˜Dƒ†"D …�æD„K˜/ðŽ4ª˜�’ðÈ4á�*yÕ1¹02#›”ŸÐ„¥E$Æ8‹teäe�€ ÍVÌ´XÐQ3HctRÁ¡œD¸.ã<ã_², ¸ m²¡é” ”À ED=Zh��,˜€e+"ù5ÐF‘íyFp �Œ ( �€T Q)Ì…“œÏ$,ZZ €L XHÒ ÿóäÄÿxœ9¼÷2(é~“å*ÑÜd.3xJ(@B¥©Š¶+b2@I ŠëMÜ`¨FÑÁ !XˆRá‚@x@Ψ)²¨f¡Ë¡ �`D 1Á„h2ȱ…×°Š ¬ ¢fM"† Æ ±É F-Ð9È€Ö0i4DDÃEC‘0$\©KÐ0HH ž2QtMPÁH�‡$ì/�nÒøÆÔÔ%5E®´ód(Y¢Â‘"„ñ† 1—Ð,WÑÎð1ÌÅšz°¾ácX9PQPÛp±ö*»LÐw  Œ•Ä›6v L¼h©Ê16cSX‡2Ò 3_¾ P44– Ò'3‚Œš:Oë˜ã�™žqˆ"}£ðèâHoH´fŒ'Dç1—B€NÛE0117™€11t�õ ÁÁä¦ú=ꆈ 1€-q Áœà‡� à,P„\À j]’ IAB0¸awƒ%ІÊä”33<3 B ¢GÀ 0b¸yœ-À²¦&3AÅ2ˆLP)¤ÃRèʽ€Ð ³ÈO0ÁH3k1‚p€¸(Pi’ /· êTƒƒ @¡«µÐÿóäÄïvd9¼÷2c`®` ˜à¤ÒT²”®Ig]Þ<¤©º Ú�àFBÀ�L ‚ zgìTS¸¨þ‚Tßp,  Iä–iåC†ÁSö“N§’¹‘)[ð(Å)LP˜„  CÖ¡ÍŒ N¤#ˆ+VvXhg áÁˆPBh)2ú$#-ß-HG€ ð%ØÉ)E0\ZPRÄ e†l * éDjn¢ÃËL‹&¡Àè€Ç˜ #œ` ° ›‚�Ys˜ÁEÆ2‡-p‰F¼”i‚r–ž£X„:ý Nh"^* ¼È ÃD¥M*DŒÄ�Ḃ(ÆÐ�¬À #Œp„T`æåXŒà�!�g–ŽŒ6ƒ `�ÀrȺÎL�¬38ź "š,Zq´±dRÆèHÌ@…¹ P ” aƒ 5鸘ñÆ yÙ28ràJ†BaÎD£XE e‚�ÆBùf€E�Ê€ .d΂S!°4†ðÀ¦N!GÅTÀ ˆDˆ_F:Æ{É„FÙþ YR@h²¢[®Öž” AŽ…Ap”„ÀQFÈ¡�)IšóEÖ1ÿóäÄèxä9¸(ö²|¢h€fŠ^R¨aÀ "ˆÈv2…Ü-Yx†K�I°±¢‚ \Å֢埑ÁƯæpˆ'ªÌaš  “J1�wKB R‚yÈ‘VÓæbd€ÜP€$Å ¡&X%ç.XT1  ¦ 4i1]}ZùwŒ Ì\Ç ãløn –%˜Bp$D„5 ÓÞH | !3Ä 'I0·"`.šÜiÈØ‹(à]ѧE£^‘k ,øái&‡ÍQ Ç‘/ë”ÕÊŽ 4 Œ­q/Ψ°Âbë»"Ý &ëX­ `Lè»ÂØêô8²Š‚X 8j;ƒ ¤!3¯Oî0GAŠ0 ó$TÊ$b#V�¦"A �) TjF™Ãàfƒ@!�ˆU”I3"ÕJaŒÑÁ�Œj³v³VPFhÅ`@·�>™¯’€B”&R ¤ä–ç³`A#f‡ˆ|Δ’Ò™±„ÙDáБ ÎË9x°°ÄF‡m g>$9eƉ15 (©q@Ç•X%1™Q„2-"ÁÈ@ LÈ:LH‰T$¨b3ƒ—ìei*“1–ÿóäÄ×sì9À2ö²8–hÀEÌ‘©™j»*£ÂC-�м¦1Nêx¤¨3Ôã1ˆ”0åi@…–Ö’»Èû@B¨`%Bä:ÂØ–ܼÈÆ,P³gÖ2¡â©¨B Xá!jnƒL‘µ†L`Û:À).K2ÅÔ IëT}\§€�Ö –,ÉJäÅ g²"‹è™f0Cª^¾ŽH,±FÎÞtÙ,¿€¥‘HIRý40°%ìLS0€Ç‹ä™% .¦&Ž tZ²L©|݇ÍÎUF^§AƒƒŠ/ ®Ùʇ… BkGd2¤µ`¥ûKæDØC.�8‡6˜|3€M1H‚2( ^æh2,ˆ°Ž�ƒp  ÌÌÁA` -Àˆ@�€@ð&J …AÐ4F .BÂ�@3: ŒÀÂð@À†}©�\f bÈÌÀ q§&D*5E *…ÈR€dˆr„e‹ XgÀfD¸PpP€@¨@(6²‰¥d”ÌÁ‘D´c 0ELù0åB¤ˆ'!�ÍŒIs Ë `È—!#˘1€`L�™˜bÆŒPaS0QœÿóäÄÚ}„9È]Ð$d¸@1€¦Té� b�à†=h´s<˜Yᦈkœ  Ɖ1‚c˦à@t£B¤Ø"Lp²€…®&©ÄC®²†lù� `5Ài‘ei·_а'èˆÍÅÄo� ‰N@”8`tÔXeA†1‰�…KŽ0‡áƒ‰� I~ˆh@0BÃ…CƒK@È -šsƒCBÖÂs‚€#ˆ4©‹˜¢ËQZÌU²Ã µÕ*P(/ 7<¢‹_ö|’;¦"퇣Z;5”(«JB5žH¬3ƒD Iµv�HÔŒ(�0¤ÏpÔjHT±JõDÈÝÅð§Ðu¨@eáipƒ�ƒ>Ã@ƒ ó0@\4˜l¨tƒí 00Œ0„).rçH*Ë 3I'’%j¨˜r áf($:qób1ˆt56 s¶œhÍ_…ÀÊɉ¬) ƒˆ�À¢.LÉB-ÌÀUZÌŠ�ÀÊÀ…ŒÁÃVÇ@7n� œîþ T¦²Y¨8‚Î ªª`g“°:5Ç‚Ã̸óX@¶@bÚ ³³•ÉÿóäÄ·z¤9Ü �Ð63TY<”AënH^†" ÓPÛ3àÌI“7LÑ�9Нp�&-1¦f%DÏÄ3Í‚U7"\ DÀ°¾*RÓ)Pñ/×ã+EQÖ\‡4ÅÑE˜!Ÿ" `‘ƒžÈ$@„prÑÈ0e‹A8ê$jË�6VA ¦c�/cðæ$�)# ”"@Âm Á@À `€>ª™ƒ§‘±PcLš–U‚ÄÌ!�æ0ûÎa ‰9d…•a°!…×EEPD‰¨\Ê”¸i9›r/ì4žpB¦}“-A }ƒ¬1ˆÝ›@@„]!Á@šÉ‘bB¯#"4 —™1 `j^^h$¬³,Í q�ª¤a‡ bÂ!8Áš*^‘‚£ ™¥�^ÃLÌx,ÆÐÈÀM d°Ç�ÁC "dJgæ @� „¦dBÉL$H¨@zš,9a�a šC¢†�hÃÔç;5̳0ŠÇ#I°bÁ‚3FDÀpUQ¸jŽâ!F|1‚*8Xȇ7 ¢LÑ44 `�šb©Ð]äS2j ysŒä²‚`ä ŒQ�â©êaŒLÿóäÄŸ{ô9¸#ÛÐe�…„0l �ÀD�°s DÒ75�_ñA¾°‚n …†›a@…ê0¥@Ìpr,6j‡ 2AL+B-F„‘ˆZÕÇ3¥’¸˜ ,žb0B¢EŽ˜0C‚Cƒ4ƒ18’8ÀŽ3"ÂÂ�@ËŠA øTÀ¡@B˜2R˜ !qE§’,ƒÉ’@Δ/:$‰™‚¢1nSåh®(d£j \΄®Ôü1! A‡2$*K’Y(0`’éÙ^(¬­È.ªØVuliä"ƒ ‹5Ñ“0* dx(Ð0”!Ì0l>§’<ÊkŦt@¢’½˜ Z¡Še‡/0R:’a­Ù‡)öuËjŒË½;d¼É΄€jŒIð9@À¬R:è ëDTÏ|]®iÙ €Cd>l ‡!ÆÖ3PÌ«4Ž0I@EîA]À±™ÂÚ+h\�Ba~Ã[”ÜWmGVÔ' ˆT((‰hBZà@ÅH*4ÇO|ÁX’b–è(‘`!:-wqë_I’BP&šèbð-–‘©L²{‰ „Å¥¯ó R•:vé)]äU˜ P³I„ÿóäÄ‚aü9\¬Öpõ0nkH(0l2IPA‹¶¥Œ�ÄvÝWmÍV$}-° Û l’¡Dýaú‡¨APÍ^6Ó3�ÓYnÎÜž[zU†ä‰/p„P¤b§ 8äÀ@äÁS”¾Úöð7vàé½.“‚é:,©4Ph€d�OF·XrT ÑÉžŒ® ú¬2Df IP¨LXîä••#hèB¥kQ©<¯3%@!tÔ2Rþ'ZÔmÞH~!$ÆFò°d‰-ЀåT ÕãŸ�À�9R¥J³-6¸ëÀ’ù§Õ¸½ܲޖuw#ÉyQÙYÙã=R °D,™#‚E6ÿ½Kå7’}EØcÿ(¡�A°þLAME3.100ªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªªsrc/Testing/Responses/Fixtures/Audio/TranslationResponseFixture.php000064400000002053152665621660021717 0ustar00 'translate', 'language' => 'english', 'duration' => 2.95, 'segments' => [ [ 'id' => 0, 'seek' => 0, 'start' => 0.0, 'end' => 4.0, 'text' => ' Hello, this is a fake translation response.', 'tokens' => [ 50364, 2425, 11, 577, 366, 291, 30, 50564, ], 'temperature' => 0.0, 'avg_logprob' => -0.45045216878255206, 'compression_ratio' => 0.7037037037037037, 'no_speech_prob' => 0.1076972484588623, 'transient' => false, ], ], 'text' => 'Hello, how are you?', ]; } src/Testing/Responses/Fixtures/Audio/TranscriptionResponseFixture.php000064400000002060152665621660022256 0ustar00 'transcribe', 'language' => 'english', 'duration' => 2.95, 'segments' => [ [ 'id' => 0, 'seek' => 0, 'start' => 0.0, 'end' => 4.0, 'text' => ' Hello, this is a fake transcription response.', 'tokens' => [ 50364, 2425, 11, 577, 366, 291, 30, 50564, ], 'temperature' => 0.0, 'avg_logprob' => -0.45045216878255206, 'compression_ratio' => 0.7037037037037037, 'no_speech_prob' => 0.1076972484588623, 'transient' => false, ], ], 'text' => 'Hello, how are you?', ]; } src/Testing/Responses/Fixtures/Threads/ThreadDeleteResponseFixture.php000064400000000412152665621660022301 0ustar00 'thread_agvtHUGezjTCt4SKgQg0NJ2Y', 'object' => 'thread.deleted', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/Threads/ThreadResponseFixture.php000064400000000452152665621660021162 0ustar00 'thread_agvtHUGezjTCt4SKgQg0NJ2Y', 'object' => 'thread', 'created_at' => 1_699_621_778, 'metadata' => [], ]; } src/Testing/Responses/Fixtures/Threads/Runs/Steps/ThreadRunStepResponseFixture.php000064400000002105152665621660024525 0ustar00 'step_1spQXgbAabXFm1YXrwiGIMUz', 'object' => 'thread.run.step', 'created_at' => 1_699_564_106, 'run_id' => 'run_fYijubpOJsKDnvtACWBS8C8r', 'assistant_id' => 'asst_EopvUEMh90bxkNRYEYM81Orc', 'thread_id' => 'thread_3WdOgtVuhD8aUIEx774Whkvo', 'type' => 'message_creation', 'status' => 'completed', 'cancelled_at' => null, 'completed_at' => 1_699_564_119, 'expires_at' => null, 'failed_at' => null, 'last_error' => null, 'step_details' => [ 'type' => 'message_creation', 'message_creation' => [ 'message_id' => 'msg_i404PxKbB92d0JAmdOIcX7vA', ], ], 'usage' => [ 'prompt_tokens' => 123, 'completion_tokens' => 456, 'total_tokens' => 579, ], ]; } src/Testing/Responses/Fixtures/Threads/Runs/Steps/ThreadRunStepListResponseFixture.php000064400000002756152665621660025375 0ustar00 'list', 'data' => [ [ 'id' => 'step_1spQXgbAabXFm1YXrwiGIMUz', 'object' => 'thread.run.step', 'created_at' => 1_699_564_106, 'run_id' => 'run_fYijubpOJsKDnvtACWBS8C8r', 'assistant_id' => 'asst_EopvUEMh90bxkNRYEYM81Orc', 'thread_id' => 'thread_3WdOgtVuhD8aUIEx774Whkvo', 'type' => 'message_creation', 'status' => 'completed', 'cancelled_at' => null, 'completed_at' => 1_699_564_119, 'expires_at' => null, 'failed_at' => null, 'last_error' => null, 'step_details' => [ 'type' => 'message_creation', 'message_creation' => [ 'message_id' => 'msg_i404PxKbB92d0JAmdOIcX7vA', ], ], 'usage' => [ 'prompt_tokens' => 123, 'completion_tokens' => 456, 'total_tokens' => 579, ], ], ], 'first_id' => 'step_1spQXgbAabXFm1YXrwiGIMUz', 'last_id' => 'step_1spQXgbAabXFm1YXrwiGIMUz', 'has_more' => false, ]; } src/Testing/Responses/Fixtures/Threads/Runs/ThreadRunStreamResponseFixture.txt000064400000022554152665621660024011 0ustar00event: thread.created data: {"id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","object":"thread","created_at":1720104398,"metadata":{"user":"John Doe"},"tool_resources":{"code_interpreter":{"file_ids":[]}}} event: thread.run.created data: {"id":"run_s1X8yAjuUBlwhGrqiahzfnH7","object":"thread.run","created_at":1720104398,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","status":"queued","started_at ":null,"expires_at ":1720104998,"cancelled_at ":null,"failed_at ":null,"completed_at ":null,"required_action ":null,"last_error ":null,"model":"gpt-4 o","instructions":"You are a very useful assistant","tools":[{"type":"code_interpreter"},{"type":"file_search","file_search":{"max_num_results":50}},{"type":"function","function":{"name":"get_weather","description":"Determine weather in my location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state e.g. San Francisco, CA"},"unit":{"type":"string","enum":["c","f"]}},"required":["location"]}}}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{"user":"John Doe"},"temperature":0.7,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} event: thread.run.queued data: {"id":"run_s1X8yAjuUBlwhGrqiahzfnH7","object":"thread.run","created_at":1720104398,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","status":"queued","started_at":null,"expires_at":1720104998,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":"You are a very useful assistant.","tools":[{"type":"code_interpreter"},{"type":"file_search","file_search":{"max_num_results":50}},{"type":"function","function":{"name":"get_weather","description":"Determine weather in my location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state e.g. San Francisco, CA"},"unit":{"type":"string","enum":["c","f"]}},"required":["location"]}}}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{"user":"John Doe"},"temperature":0.7,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} event: thread.run.in_progress data: {"id":"run_s1X8yAjuUBlwhGrqiahzfnH7","object":"thread.run","created_at":1720104398,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","status":"in_progress","started_at":1720104398,"expires_at":1720104998,"cancelled_at":null,"failed_at":null,"completed_at":null,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":"You are a very useful assistant.","tools":[{"type":"code_interpreter"},{"type":"file_search","file_search":{"max_num_results":50}},{"type":"function","function":{"name":"get_weather","description":"Determine weather in my location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state e.g. San Francisco, CA"},"unit":{"type":"string","enum":["c","f"]}},"required":["location"]}}}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{"user":"John Doe"},"temperature":0.7,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":null,"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} event: thread.run.step.created data: {"id":"step_3P1u5J5Rs95lypEfvQ3rMdPL","object":"thread.run.step","created_at":1720104399,"run_id":"run_s1X8yAjuUBlwhGrqiahzfnH7","assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1720104998,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd"}},"usage":null} event: thread.run.step.in_progress data: {"id":"step_3P1u5J5Rs95lypEfvQ3rMdPL","object":"thread.run.step","created_at":1720104399,"run_id":"run_s1X8yAjuUBlwhGrqiahzfnH7","assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","type":"message_creation","status":"in_progress","cancelled_at":null,"completed_at":null,"expires_at":1720104998,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd"}},"usage":null} event: thread.message.created data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message","created_at":1720104399,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","run_id":"run_s1X8yAjuUBlwhGrqiahzfnH7","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}} event: thread.message.in_progress data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message","created_at":1720104399,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","run_id":"run_s1X8yAjuUBlwhGrqiahzfnH7","status":"in_progress","incomplete_details":null,"incomplete_at":null,"completed_at":null,"role":"assistant","content":[],"attachments":[],"metadata":{}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"Hello","annotations":[]}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"!"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" How"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" can"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" I"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" assist"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" you"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":" today"}}]}} event: thread.message.delta data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message.delta","delta":{"content":[{"index":0,"type":"text","text":{"value":"?"}}]}} event: thread.message.completed data: {"id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd","object":"thread.message","created_at":1720104399,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","run_id":"run_s1X8yAjuUBlwhGrqiahzfnH7","status":"completed","incomplete_details":null,"incomplete_at":null,"completed_at":1720104399,"role":"assistant","content":[{"type":"text","text":{"value":"Hello! How can I assist you today?","annotations":[]}}],"attachments":[],"metadata":{}} event: thread.run.step.completed data: {"id":"step_3P1u5J5Rs95lypEfvQ3rMdPL","object":"thread.run.step","created_at":1720104399,"run_id":"run_s1X8yAjuUBlwhGrqiahzfnH7","assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","type":"message_creation","status":"completed","cancelled_at":null,"completed_at":1720104399,"expires_at":1720104998,"failed_at":null,"last_error":null,"step_details":{"type":"message_creation","message_creation":{"message_id":"msg_zKgPBqNcqb7qYP2bBA3tVyTd"}},"usage":{"prompt_tokens":1138,"completion_tokens":11,"total_tokens":1149}} event: thread.run.completed data: {"id":"run_s1X8yAjuUBlwhGrqiahzfnH7","object":"thread.run","created_at":1720104398,"assistant_id":"asst_JA9Pc6eQ744nbec10slSz5BU","thread_id":"thread_sSbvUX4J1FqlUZBv6BaBbOj4","status":"completed","started_at":1720104398,"expires_at":null,"cancelled_at":null,"failed_at":null,"completed_at":1720104399,"required_action":null,"last_error":null,"model":"gpt-4o","instructions":"You are a very useful assistant.","tools":[{"type":"code_interpreter"},{"type":"file_search","file_search":{"max_num_results":50}},{"type":"function","function":{"name":"get_weather","description":"Determine weather in my location","parameters":{"type":"object","properties":{"location":{"type":"string","description":"The city and state e.g. San Francisco, CA"},"unit":{"type":"string","enum":["c","f"]}},"required":["location"]}}}],"tool_resources":{"code_interpreter":{"file_ids":[]}},"metadata":{"user":"John Doe"},"temperature":0.7,"top_p":1.0,"max_completion_tokens":null,"max_prompt_tokens":null,"truncation_strategy":{"type":"auto","last_messages":null},"incomplete_details":null,"usage":{"prompt_tokens":1138,"completion_tokens":11,"total_tokens":1149},"response_format":"auto","tool_choice":"auto","parallel_tool_calls":true} event: done src/Testing/Responses/Fixtures/Threads/Runs/ThreadRunResponseFixture.php000064400000002727152665621660022605 0ustar00 'run_4RCYyYzX9m41WQicoJtUQAb8', 'object' => 'thread.run', 'created_at' => 1_699_621_735, 'assistant_id' => 'asst_EopvUEMh90bxkNRYEYM81Orc', 'thread_id' => 'thread_EKt7MjGOC6bwKWmenQv5VD6r', 'status' => 'queued', 'started_at' => null, 'expires_at' => 1_699_622_335, 'cancelled_at' => null, 'failed_at' => null, 'completed_at' => null, 'last_error' => null, 'model' => 'gpt-4', 'instructions' => 'You are a personal math tutor. When asked a question, write and run Python code to answer the question.', 'tools' => [ [ 'type' => 'code_interpreter', ], ], 'metadata' => [], 'usage' => [ 'prompt_tokens' => 5, 'completion_tokens' => 7, 'total_tokens' => 12, ], 'incomplete_details' => null, 'temperature' => 1, 'top_p' => 1, 'max_prompt_tokens' => 600, 'max_completion_tokens' => 500, 'truncation_strategy' => [ 'type' => 'auto', 'last_messages' => null, ], 'tool_choice' => 'none', 'response_format' => 'auto', ]; } src/Testing/Responses/Fixtures/Threads/Runs/ThreadRunListResponseFixture.php000064400000003455152665621660023440 0ustar00 'list', 'data' => [ [ 'id' => 'run_4RCYyYzX9m41WQicoJtUQAb8', 'object' => 'thread.run', 'created_at' => 1_699_621_735, 'assistant_id' => 'asst_EopvUEMh90bxkNRYEYM81Orc', 'thread_id' => 'thread_EKt7MjGOC6bwKWmenQv5VD6r', 'status' => 'queued', 'started_at' => null, 'expires_at' => 1_699_622_335, 'cancelled_at' => null, 'failed_at' => null, 'completed_at' => null, 'last_error' => null, 'model' => 'gpt-4', 'instructions' => 'You are a personal math tutor. When asked a question, write and run Python code to answer the question.', 'tools' => [ [ 'type' => 'code_interpreter', ], ], 'metadata' => [], 'incomplete_details' => null, 'temperature' => 1, 'top_p' => 1, 'max_prompt_tokens' => 600, 'max_completion_tokens' => 500, 'truncation_strategy' => [ 'type' => 'auto', 'last_messages' => null, ], 'tool_choice' => 'none', 'response_format' => 'auto', ], ], 'first_id' => 'run_4RCYyYzX9m41WQicoJtUQAb8', 'last_id' => 'run_4RCYyYzX9m41WQicoJtUQAb8', 'has_more' => false, ]; } src/Testing/Responses/Fixtures/Threads/Messages/ThreadMessageListResponseFixture.php000064400000003126152665621660025073 0ustar00 'list', 'data' => [ [ 'id' => 'msg_KNsDDwE41BUAHhcPNpDkdHWZ', 'object' => 'thread.message', 'created_at' => 1_699_623_839, 'thread_id' => 'thread_agvtHUGezjTCt4SKgQg0NJ2Y', 'status' => 'in_progress', 'incomplete_details' => null, 'completed_at' => null, 'incomplete_at' => null, 'role' => 'user', 'content' => [ [ 'type' => 'text', 'text' => [ 'value' => 'How does AI work? Explain it in simple terms.', 'annotations' => [ ], ], ], ], 'attachments' => [ [ 'file_id' => 'file-DhxjnFCaSHc4ZELRGKwTMFtI', 'tools' => [['type' => 'file_search']], ], ], 'assistant_id' => null, 'run_id' => null, 'metadata' => [], ], ], 'first_id' => 'msg_KNsDDwE41BUAHhcPNpDkdHWZ', 'last_id' => 'msg_KNsDDwE41BUAHhcPNpDkdHWZ', 'has_more' => false, ]; } src/Testing/Responses/Fixtures/Threads/Messages/ThreadMessageDeleteResponseFixture.php000064400000000437152665621660025364 0ustar00 'msg_KNsDDwE41BUAHhcPNpDkdHWZ', 'object' => 'thread.message.deleted', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/Threads/Messages/ThreadMessageResponseFixture.php000064400000002217152665621660024237 0ustar00 'msg_KNsDDwE41BUAHhcPNpDkdHWZ', 'object' => 'thread.message', 'created_at' => 1_699_623_839, 'thread_id' => 'thread_agvtHUGezjTCt4SKgQg0NJ2Y', 'status' => 'in_progress', 'incomplete_details' => null, 'completed_at' => null, 'incomplete_at' => null, 'role' => 'user', 'content' => [ [ 'type' => 'text', 'text' => [ 'value' => 'How does AI work? Explain it in simple terms.', 'annotations' => [ ], ], ], ], 'attachments' => [ [ 'file_id' => 'file-DhxjnFCaSHc4ZELRGKwTMFtI', 'tools' => [['type' => 'file_search']], ], ], 'assistant_id' => null, 'run_id' => null, 'metadata' => [], ]; } src/Testing/Responses/Fixtures/Batches/BatchListResponseFixture.php000064400000003103152665621660021603 0ustar00 'list', 'data' => [ [ 'id' => 'batch_abc123', 'object' => 'batch', 'endpoint' => '/v1/chat/completions', 'errors' => null, 'input_file_id' => 'file-abc123', 'completion_window' => '24h', 'status' => 'completed', 'output_file_id' => 'file-cvaTdG', 'error_file_id' => 'file-HOWS94', 'created_at' => 1_711_471_533, 'in_progress_at' => 1_711_471_538, 'expires_at' => 1_711_557_933, 'finalizing_at' => 1_711_493_133, 'completed_at' => 1_711_493_163, 'failed_at' => null, 'expired_at' => null, 'cancelling_at' => null, 'cancelled_at' => null, 'request_counts' => [ 'total' => 100, 'completed' => 95, 'failed' => 5, ], 'metadata' => [ 'customer_id' => 'user_123456789', 'batch_description' => 'Nightly job', ], ], ], 'first_id' => 'batch_abc123', 'last_id' => 'batch_abc456', 'has_more' => true, ]; } src/Testing/Responses/Fixtures/Batches/BatchResponseFixture.php000064400000002162152665621660020753 0ustar00 'batch_abc123', 'object' => 'batch', 'endpoint' => '/v1/chat/completions', 'errors' => null, 'input_file_id' => 'file-abc123', 'completion_window' => '24h', 'status' => 'validating', 'output_file_id' => null, 'error_file_id' => null, 'created_at' => 1_711_471_533, 'in_progress_at' => null, 'expires_at' => null, 'finalizing_at' => null, 'completed_at' => null, 'failed_at' => null, 'expired_at' => null, 'cancelling_at' => null, 'cancelled_at' => null, 'request_counts' => [ 'total' => 0, 'completed' => 0, 'failed' => 0, ], 'metadata' => [ 'customer_id' => 'user_123456789', 'batch_description' => 'Nightly eval job', ], ]; } src/Testing/Responses/Fixtures/Models/RetrieveResponseFixture.php000064400000000431152665621660021366 0ustar00 'text-babbage:001', 'object' => 'model', 'created' => 1_642_018_370, 'owned_by' => 'openai', ]; } src/Testing/Responses/Fixtures/Models/DeleteResponseFixture.php000064400000000376152665621660021013 0ustar00 'curie:ft-acmeco-2021-03-03-21-44-20', 'object' => 'model', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/Models/ListResponseFixture.php000064400000000365152665621660020522 0ustar00 'list', 'data' => [ RetrieveResponseFixture::ATTRIBUTES, ], ]; } src/Testing/Responses/Fixtures/Edits/CreateResponseFixture.php000064400000000726152665621660020640 0ustar00 'edit', 'created' => 1_664_135_921, 'choices' => [[ 'text' => "This is a fake edit response.\n", 'index' => 0, ]], 'usage' => [ 'prompt_tokens' => 25, 'completion_tokens' => 30, 'total_tokens' => 55, ], ]; } src/Testing/Responses/Fixtures/Completions/CreateResponseFixture.php000064400000001333152665621660022057 0ustar00 'cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7', 'object' => 'text_completion', 'created' => 1_589_478_378, 'model' => 'gpt-3.5-turbo-instruct', 'choices' => [ [ 'text' => "\n\nThis is a fake completion response.", 'index' => 0, 'logprobs' => null, 'finish_reason' => 'length', ], ], 'usage' => [ 'prompt_tokens' => 5, 'completion_tokens' => 7, 'total_tokens' => 12, ], ]; } src/Testing/Responses/Fixtures/Completions/CreateStreamedResponseFixture.txt000064400000004306152665621660023577 0ustar00data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": " everyone", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": "!", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": "\n", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": "\n", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": "This", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": " is", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": " a", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": " fake", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": " completion", "index": 0, "logprobs": null, "finish_reason": null}], "model": "gpt-3.5-turbo-instruct"} data: {"id": "cmpl-6ynJi2uZZnKntnEZreDcjGyoPbVAn", "object": "text_completion", "created": 1679430847, "choices": [{"text": " response.", "index": 0, "logprobs": null, "finish_reason": "length"}], "model": "gpt-3.5-turbo-instruct"} data: [DONE] src/Testing/Responses/Fixtures/Chat/CreateResponseFixture.php000064400000001731152665621660020444 0ustar00 'chatcmpl-123', 'object' => 'chat.completion', 'created' => 1_677_652_288, 'model' => 'gpt-3.5-turbo', 'system_fingerprint' => null, 'choices' => [ [ 'index' => 0, 'message' => [ 'role' => 'assistant', 'content' => "\n\nHello there, this is a fake chat response.", 'function_call' => null, 'tool_calls' => [], ], 'logprobs' => null, 'finish_reason' => 'stop', ], ], 'usage' => [ 'prompt_tokens' => 9, 'completion_tokens' => 12, 'total_tokens' => 21, ], ]; } src/Testing/Responses/Fixtures/Chat/CreateStreamedResponseFixture.txt000064400000004244152665621660022163 0ustar00data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":"Hello"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":"!"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":" This"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":" is"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":" a"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":" fake"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":" chat"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":" response"},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{"content":"."},"index":0,"finish_reason":null}]} data: {"id":"chatcmpl-6yo21W6LVo8Tw2yBf7aGf2g17IeIl","object":"chat.completion.chunk","created":1679432086,"model":"gpt-4-0314","choices":[{"delta":{},"index":0,"finish_reason":"stop"}]} data: [DONE] src/Testing/Responses/Fixtures/Images/EditResponseFixture.php000064400000000450152665621660020451 0ustar00 1_664_136_088, 'data' => [ [ 'url' => 'https://openai.com/fake-image.png', ], ], ]; } src/Testing/Responses/Fixtures/Images/VariationResponseFixture.php000064400000000455152665621660021525 0ustar00 1_664_136_088, 'data' => [ [ 'url' => 'https://openai.com/fake-image.png', ], ], ]; } src/Testing/Responses/Fixtures/Images/CreateResponseFixture.php000064400000000452152665621660020771 0ustar00 1_664_136_088, 'data' => [ [ 'url' => 'https://openai.com/fake-image.png', ], ], ]; } src/Testing/Responses/Fixtures/Realtime/TranscriptionSessionResponseFixture.php000064400000001205152665621660024323 0ustar00 [ 'expires_at' => 1735680000, 'value' => 'ek_secret_123', ], 'input_audio_format' => 'pcm16', 'input_audio_transcription' => null, 'modalities' => null, 'turn_detection' => [ 'prefix_padding_ms' => 300, 'silence_duration_ms' => 200, 'threshold' => 0.5, 'type' => 'server_vad', ], ]; } src/Testing/Responses/Fixtures/Realtime/SessionResponseFixture.php000064400000001770152665621660021552 0ustar00 [ 'expires_at' => 1735680000, 'value' => 'ek_secret_123', ], 'input_audio_format' => 'pcm16', 'input_audio_transcription' => null, 'instructions' => 'Your knowledge cutoff is 2023-10. You are a helpful assistant.', 'max_response_output_tokens' => 'inf', 'modalities' => [ 'audio', 'text', ], 'output_audio_format' => 'pcm16', 'temperature' => 0.7, 'tool_choice' => 'auto', 'tools' => [], 'turn_detection' => [ 'prefix_padding_ms' => 100, 'silence_duration_ms' => 500, 'threshold' => 0.5, 'type' => 'server_vad', ], 'voice' => 'alloy', ]; } src/Testing/Responses/Fixtures/VectorStores/Search/VectorStoreSearchResponseFileFixture.php000064400000000744152665621660026441 0ustar00 'file_abc123', 'filename' => 'document.pdf', 'score' => 0.95, 'attributes' => [ 'author' => 'John Doe', 'date' => '2023-01-01', ], 'content' => [ VectorStoreSearchResponseContentFixture::ATTRIBUTES, ], ]; } src/Testing/Responses/Fixtures/VectorStores/Search/VectorStoreSearchResponseFixture.php000064400000001700152665621660025632 0ustar00 'vector_store.search_results.page', 'search_query' => 'What is the return policy?', 'data' => [ VectorStoreSearchResponseFileFixture::ATTRIBUTES, [ 'file_id' => 'file_xyz789', 'filename' => 'notes.txt', 'score' => 0.89, 'attributes' => [ 'author' => 'Jane Smith', 'date' => '2023-01-02', ], 'content' => [ [ 'type' => 'text', 'text' => 'Sample text content from the vector store.', ], ], ], ], 'has_more' => false, 'next_page' => null, ]; } src/Testing/Responses/Fixtures/VectorStores/Search/VectorStoreSearchResponseContentFixture.php000064400000000402152665621660027163 0ustar00 'text', 'text' => 'Sample text content from the vector store.', ]; } src/Testing/Responses/Fixtures/VectorStores/VectorStoreListResponseFixture.php000064400000003605152665621660024141 0ustar00 'list', 'data' => [ [ 'id' => 'vs_8VE2cQq1jTFlH7FizhYCzUz0', 'object' => 'vector_store', 'name' => 'Product Knowledge Base', 'status' => 'completed', 'attributes' => [], 'usage_bytes' => 29882, 'created_at' => 1_715_953_317, 'file_counts' => [ 'in_progress' => 0, 'completed' => 1, 'failed' => 0, 'cancelled' => 0, 'total' => 1, ], 'metadata' => [], 'expires_after' => null, 'expires_at' => null, 'last_active_at' => 1_715_953_317, ], [ 'id' => 'vs_xzlnkCbIQE50B9A8RzmcFmtP', 'object' => 'vector_store', 'name' => null, 'status' => 'completed', 'attributes' => [], 'usage_bytes' => 0, 'created_at' => 1_710_869_420, 'file_counts' => [ 'in_progress' => 0, 'completed' => 1, 'failed' => 0, 'cancelled' => 0, 'total' => 1, ], 'metadata' => [], 'expires_after' => null, 'expires_at' => null, 'last_active_at' => 1_710_869_420, ], ], 'first_id' => 'vs_8VE2cQq1jTFlH7FizhYCzUz0', 'last_id' => 'vs_xzlnkCbIQE50B9A8RzmcFmtP', 'has_more' => true, ]; } src/Testing/Responses/Fixtures/VectorStores/VectorStoreResponseFixture.php000064400000001351152665621660023301 0ustar00 'vs_8VE2cQq1jTFlH7FizhYCzUz0', 'object' => 'vector_store', 'name' => 'Product Knowledge Base', 'status' => 'in_progress', 'usage_bytes' => 0, 'created_at' => 1_715_953_317, 'file_counts' => [ 'in_progress' => 1, 'completed' => 0, 'failed' => 0, 'cancelled' => 0, 'total' => 1, ], 'metadata' => [], 'expires_after' => null, 'expires_at' => null, 'last_active_at' => 1_715_953_317, ]; } src/Testing/Responses/Fixtures/VectorStores/Files/VectorStoreFileListResponseFixture.php000064400000001461152665621660026001 0ustar00 'list', 'data' => [ [ 'id' => 'file-HuwUghQzWasTZeX3uRRawY5R', 'object' => 'vector_store.file', 'usage_bytes' => 29882, 'created_at' => 1_715_956_697, 'vector_store_id' => 'vs_xds05V7ep0QMGI5JmYnWsJwb', 'status' => 'completed', 'attributes' => [], 'last_error' => null, ], ], 'first_id' => 'file-HuwUghQzWasTZeX3uRRawY5R', 'last_id' => 'file-HuwUghQzWasTZeX3uRRawY5R', 'has_more' => false, ]; } src/Testing/Responses/Fixtures/VectorStores/Files/VectorStoreFileResponseFixture.php000064400000001010152665621660025133 0ustar00 'file-HuwUghQzWasTZeX3uRRawY5R', 'object' => 'vector_store.file', 'usage_bytes' => 29882, 'created_at' => 1_715_956_697, 'vector_store_id' => 'vs_xds05V7ep0QMGI5JmYnWsJwb', 'status' => 'completed', 'attributes' => [], 'last_error' => null, ]; } src/Testing/Responses/Fixtures/VectorStores/Files/VectorStoreFileDeleteResponseFixture.php000064400000000447152665621660026273 0ustar00 'file-HuwUghQzWasTZeX3uRRawY5R', 'object' => 'vector_store.file.deleted', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/VectorStores/VectorStoreDeleteResponseFixture.php000064400000000426152665621660024426 0ustar00 'vs_xzlnkCbIQE50B9A8RzmcFmtP', 'object' => 'vector_store.deleted', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/FineTuning/ListJobsResponseFixture.php000064400000000435152665621660022161 0ustar00 'list', 'data' => [ RetrieveJobResponseFixture::ATTRIBUTES, ], 'has_more' => false, ]; } src/Testing/Responses/Fixtures/FineTuning/RetrieveJobResponseFixture.php000064400000001727152665621660022655 0ustar00 'ftjob-AF1WoRqd3aJAHsqc9NY7iL8F', 'object' => 'fine_tuning.job', 'model' => 'gpt-3.5-turbo-0613', 'created_at' => 1_614_807_352, 'finished_at' => 1_692_819_450, 'fine_tuned_model' => 'ft:gpt-3.5-turbo-0613:gehri-dev::7qnxQ0sQ', 'hyperparameters' => [ 'n_epochs' => 9, 'batch_size' => 1, 'learning_rate_multiplier' => 2, ], 'organization_id' => 'org-jwe45798ASN82s', 'result_files' => [ 'file-1bl05WrhsKDDEdg8XSP617QF', ], 'status' => 'succeeded', 'validation_file' => null, 'training_file' => 'file-abc123', 'trained_tokens' => 5049, 'error' => null, ]; } src/Testing/Responses/Fixtures/FineTuning/ListJobEventsResponseFixture.php000064400000001173152665621660023163 0ustar00 'list', 'data' => [ [ 'object' => 'fine_tuning.job.event', 'id' => 'ft-event-ddTJfwuMVpfLXseO0Am0Gqjm', 'created_at' => 1_692_407_401, 'level' => 'info', 'message' => 'Fine tuning job successfully completed', 'data' => null, 'type' => 'message', ], ], 'has_more' => false, ]; } src/Testing/Responses/Fixtures/Embeddings/CreateResponseFixture.php000064400000001077152665621660021631 0ustar00 'list', 'model' => 'text-embedding-3-small', 'data' => [ [ 'object' => 'embedding', 'index' => 0, 'embedding' => [ -0.008906792, -0.013743395, ], ], ], 'usage' => [ 'prompt_tokens' => 8, 'total_tokens' => 8, ], ]; } src/Testing/Responses/Fixtures/Responses/RetrieveResponseFixture.php000064400000007534152665621660022137 0ustar00 'resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c', 'object' => 'response', 'created_at' => 1741484430, 'status' => 'completed', 'error' => null, 'incomplete_details' => null, 'instructions' => null, 'max_output_tokens' => null, 'model' => 'gpt-4o-2024-08-06', 'output' => [ [ 'type' => 'web_search_call', 'id' => 'ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c', 'status' => 'completed', ], [ 'type' => 'message', 'id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'status' => 'completed', 'role' => 'assistant', 'content' => [ [ 'type' => 'output_text', 'text' => 'As of today, March 9, 2025, one notable positive news story...', 'annotations' => [ [ 'type' => 'url_citation', 'start_index' => 442, 'end_index' => 557, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 962, 'end_index' => 1077, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 1336, 'end_index' => 1451, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], ], ], ], ], ], 'parallel_tool_calls' => true, 'previous_response_id' => null, 'reasoning' => [ 'effort' => null, 'generate_summary' => null, ], 'store' => true, 'temperature' => 1.0, 'text' => [ 'format' => [ 'type' => 'text', ], ], 'tool_choice' => 'auto', 'tools' => [ [ 'type' => 'web_search_preview', 'domains' => [], 'search_context_size' => 'medium', 'user_location' => [ 'type' => 'approximate', 'city' => 'San Francisco', 'country' => 'US', 'region' => 'California', 'timezone' => 'America/Los_Angeles', ], ], ], 'top_p' => 1.0, 'truncation' => 'disabled', 'usage' => [ 'input_tokens' => 328, 'input_tokens_details' => [ 'cached_tokens' => 0, ], 'output_tokens' => 356, 'output_tokens_details' => [ 'reasoning_tokens' => 0, ], 'total_tokens' => 684, ], 'user' => null, 'metadata' => [], ]; } src/Testing/Responses/Fixtures/Responses/ListInputItemsFixture.php000064400000001601152665621660021555 0ustar00 'list', 'data' => [ [ 'content' => [ [ 'text' => 'What was a positive news story from today?', 'type' => 'input_text', 'annotations' => [], ], ], 'id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'role' => 'user', 'status' => 'completed', 'type' => 'message', ], ], 'first_id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'last_id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'has_more' => false, ]; } src/Testing/Responses/Fixtures/Responses/CancelResponseFixture.php000064400000007532152665621660021535 0ustar00 'resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c', 'object' => 'response', 'created_at' => 1741484430, 'status' => 'completed', 'error' => null, 'incomplete_details' => null, 'instructions' => null, 'max_output_tokens' => null, 'model' => 'gpt-4o-2024-08-06', 'output' => [ [ 'type' => 'web_search_call', 'id' => 'ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c', 'status' => 'completed', ], [ 'type' => 'message', 'id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'status' => 'completed', 'role' => 'assistant', 'content' => [ [ 'type' => 'output_text', 'text' => 'As of today, March 9, 2025, one notable positive news story...', 'annotations' => [ [ 'type' => 'url_citation', 'start_index' => 442, 'end_index' => 557, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 962, 'end_index' => 1077, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 1336, 'end_index' => 1451, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], ], ], ], ], ], 'parallel_tool_calls' => true, 'previous_response_id' => null, 'reasoning' => [ 'effort' => null, 'generate_summary' => null, ], 'store' => true, 'temperature' => 1.0, 'text' => [ 'format' => [ 'type' => 'text', ], ], 'tool_choice' => 'auto', 'tools' => [ [ 'type' => 'web_search_preview', 'domains' => [], 'search_context_size' => 'medium', 'user_location' => [ 'type' => 'approximate', 'city' => 'San Francisco', 'country' => 'US', 'region' => 'California', 'timezone' => 'America/Los_Angeles', ], ], ], 'top_p' => 1.0, 'truncation' => 'disabled', 'usage' => [ 'input_tokens' => 328, 'input_tokens_details' => [ 'cached_tokens' => 0, ], 'output_tokens' => 356, 'output_tokens_details' => [ 'reasoning_tokens' => 0, ], 'total_tokens' => 684, ], 'user' => null, 'metadata' => [], ]; } src/Testing/Responses/Fixtures/Responses/DeleteResponseFixture.php000064400000000426152665621660021545 0ustar00 'resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c', 'object' => 'response', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/Responses/ResponseObjectFixture.php000064400000007532152665621660021556 0ustar00 'resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c', 'object' => 'response', 'created_at' => 1741484430, 'status' => 'completed', 'error' => null, 'incomplete_details' => null, 'instructions' => null, 'max_output_tokens' => null, 'model' => 'gpt-4o-2024-08-06', 'output' => [ [ 'type' => 'web_search_call', 'id' => 'ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c', 'status' => 'completed', ], [ 'type' => 'message', 'id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'status' => 'completed', 'role' => 'assistant', 'content' => [ [ 'type' => 'output_text', 'text' => 'As of today, March 9, 2025, one notable positive news story...', 'annotations' => [ [ 'type' => 'url_citation', 'start_index' => 442, 'end_index' => 557, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 962, 'end_index' => 1077, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 1336, 'end_index' => 1451, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], ], ], ], ], ], 'parallel_tool_calls' => true, 'previous_response_id' => null, 'reasoning' => [ 'effort' => null, 'generate_summary' => null, ], 'store' => true, 'temperature' => 1.0, 'text' => [ 'format' => [ 'type' => 'text', ], ], 'tool_choice' => 'auto', 'tools' => [ [ 'type' => 'web_search_preview', 'domains' => [], 'search_context_size' => 'medium', 'user_location' => [ 'type' => 'approximate', 'city' => 'San Francisco', 'country' => 'US', 'region' => 'California', 'timezone' => 'America/Los_Angeles', ], ], ], 'top_p' => 1.0, 'truncation' => 'disabled', 'usage' => [ 'input_tokens' => 328, 'input_tokens_details' => [ 'cached_tokens' => 0, ], 'output_tokens' => 356, 'output_tokens_details' => [ 'reasoning_tokens' => 0, ], 'total_tokens' => 684, ], 'user' => null, 'metadata' => [], ]; } src/Testing/Responses/Fixtures/Responses/CreateResponseFixture.php000064400000007532152665621660021553 0ustar00 'resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c', 'object' => 'response', 'created_at' => 1741484430, 'status' => 'completed', 'error' => null, 'incomplete_details' => null, 'instructions' => null, 'max_output_tokens' => null, 'model' => 'gpt-4o-2024-08-06', 'output' => [ [ 'type' => 'web_search_call', 'id' => 'ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c', 'status' => 'completed', ], [ 'type' => 'message', 'id' => 'msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c', 'status' => 'completed', 'role' => 'assistant', 'content' => [ [ 'type' => 'output_text', 'text' => 'As of today, March 9, 2025, one notable positive news story...', 'annotations' => [ [ 'type' => 'url_citation', 'start_index' => 442, 'end_index' => 557, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 962, 'end_index' => 1077, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], [ 'type' => 'url_citation', 'start_index' => 1336, 'end_index' => 1451, 'url' => 'https://.../?utm_source=chatgpt.com', 'title' => '...', ], ], ], ], ], ], 'parallel_tool_calls' => true, 'previous_response_id' => null, 'reasoning' => [ 'effort' => null, 'generate_summary' => null, ], 'store' => true, 'temperature' => 1.0, 'text' => [ 'format' => [ 'type' => 'text', ], ], 'tool_choice' => 'auto', 'tools' => [ [ 'type' => 'web_search_preview', 'domains' => [], 'search_context_size' => 'medium', 'user_location' => [ 'type' => 'approximate', 'city' => 'San Francisco', 'country' => 'US', 'region' => 'California', 'timezone' => 'America/Los_Angeles', ], ], ], 'top_p' => 1.0, 'truncation' => 'disabled', 'usage' => [ 'input_tokens' => 328, 'input_tokens_details' => [ 'cached_tokens' => 0, ], 'output_tokens' => 356, 'output_tokens_details' => [ 'reasoning_tokens' => 0, ], 'total_tokens' => 684, ], 'user' => null, 'metadata' => [], ]; } src/Testing/Responses/Fixtures/Responses/CreateStreamedResponseFixture.txt000064400000006463152665621660023272 0ustar00data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}}} data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]}} data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[]}} data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi"} data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?"} data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}} data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}} data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-4o-2024-08-06","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48},"user":null,"metadata":{}}} src/Testing/Responses/Fixtures/Files/RetrieveResponseFixture.php000064400000000732152665621660021211 0ustar00 'file-XjGxS3KTG0uNmNOK362iJua3', 'object' => 'file', 'bytes' => 140, 'created_at' => 1_613_779_121, 'filename' => 'fake-file.jsonl', 'purpose' => 'fine-tune', 'status' => 'succeeded', 'status_details' => null, ]; } src/Testing/Responses/Fixtures/Files/DeleteResponseFixture.php000064400000000366152665621660020631 0ustar00 'file-XjGxS3KTG0uNmNOK362iJua3', 'object' => 'file', 'deleted' => true, ]; } src/Testing/Responses/Fixtures/Files/ListResponseFixture.php000064400000001160152665621660020333 0ustar00 'list', 'data' => [ [ 'id' => 'file-XjGxS3KTG0uNmNOK362iJua3', 'object' => 'file', 'bytes' => 140, 'created_at' => 1_613_779_121, 'filename' => 'fake-file.jsonl', 'purpose' => 'fine-tune', 'status' => 'succeeded', 'status_details' => null, ], ], ]; } src/Testing/Responses/Fixtures/Files/CreateResponseFixture.php000064400000000730152665621660020625 0ustar00 'file-XjGxS3KTG0uNmNOK362iJua3', 'object' => 'file', 'bytes' => 140, 'created_at' => 1_613_779_121, 'filename' => 'fake-file.jsonl', 'purpose' => 'fine-tune', 'status' => 'succeeded', 'status_details' => null, ]; } src/Testing/Responses/Fixtures/FineTunes/RetrieveResponseFixture.php000064400000002546152665621660022054 0ustar00 'ft-AF1WoRqd3aJAHsqc9NY7iL8F', 'object' => 'fine-tune', 'model' => 'curie', 'created_at' => 1_614_807_352, 'events' => [ [ 'object' => 'fine-tune-event', 'created_at' => 1_614_807_352, 'level' => 'info', 'message' => 'Job enqueued. Waiting for jobs ahead to complete. Queue number => 0.', ], ], 'fine_tuned_model' => 'curie => ft-acmeco-2021-03-03-21-44-20', 'hyperparams' => [ 'batch_size' => 4, 'learning_rate_multiplier' => 0.1, 'n_epochs' => 4, 'prompt_loss_weight' => 0.1, ], 'organization_id' => 'org-jwe45798ASN82s', 'result_files' => [ CreateResponseFixture::ATTRIBUTES, ], 'status' => 'succeeded', 'validation_files' => [ CreateResponseFixture::ATTRIBUTES, ], 'training_files' => [ CreateResponseFixture::ATTRIBUTES, ], 'updated_at' => 1_614_807_865, ]; } src/Testing/Responses/Fixtures/FineTunes/RetrieveStreamedResponseEventFixture.txt000064400000002526152665621660024571 0ustar00data: {"object": "fine-tune-event", "level": "info", "message": "Created fine-tune: ft-y3OpNlc8B5qBVGCCVsLZsDST", "created_at": 1668021917} data: {"object": "fine-tune-event", "level": "info", "message": "Fine-tune costs $0.00", "created_at": 1668021926} data: {"object": "fine-tune-event", "level": "info", "message": "Fine-tune enqueued. Queue number: 0", "created_at": 1668021927} data: {"object": "fine-tune-event", "level": "info", "message": "Fine-tune started", "created_at": 1668021929} data: {"object": "fine-tune-event", "level": "info", "message": "Completed epoch 1/4", "created_at": 1668021976} data: {"object": "fine-tune-event", "level": "info", "message": "Completed epoch 2/4", "created_at": 1668021977} data: {"object": "fine-tune-event", "level": "info", "message": "Completed epoch 3/4", "created_at": 1668021978} data: {"object": "fine-tune-event", "level": "info", "message": "Completed epoch 4/4", "created_at": 1668021978} data: {"object": "fine-tune-event", "level": "info", "message": "Uploaded model: curie:ft-gehri-dev-2022-11-09-19-26-40", "created_at": 1668022001} data: {"object": "fine-tune-event", "level": "info", "message": "Uploaded result file: file-ajLKUCMsFPrT633zqwr0eI4l", "created_at": 1668022002} data: {"object": "fine-tune-event", "level": "info", "message": "Fine-tune succeeded", "created_at": 1668022002} data: [DONE] src/Testing/Responses/Fixtures/FineTunes/ListResponseFixture.php000064400000000370152665621660021173 0ustar00 'list', 'data' => [ RetrieveResponseFixture::ATTRIBUTES, ], ]; } src/Testing/Responses/Fixtures/FineTunes/ListEventsResponseFixture.php000064400000000735152665621660022365 0ustar00 'list', 'data' => [ [ 'object' => 'fine-tune-event', 'created_at' => 1_614_807_352, 'level' => 'info', 'message' => 'Job enqueued. Waiting for jobs ahead to complete. Queue number => 0.', ], ], ]; } src/Testing/Resources/VectorStoresTestResource.php000064400000003710152665621660016465 0ustar00record(__FUNCTION__, func_get_args()); } public function retrieve(string $vectorStoreId): VectorStoreResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $vectorStoreId): VectorStoreDeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } public function create(array $parameters): VectorStoreResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(array $parameters = []): VectorStoreListResponse { return $this->record(__FUNCTION__, func_get_args()); } /** * @param array $parameters */ public function search(string $vectorStoreId, array $parameters = []): VectorStoreSearchResponse { return $this->record(__FUNCTION__, func_get_args()); } public function files(): VectorStoresFilesContract { return new VectorStoresFilesTestResource($this->fake); } public function batches(): VectorStoresFileBatchesContract { return new VectorStoresFileBatchesTestResource($this->fake); } } src/Testing/Resources/BatchesTestResource.php000064400000001702152665621660015373 0ustar00record(__FUNCTION__, func_get_args()); } public function retrieve(string $id): BatchResponse { return $this->record(__FUNCTION__, func_get_args()); } public function cancel(string $id): BatchResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(array $parameters = []): BatchListResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/VectorStoresFileBatchesTestResource.php000064400000002406152665621660020560 0ustar00record(__FUNCTION__, func_get_args()); } public function cancel(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse { return $this->record(__FUNCTION__, func_get_args()); } public function create(string $vectorStoreId, array $parameters): VectorStoreFileBatchResponse { return $this->record(__FUNCTION__, func_get_args()); } public function listFiles(string $vectorStoreId, string $fileBatchId, array $parameters = []): VectorStoreFileListResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ContainersTestResource.php000064400000002077152665621660016135 0ustar00record(__FUNCTION__, func_get_args()); } public function retrieve(string $id): RetrieveContainer { return $this->record(__FUNCTION__, func_get_args()); } public function list(array $parameters = []): ListContainers { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $id): DeleteContainer { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/FineTunesTestResource.php000064400000002474152665621660015731 0ustar00record(__FUNCTION__, func_get_args()); } public function list(): ListResponse { return $this->record(__FUNCTION__); } public function retrieve(string $fineTuneId): RetrieveResponse { return $this->record(__FUNCTION__, func_get_args()); } public function cancel(string $fineTuneId): RetrieveResponse { return $this->record(__FUNCTION__, func_get_args()); } public function listEvents(string $fineTuneId): ListEventsResponse { return $this->record(__FUNCTION__, func_get_args()); } public function listEventsStreamed(string $fineTuneId): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/FilesTestResource.php000064400000002214152665621660015063 0ustar00record(__FUNCTION__, func_get_args()); } public function retrieve(string $file): RetrieveResponse { return $this->record(__FUNCTION__, func_get_args()); } public function download(string $file): string { return $this->record(__FUNCTION__, func_get_args()); } public function upload(array $parameters): CreateResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $file): DeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ImagesTestResource.php000064400000001554152665621660015234 0ustar00record(__FUNCTION__, func_get_args()); } public function edit(array $parameters): EditResponse { return $this->record(__FUNCTION__, func_get_args()); } public function variation(array $parameters): VariationResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/AssistantsTestResource.php000064400000002305152665621660016156 0ustar00record(__FUNCTION__, func_get_args()); } public function retrieve(string $id): AssistantResponse { return $this->record(__FUNCTION__, func_get_args()); } public function modify(string $id, array $parameters): AssistantResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $id): AssistantDeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(array $parameters = []): AssistantListResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/RealtimeTestResource.php000064400000001360152665621660015564 0ustar00record(__FUNCTION__, func_get_args()); } public function transcribeToken(array $parameters = []): TranscriptionSessionResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/VectorStoresFilesTestResource.php000064400000002367152665621660017457 0ustar00record(__FUNCTION__, func_get_args()); } public function delete(string $vectorStoreId, string $fileId): VectorStoreFileDeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } public function create(string $vectorStoreId, array $parameters): VectorStoreFileResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(string $vectorStoreId, array $parameters = []): VectorStoreFileListResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/Concerns/Testable.php000064400000001631152665621660014770 0ustar00 $args */ protected function record(string $method, array $args = []): ResponseContract|ResponseStreamContract|string { return $this->fake->record(new TestRequest($this->resource(), $method, $args)); } public function assertSent(callable|int|null $callback = null): void { $this->fake->assertSent($this->resource(), $callback); } public function assertNotSent(callable|int|null $callback = null): void { $this->fake->assertNotSent($this->resource(), $callback); } } src/Testing/Resources/FineTuningTestResource.php000064400000002344152665621660016073 0ustar00record(__FUNCTION__, func_get_args()); } public function listJobs(array $parameters = []): ListJobsResponse { return $this->record(__FUNCTION__, func_get_args()); } public function retrieveJob(string $jobId): RetrieveJobResponse { return $this->record(__FUNCTION__, func_get_args()); } public function cancelJob(string $jobId): RetrieveJobResponse { return $this->record(__FUNCTION__, func_get_args()); } public function listJobEvents(string $jobId, array $parameters = []): ListJobEventsResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ResponsesTestResource.php000064400000002564152665621660016012 0ustar00record(__FUNCTION__, func_get_args()); } public function createStreamed(array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } public function retrieve(string $id): RetrieveResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(string $id, array $parameters = []): ListInputItems { return $this->record(__FUNCTION__, func_get_args()); } public function cancel(string $id): RetrieveResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $id): DeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/CompletionsTestResource.php000064400000001324152665621660016316 0ustar00record(__FUNCTION__, func_get_args()); } public function createStreamed(array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ThreadsTestResource.php000064400000003126152665621660015416 0ustar00record(__FUNCTION__, func_get_args()); } public function createAndRun(array $parameters): ThreadRunResponse { return $this->record(__FUNCTION__, func_get_args()); } public function createAndRunStreamed(array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } public function retrieve(string $id): ThreadResponse { return $this->record(__FUNCTION__, func_get_args()); } public function modify(string $id, array $parameters): ThreadResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $id): ThreadDeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } public function messages(): ThreadsMessagesTestResource { return new ThreadsMessagesTestResource($this->fake); } public function runs(): ThreadsRunsTestResource { return new ThreadsRunsTestResource($this->fake); } } src/Testing/Resources/ThreadsRunsTestResource.php000064400000003661152665621660016272 0ustar00record(__FUNCTION__, func_get_args()); } public function createStreamed(string $threadId, array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } public function retrieve(string $threadId, string $runId): ThreadRunResponse { return $this->record(__FUNCTION__, func_get_args()); } public function modify(string $threadId, string $runId, array $parameters): ThreadRunResponse { return $this->record(__FUNCTION__, func_get_args()); } public function submitToolOutputs(string $threadId, string $runId, array $parameters): ThreadRunResponse { return $this->record(__FUNCTION__, func_get_args()); } public function submitToolOutputsStreamed(string $threadId, string $runId, array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } public function cancel(string $threadId, string $runId): ThreadRunResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(string $threadId, array $parameters = []): ThreadRunListResponse { return $this->record(__FUNCTION__, func_get_args()); } public function steps(): ThreadsRunsStepsTestResource { return new ThreadsRunsStepsTestResource($this->fake); } } src/Testing/Resources/ThreadsMessagesTestResource.php000064400000002577152665621660017117 0ustar00record(__FUNCTION__, func_get_args()); } public function retrieve(string $threadId, string $messageId): ThreadMessageResponse { return $this->record(__FUNCTION__, func_get_args()); } public function modify(string $threadId, string $messageId, array $parameters): ThreadMessageResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $threadId, string $messageId): ThreadMessageDeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } public function list(string $threadId, array $parameters = []): ThreadMessageListResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/EmbeddingsTestResource.php000064400000001031152665621660016056 0ustar00record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ModelsTestResource.php000064400000001477152665621660015256 0ustar00record(__FUNCTION__); } public function retrieve(string $model): RetrieveResponse { return $this->record(__FUNCTION__, func_get_args()); } public function delete(string $model): DeleteResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/EditsTestResource.php000064400000000773152665621660015101 0ustar00record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/AudioTestResource.php000064400000002315152665621660015064 0ustar00record(__FUNCTION__, func_get_args()); } public function speechStreamed(array $parameters): SpeechStreamResponse { return $this->record(__FUNCTION__, func_get_args()); } public function transcribe(array $parameters): TranscriptionResponse { return $this->record(__FUNCTION__, func_get_args()); } public function transcribeStreamed(array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } public function translate(array $parameters): TranslationResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ModerationsTestResource.php000064400000001037152665621660016307 0ustar00record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ThreadsRunsStepsTestResource.php000064400000001536152665621660017310 0ustar00record(__FUNCTION__, func_get_args()); } public function list(string $threadId, string $runId, array $parameters = []): ThreadRunStepListResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Testing/Resources/ChatTestResource.php000064400000001252152665621660014701 0ustar00record(__FUNCTION__, func_get_args()); } public function createStreamed(array $parameters): StreamResponse { return $this->record(__FUNCTION__, func_get_args()); } } src/Exceptions/UnknownEventException.php000064400000000206152665621660014522 0ustar00getMessage(), 0, $exception); } } src/Exceptions/UnserializableResponse.php000064400000000540152665621660014673 0ustar00getMessage(), 0, $exception); } } src/Exceptions/ErrorException.php000064400000002442152665621660013156 0ustar00, type: ?string, code: string|int|null} $contents */ public function __construct(private readonly array $contents, private readonly int $statusCode) { $message = ($contents['message'] ?: (string) $this->contents['code']) ?: 'Unknown error'; if (is_array($message)) { $message = implode(PHP_EOL, $message); } parent::__construct($message); } /** * Returns the HTTP status code. * * **Note: For streamed requests it might be 200 even in case of an error.** */ public function getStatusCode(): int { return $this->statusCode; } /** * Returns the error message. */ public function getErrorMessage(): string { return $this->getMessage(); } /** * Returns the error type. */ public function getErrorType(): ?string { return $this->contents['type']; } /** * Returns the error code. */ public function getErrorCode(): string|int|null { return $this->contents['code']; } } src/Exceptions/InvalidArgumentException.php000064400000000211152665621660015146 0ustar00toRequest($this->baseUri, $this->headers, $this->queryParams); $response = $this->sendRequest(fn (): \Psr\Http\Message\ResponseInterface => $this->client->sendRequest($request)); $contents = (string) $response->getBody(); if (str_contains($response->getHeaderLine('Content-Type'), ContentType::TEXT_PLAIN->value)) { return Response::from($contents, $response->getHeaders()); } $this->throwIfJsonError($response, $contents); try { /** @var array{error?: array{message: string, type: string, code: string}} $data */ $data = json_decode($contents, true, flags: JSON_THROW_ON_ERROR); } catch (JsonException $jsonException) { throw new UnserializableResponse($jsonException); } return Response::from($data, $response->getHeaders()); } /** * {@inheritDoc} */ public function requestContent(Payload $payload): string { $request = $payload->toRequest($this->baseUri, $this->headers, $this->queryParams); $response = $this->sendRequest(fn (): \Psr\Http\Message\ResponseInterface => $this->client->sendRequest($request)); $contents = (string) $response->getBody(); $this->throwIfJsonError($response, $contents); return $contents; } /** * {@inheritDoc} */ public function requestStream(Payload $payload): ResponseInterface { $request = $payload->toRequest($this->baseUri, $this->headers, $this->queryParams); $response = $this->sendRequest(fn () => ($this->streamHandler)($request)); $this->throwIfJsonError($response, $response); return $response; } private function sendRequest(Closure $callable): ResponseInterface { try { return $callable(); } catch (ClientExceptionInterface $clientException) { if ($clientException instanceof ClientException) { $this->throwIfJsonError($clientException->getResponse(), (string) $clientException->getResponse()->getBody()); } throw new TransporterException($clientException); } } private function throwIfJsonError(ResponseInterface $response, string|ResponseInterface $contents): void { if ($response->getStatusCode() < 400) { return; } if (! str_contains($response->getHeaderLine('Content-Type'), ContentType::JSON->value)) { return; } $statusCode = $response->getStatusCode(); if ($contents instanceof ResponseInterface) { $contents = (string) $contents->getBody(); } try { /** @var array{error?: array{message: string|array, type: string, code: string}} $response */ $response = json_decode($contents, true, flags: JSON_THROW_ON_ERROR); if (isset($response['error'])) { throw new ErrorException($response['error'], $statusCode); } } catch (JsonException $jsonException) { throw new UnserializableResponse($jsonException); } } } src/Contracts/TransporterContract.php000064400000001733152665621660014050 0ustar00|string> * * @throws ErrorException|UnserializableResponse|TransporterException */ public function requestObject(Payload $payload): Response; /** * Sends a content request to a server. * * @throws ErrorException|TransporterException */ public function requestContent(Payload $payload): string; /** * Sends a stream request to a server. ** * @throws ErrorException */ public function requestStream(Payload $payload): ResponseInterface; } src/Contracts/ResponseHasMetaInformationContract.php000064400000000310152665621660016762 0ustar00, value-of> * * @internal */ interface ResponseContract extends ArrayAccess { /** * Returns the array representation of the Response. * * @return TArray */ public function toArray(): array; /** * @param key-of $offset */ public function offsetExists(mixed $offset): bool; /** * @template TOffsetKey of key-of * @param TOffsetKey $offset * * @return TArray[TOffsetKey] */ public function offsetGet(mixed $offset): mixed; /** * @template TOffsetKey of key-of * @param TOffsetKey $offset * @param TArray[TOffsetKey] $value */ public function offsetSet(mixed $offset, mixed $value): never; /** * @template TOffsetKey of key-of * @param TOffsetKey $offset */ public function offsetUnset(mixed $offset): never; } src/Contracts/MetaInformationContract.php000064400000002046152665621660014617 0ustar00, value-of> * * @internal */ interface MetaInformationContract extends ArrayAccess { /** * Returns the array representation of the meta information. * * @return TArray */ public function toArray(): array; /** * @param key-of $offset */ public function offsetExists(mixed $offset): bool; /** * @template TOffsetKey of key-of * @param TOffsetKey $offset * * @return TArray[TOffsetKey] */ public function offsetGet(mixed $offset): mixed; /** * @template TOffsetKey of key-of * @param TOffsetKey $offset * @param TArray[TOffsetKey] $value */ public function offsetSet(mixed $offset, mixed $value): never; /** * @template TOffsetKey of key-of * @param TOffsetKey $offset */ public function offsetUnset(mixed $offset): never; } src/Contracts/Resources/ThreadsMessagesContract.php000064400000003104152665621660016553 0ustar00 $parameters */ public function create(string $threadId, array $parameters): ThreadMessageResponse; /** * Retrieve a message. * * @see https://platform.openai.com/docs/api-reference/messages/getMessage */ public function retrieve(string $threadId, string $messageId): ThreadMessageResponse; /** * Modifies a message. * * @see https://platform.openai.com/docs/api-reference/messages/modifyMessage * * @param array $parameters */ public function modify(string $threadId, string $messageId, array $parameters): ThreadMessageResponse; /** * Deletes a message. * * @see https://platform.openai.com/docs/api-reference/messages/deleteMessage */ public function delete(string $threadId, string $messageId): ThreadMessageDeleteResponse; /** * Returns a list of messages for a given thread. * * @see https://platform.openai.com/docs/api-reference/messages/listMessages * * @param array $parameters */ public function list(string $threadId, array $parameters = []): ThreadMessageListResponse; } src/Contracts/Resources/VectorStoresContract.php000064400000004462152665621660016143 0ustar00 $parameters */ public function create(array $parameters): VectorStoreResponse; /** * Returns a list of vector stores. * * @see https://platform.openai.com/docs/api-reference/vector-stores/list * * @param array $parameters */ public function list(array $parameters = []): VectorStoreListResponse; /** * Retrieves a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores/retrieve */ public function retrieve(string $vectorStoreId): VectorStoreResponse; /** * Modify a vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores/modify * * @param array $parameters */ public function modify(string $vectorStoreId, array $parameters): VectorStoreResponse; /** * Delete a vector store. * * https://platform.openai.com/docs/api-reference/vector-stores/delete */ public function delete(string $vectorStoreId): VectorStoreDeleteResponse; /** * Manage the files related to the vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores-files */ public function files(): VectorStoresFilesContract; /** * Manage the file batches related to the vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches */ public function batches(): VectorStoresFileBatchesContract; /** * Search a vector store for relevant chunks based on a query and file attributes filter. * * @see https://platform.openai.com/docs/api-reference/vector-stores/search * * @param array $parameters */ public function search(string $vectorStoreId, array $parameters = []): VectorStoreSearchResponse; } src/Contracts/Resources/RealtimeContract.php000064400000001517152665621660015241 0ustar00 $parameters */ public function token(array $parameters = []): SessionResponse; /** * Create an ephemeral API token for real time transcription sessions. * * @see https://platform.openai.com/docs/api-reference/realtime-sessions/create-transcription * * @param array $parameters */ public function transcribeToken(array $parameters = []): TranscriptionSessionResponse; } src/Contracts/Resources/VectorStoresFileBatchesContract.php000064400000002702152665621660020230 0ustar00 $parameters */ public function create(string $vectorStoreId, array $parameters): VectorStoreFileBatchResponse; /** * Retrieves a file batch within a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch */ public function retrieve(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse; /** * Cancel a vector store file batch * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch */ public function cancel(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse; /** * Lists the files within a file batch within a vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles * * @param array $parameters */ public function listFiles(string $vectorStoreId, string $fileBatchId, array $parameters = []): VectorStoreFileListResponse; } src/Contracts/Resources/FineTunesContract.php000064400000003570152665621660015400 0ustar00 $parameters */ public function create(array $parameters): RetrieveResponse; /** * List your organization's fine-tuning jobs. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/list */ public function list(): ListResponse; /** * Gets info about the fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/list */ public function retrieve(string $fineTuneId): RetrieveResponse; /** * Immediately cancel a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/cancel */ public function cancel(string $fineTuneId): RetrieveResponse; /** * Get fine-grained status updates for a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/events */ public function listEvents(string $fineTuneId): ListEventsResponse; /** * Get streamed fine-grained status updates for a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/events * * @return StreamResponse */ public function listEventsStreamed(string $fineTuneId): StreamResponse; } src/Contracts/Resources/EditsContract.php000064400000001145152665621660014544 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; } src/Contracts/Resources/ThreadsRunsStepsContract.php000064400000001377152665621660016764 0ustar00 $parameters */ public function list(string $threadId, string $runId, array $parameters = []): ThreadRunStepListResponse; } src/Contracts/Resources/FineTuningContract.php000064400000003237152665621660015546 0ustar00 $parameters */ public function createJob(array $parameters): RetrieveJobResponse; /** * List your organization's fine-tuning jobs. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/undefined * * @param array $parameters */ public function listJobs(array $parameters = []): ListJobsResponse; /** * Get info about a fine-tuning job. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/retrieve */ public function retrieveJob(string $jobId): RetrieveJobResponse; /** * Immediately cancel a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/cancel */ public function cancelJob(string $jobId): RetrieveJobResponse; /** * Get status updates for a fine-tuning job. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/list-events * * @param array $parameters */ public function listJobEvents(string $jobId, array $parameters = []): ListJobEventsResponse; } src/Contracts/Resources/ChatContract.php000064400000001446152665621660014357 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; /** * Creates a streamed completion for the chat message * * @see https://platform.openai.com/docs/api-reference/chat/create * * @param array $parameters * * @return StreamResponse */ public function createStreamed(array $parameters): StreamResponse; } src/Contracts/Resources/ImagesContract.php000064400000002017152665621660014700 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; /** * Creates an edited or extended image given an original image and a prompt. * * @see https://platform.openai.com/docs/api-reference/images/create-edit * * @param array $parameters */ public function edit(array $parameters): EditResponse; /** * Creates a variation of a given image. * * @see https://platform.openai.com/docs/api-reference/images/create-variation * * @param array $parameters */ public function variation(array $parameters): VariationResponse; } src/Contracts/Resources/EmbeddingsContract.php000064400000000633152665621660015536 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; } src/Contracts/Resources/ThreadsContract.php000064400000004301152665621660015063 0ustar00 $parameters */ public function create(array $parameters): ThreadResponse; /** * Create a thread and run it in one request. * * @see https://platform.openai.com/docs/api-reference/runs/createThreadAndRun * * @param array $parameters */ public function createAndRun(array $parameters): ThreadRunResponse; /** * Create a thread and run it in one request, returning a stream. * * @see https://platform.openai.com/docs/api-reference/runs/createThreadAndRun * * @param array $parameters * * @return StreamResponse */ public function createAndRunStreamed(array $parameters): StreamResponse; /** * Retrieves a thread. * * @see https://platform.openai.com/docs/api-reference/threads/getThread */ public function retrieve(string $id): ThreadResponse; /** * Modifies a thread. * * @see https://platform.openai.com/docs/api-reference/threads/modifyThread * * @param array $parameters */ public function modify(string $id, array $parameters): ThreadResponse; /** * Delete a thread. * * @see https://platform.openai.com/docs/api-reference/threads/deleteThread */ public function delete(string $id): ThreadDeleteResponse; /** * Manage messages attached to a thread. * * @see https://platform.openai.com/docs/api-reference/messages */ public function messages(): ThreadsMessagesContract; /** * Represents an execution run on a thread. * * @see https://platform.openai.com/docs/api-reference/runs */ public function runs(): ThreadsRunsContract; } src/Contracts/Resources/CompletionsContract.php000064400000001603152665621660015767 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; /** * Creates a streamed completion for the provided prompt and parameters * * @see https://platform.openai.com/docs/api-reference/completions/create-completion * * @param array $parameters * * @return StreamResponse */ public function createStreamed(array $parameters): StreamResponse; } src/Contracts/Resources/ModerationsContract.php000064400000000632152665621660015760 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; } src/Contracts/Resources/FilesContract.php000064400000002632152665621660014540 0ustar00 $parameters */ public function list(array $parameters = []): ListResponse; /** * Returns information about a specific file. * * @see https://platform.openai.com/docs/api-reference/files/retrieve */ public function retrieve(string $file): RetrieveResponse; /** * Returns the contents of the specified file. * * @see https://platform.openai.com/docs/api-reference/files/retrieve-content */ public function download(string $file): string; /** * Upload a file that contains document(s) to be used across various endpoints/features. * * @see https://platform.openai.com/docs/api-reference/files/upload * * @param array $parameters */ public function upload(array $parameters): CreateResponse; /** * Delete a file. * * @see https://platform.openai.com/docs/api-reference/files/delete */ public function delete(string $file): DeleteResponse; } src/Contracts/Resources/VectorStoresFilesContract.php000064400000002605152665621660017123 0ustar00 $parameters */ public function create(string $vectorStoreId, array $parameters): VectorStoreFileResponse; /** * Returns a list of files within a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles * * @param array $parameters */ public function list(string $vectorStoreId, array $parameters = []): VectorStoreFileListResponse; /** * Retrieves a file within a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores-files/getFile */ public function retrieve(string $vectorStoreId, string $fileId): VectorStoreFileResponse; /** * Delete a file within a vector store. * * https://platform.openai.com/docs/api-reference/vector-stores/delete */ public function delete(string $vectorStoreId, string $fileId): VectorStoreFileDeleteResponse; } src/Contracts/Resources/ThreadsRunsContract.php000064400000005550152665621660015742 0ustar00 $parameters */ public function create(string $threadId, array $parameters): ThreadRunResponse; /** * Create a streamed run. * * @see https://platform.openai.com/docs/api-reference/runs/createRun * * @param array $parameters * * @return StreamResponse */ public function createStreamed(string $threadId, array $parameters): StreamResponse; /** * Retrieves a run. * * @see https://platform.openai.com/docs/api-reference/runs/getRun */ public function retrieve(string $threadId, string $runId): ThreadRunResponse; /** * Modifies a run. * * @see https://platform.openai.com/docs/api-reference/runs/modifyRun * * @param array $parameters */ public function modify(string $threadId, string $runId, array $parameters): ThreadRunResponse; /** * This endpoint can be used to submit the outputs from the tool calls once they're all completed. * * @see https://platform.openai.com/docs/api-reference/runs/submitToolOutputs * * @param array $parameters */ public function submitToolOutputs(string $threadId, string $runId, array $parameters): ThreadRunResponse; /** * This endpoint can be used to submit the outputs from the tool calls once they're all completed. * And stream back the response * * @see https://platform.openai.com/docs/api-reference/runs/submitToolOutputs * * @param array $parameters * * @return StreamResponse */ public function submitToolOutputsStreamed(string $threadId, string $runId, array $parameters): StreamResponse; /** * Cancels a run that is `in_progress`. * * @see https://platform.openai.com/docs/api-reference/runs/cancelRun */ public function cancel(string $threadId, string $runId): ThreadRunResponse; /** * Returns a list of runs belonging to a thread. * * @see https://platform.openai.com/docs/api-reference/runs/listRuns * * @param array $parameters */ public function list(string $threadId, array $parameters = []): ThreadRunListResponse; /** * Get steps attached to a run. * * @see https://platform.openai.com/docs/api-reference/runs/step-object */ public function steps(): ThreadsRunsStepsContract; } src/Contracts/Resources/ModelsContract.php000064400000001750152665621660014721 0ustar00 $parameters */ public function speech(array $parameters): string; /** * Generates streamed audio from the input text. * * @see https://platform.openai.com/docs/api-reference/audio/createSpeech * * @param array $parameters */ public function speechStreamed(array $parameters): SpeechStreamResponse; /** * Transcribes audio into the input language. * * @see https://platform.openai.com/docs/api-reference/audio/createTranscription * * @param array $parameters */ public function transcribe(array $parameters): TranscriptionResponse; /** * Transcribes audio input the streamed events. * * @see https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-stream * * @param array $parameters * * @return StreamResponse */ public function transcribeStreamed(array $parameters): StreamResponse; /** * Translates audio into English. * * @see https://platform.openai.com/docs/api-reference/audio/createTranslation * * @param array $parameters */ public function translate(array $parameters): TranslationResponse; } src/Contracts/Resources/ContainersContract.php000064400000002407152665621660015603 0ustar00 $parameters */ public function create(array $parameters): CreateContainer; /** * Retrieves a container with the given ID. * * @see https://platform.openai.com/docs/api-reference/containers/retrieveContainer */ public function retrieve(string $id): RetrieveContainer; /** * Delete a container with the given ID. * * @see https://platform.openai.com/docs/api-reference/containers/deleteContainer */ public function delete(string $id): DeleteContainer; /** * List containers * * @see https://platform.openai.com/docs/api-reference/containers/listContainers * * @param array $parameters */ public function list(array $parameters = []): ListContainers; } src/Contracts/Resources/ResponsesContract.php000064400000004176152665621660015464 0ustar00 $parameters */ public function create(array $parameters): CreateResponse; /** * Create a streamed response. * * @see https://platform.openai.com/docs/api-reference/responses/create * * @param array $parameters * * @return StreamResponse */ public function createStreamed(array $parameters): StreamResponse; /** * Retrieves a model response with the given ID. * * @see https://platform.openai.com/docs/api-reference/responses/retrieve */ public function retrieve(string $id): RetrieveResponse; /** * Cancels a model response with the given ID. Must be marked as 'background' to be cancellable. * * @see https://platform.openai.com/docs/api-reference/responses/cancel */ public function cancel(string $id): RetrieveResponse; /** * Deletes a model response with the given ID. * * @see https://platform.openai.com/docs/api-reference/responses/delete */ public function delete(string $id): DeleteResponse; /** * Returns a list of input items for a given response. * * @see https://platform.openai.com/docs/api-reference/responses/input-items * * @param array $parameters */ public function list(string $id, array $parameters = []): ListInputItems; } src/Contracts/Resources/BatchesContract.php000064400000002075152665621660015050 0ustar00 $parameters */ public function create(array $parameters): BatchResponse; /** * Retrieves a batch. * * * @see https://platform.openai.com/docs/api-reference/batch/retrieve */ public function retrieve(string $id): BatchResponse; /** * Cancels an in-progress batch. * * * @see https://platform.openai.com/docs/api-reference/batch/cancel */ public function cancel(string $id): BatchResponse; /** * List your organization's batches. * * @see https://platform.openai.com/docs/api-reference/batch/list * * @param array $parameters */ public function list(array $parameters = []): BatchListResponse; } src/Contracts/Resources/AssistantsContract.php000064400000002713152665621660015632 0ustar00 $parameters */ public function create(array $parameters): AssistantResponse; /** * Retrieves an assistant. * * @see https://platform.openai.com/docs/api-reference/assistants/getAssistant */ public function retrieve(string $id): AssistantResponse; /** * Modifies an assistant. * * @see https://platform.openai.com/docs/api-reference/assistants/modifyAssistant * * @param array $parameters */ public function modify(string $id, array $parameters): AssistantResponse; /** * Delete an assistant. * * @see https://platform.openai.com/docs/api-reference/assistants/deleteAssistant */ public function delete(string $id): AssistantDeleteResponse; /** * Returns a list of assistants. * * @see https://platform.openai.com/docs/api-reference/assistants/listAssistants * * @param array $parameters */ public function list(array $parameters = []): AssistantListResponse; } src/Contracts/ResponseStreamContract.php000064400000000344152665621660014474 0ustar00 * * @internal */ interface ResponseStreamContract extends IteratorAggregate {} src/Contracts/StringableContract.php000064400000000344152665621660013614 0ustar00transporter); } /** * Given a prompt, the model will return one or more predicted completions, and can also return the probabilities * of alternative tokens at each position. * * @see https://platform.openai.com/docs/api-reference/completions */ public function completions(): Completions { return new Completions($this->transporter); } /** * Given a chat conversation, the model will return a chat completion response. * * @see https://platform.openai.com/docs/api-reference/chat */ public function chat(): Chat { return new Chat($this->transporter); } /** * Create and manage containers for use with the Code Interpreter tool. * * @see https://platform.openai.com/docs/api-reference/containers */ public function containers(): Containers { return new Containers($this->transporter); } /** * Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms. * * @see https://platform.openai.com/docs/api-reference/embeddings */ public function embeddings(): Embeddings { return new Embeddings($this->transporter); } /** * Learn how to turn audio into text. * * @see https://platform.openai.com/docs/api-reference/audio */ public function audio(): Audio { return new Audio($this->transporter); } /** * Given a prompt and an instruction, the model will return an edited version of the prompt. * * @see https://platform.openai.com/docs/api-reference/edits */ public function edits(): Edits { return new Edits($this->transporter); } /** * Files are used to upload documents that can be used with features like Fine-tuning. * * @see https://platform.openai.com/docs/api-reference/files */ public function files(): Files { return new Files($this->transporter); } /** * List and describe the various models available in the API. * * @see https://platform.openai.com/docs/api-reference/models */ public function models(): Models { return new Models($this->transporter); } /** * Manage fine-tuning jobs to tailor a model to your specific training data. * * @see https://platform.openai.com/docs/api-reference/fine-tuning */ public function fineTuning(): FineTuning { return new FineTuning($this->transporter); } /** * Manage fine-tuning jobs to tailor a model to your specific training data. * * @deprecated OpenAI has deprecated this endpoint and will stop working by January 4, 2024. * https://openai.com/blog/gpt-3-5-turbo-fine-tuning-and-api-updates#updated-gpt-3-models * @see https://platform.openai.com/docs/api-reference/fine-tunes */ public function fineTunes(): FineTunes { return new FineTunes($this->transporter); } /** * Given an input text, outputs if the model classifies it as violating OpenAI's content policy. * * @see https://platform.openai.com/docs/api-reference/moderations */ public function moderations(): Moderations { return new Moderations($this->transporter); } /** * Given a prompt and/or an input image, the model will generate a new image. * * @see https://platform.openai.com/docs/api-reference/images */ public function images(): Images { return new Images($this->transporter); } /** * Build assistants that can call models and use tools to perform tasks. * * @see https://platform.openai.com/docs/api-reference/assistants */ public function assistants(): Assistants { return new Assistants($this->transporter); } /** * Communicate with a model in real time using WebRTC or WebSockets. * * @see https://platform.openai.com/docs/api-reference/realtime */ public function realtime(): RealtimeContract { return new Realtime($this->transporter); } /** * Create threads that assistants can interact with. * * @see https://platform.openai.com/docs/api-reference/threads */ public function threads(): ThreadsContract { return new Threads($this->transporter); } /** * Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours. * * @see https://platform.openai.com/docs/api-reference/batch */ public function batches(): Batches { return new Batches($this->transporter); } /** * Create and update vector stores that assistants can interact with * * @see https://platform.openai.com/docs/api-reference/vector-stores */ public function vectorStores(): VectorStoresContract { return new VectorStores($this->transporter); } } src/Responses/Assistants/AssistantResponse.php000064400000013555152665621660015701 0ustar00}}>, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: string}}> */ final class AssistantResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}>, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: string}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $tools * @param array $metadata */ private function __construct( public string $id, public string $object, public int $createdAt, public ?string $name, public ?string $reasoningEffort, public ?string $description, public string $model, public ?string $instructions, public array $tools, public ?AssistantResponseToolResources $toolResources, public array $metadata, public ?float $temperature, public ?float $topP, public string|AssistantResponseResponseFormat $responseFormat, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, name: ?string, reasoning_effort?: ?string, description: ?string, model: string, instructions: ?string, tools: array}}>, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: 'text'|'json_object'}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $tools = array_map( fn (array $tool): AssistantResponseToolCodeInterpreter|AssistantResponseToolFileSearch|AssistantResponseToolFunction => match ($tool['type']) { 'code_interpreter' => AssistantResponseToolCodeInterpreter::from($tool), 'file_search' => AssistantResponseToolFileSearch::from($tool), 'function' => AssistantResponseToolFunction::from($tool), }, $attributes['tools'], ); $responseFormat = is_array($attributes['response_format']) ? AssistantResponseResponseFormat::from($attributes['response_format']) : $attributes['response_format']; return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], $attributes['name'], $attributes['reasoning_effort'] ?? null, $attributes['description'], $attributes['model'], $attributes['instructions'], $tools, isset($attributes['tool_resources']) ? AssistantResponseToolResources::from($attributes['tool_resources']) : null, $attributes['metadata'], $attributes['temperature'], $attributes['top_p'], $responseFormat, $meta ); } /** * {@inheritDoc} */ public function toArray(): array { $response = [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'name' => $this->name, 'reasoning_effort' => $this->reasoningEffort, 'description' => $this->description, 'model' => $this->model, 'instructions' => $this->instructions, 'tools' => array_map(fn (AssistantResponseToolCodeInterpreter|AssistantResponseToolFileSearch|AssistantResponseToolFunction $tool): array => $tool->toArray(), $this->tools), 'tool_resources' => $this->toolResources?->toArray(), 'metadata' => $this->metadata, 'temperature' => $this->temperature, 'top_p' => $this->topP, 'response_format' => is_string($this->responseFormat) ? $this->responseFormat : $this->responseFormat->toArray(), ]; // Only reasoning models will have this property. if (! $this->reasoningEffort) { unset($response['reasoning_effort']); } return $response; } } src/Responses/Assistants/AssistantResponseToolFunction.php000064400000002616152665621660020241 0ustar00}}> */ final class AssistantResponseToolFunction implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public AssistantResponseToolFunctionFunction $function, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'function', function: array{description: ?string, name: string, parameters: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], AssistantResponseToolFunctionFunction::from($attributes['function']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'function' => $this->function->toArray(), ]; } } src/Responses/Assistants/AssistantResponseToolResourceCodeInterpreter.php000064400000002076152665621660023262 0ustar00}> */ final class AssistantResponseToolResourceCodeInterpreter implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $fileIds */ private function __construct( public array $fileIds, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_ids: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['file_ids'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_ids' => $this->fileIds, ]; } } src/Responses/Assistants/AssistantResponseToolFunctionFunction.php000064400000002650152665621660021745 0ustar00}> */ final class AssistantResponseToolFunctionFunction implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $parameters */ private function __construct( public ?string $description, public string $name, public array $parameters, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{description: ?string, name: string, parameters: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['description'], $attributes['name'], $attributes['parameters'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'description' => $this->description, 'parameters' => $this->parameters, ]; } } src/Responses/Assistants/AssistantResponseToolFileSearch.php000064400000001702152665621660020454 0ustar00 */ final class AssistantResponseToolFileSearch implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'file_search'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Assistants/AssistantListResponse.php000064400000007603152665621660016532 0ustar00}}>, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: string}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class AssistantListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}>, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: string}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array}}>, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: 'text'|'json_object'}}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): AssistantResponse => AssistantResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (AssistantResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Assistants/AssistantDeleteResponse.php000064400000003047152665621660017017 0ustar00 */ final class AssistantDeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Assistants/AssistantResponseResponseFormat.php000064400000001711152665621660020560 0ustar00 */ final class AssistantResponseResponseFormat implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'text'|'json_object'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Assistants/AssistantResponseToolResourceFileSearch.php000064400000002166152665621660022171 0ustar00}> */ final class AssistantResponseToolResourceFileSearch implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $vectorStoreIds */ private function __construct( public array $vectorStoreIds, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{vector_store_ids: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['vector_store_ids'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'vector_store_ids' => $this->vectorStoreIds, ]; } } src/Responses/Assistants/AssistantResponseToolCodeInterpreter.php000064400000001714152665621660021550 0ustar00 */ final class AssistantResponseToolCodeInterpreter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'code_interpreter'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Assistants/AssistantResponseToolResources.php000064400000003276152665621660020431 0ustar00}, file_search?: array{vector_store_ids: array}}> */ final class AssistantResponseToolResources implements ResponseContract { /** * @use ArrayAccessible}, file_search?: array{vector_store_ids: array}}> */ use ArrayAccessible; use Fakeable; private function __construct( public ?AssistantResponseToolResourceCodeInterpreter $codeInterpreter, public ?AssistantResponseToolResourceFileSearch $fileSearch, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}} $attributes */ public static function from(array $attributes): self { return new self( isset($attributes['code_interpreter']) ? AssistantResponseToolResourceCodeInterpreter::from($attributes['code_interpreter']) : null, isset($attributes['file_search']) ? AssistantResponseToolResourceFileSearch::from($attributes['file_search']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'code_interpreter' => $this->codeInterpreter?->toArray(), 'file_search' => $this->fileSearch?->toArray(), ]); } } src/Responses/Assistants/AssistantResponseResponseFormatText.php000064400000001677152665621660021440 0ustar00 */ final class AssistantResponseResponseFormatText implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'text'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Moderations/CreateResponse.php000064400000004547152665621660015264 0ustar00, category_scores: array, flagged: bool, category_applied_input_types?: array>}>}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, category_scores: array, flagged: bool, category_applied_input_types?: array>}>}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $results */ private function __construct( public readonly string $id, public readonly string $model, public readonly array $results, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, model: string, results: array, category_scores: array, flagged: bool, category_applied_input_types?: array>}>} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $results = array_map(fn (array $result): CreateResponseResult => CreateResponseResult::from( $result ), $attributes['results']); return new self( $attributes['id'], $attributes['model'], $results, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'model' => $this->model, 'results' => array_map( static fn (CreateResponseResult $result): array => $result->toArray(), $this->results, ), ]; } } src/Responses/Moderations/CreateResponseResult.php000064400000004535152665621660016460 0ustar00 $categories * @param array> $categoryAppliedInputTypes */ private function __construct( public readonly array $categories, public readonly bool $flagged, public readonly ?array $categoryAppliedInputTypes, ) { // .. } /** * @param array{categories: array, category_scores: array, flagged: bool, category_applied_input_types?: array>} $attributes */ public static function from(array $attributes): self { /** @var array $categories */ $categories = []; foreach (Category::cases() as $category) { if (! isset($attributes['category_scores'][$category->value])) { continue; } $categories[$category->value] = CreateResponseCategory::from([ 'category' => $category->value, 'violated' => $attributes['categories'][$category->value], 'score' => $attributes['category_scores'][$category->value], ]); } return new CreateResponseResult( $categories, $attributes['flagged'], $attributes['category_applied_input_types'] ?? null, ); } /** * @return array{ categories: array, category_scores: array, flagged: bool, category_applied_input_types?: array>} */ public function toArray(): array { $categories = []; $categoryScores = []; foreach ($this->categories as $category) { $categories[$category->category->value] = $category->violated; $categoryScores[$category->category->value] = $category->score; } $result = [ 'categories' => $categories, 'category_scores' => $categoryScores, 'flagged' => $this->flagged, ]; if ($this->categoryAppliedInputTypes !== null) { $result['category_applied_input_types'] = $this->categoryAppliedInputTypes; } return $result; } } src/Responses/Moderations/CreateResponseCategory.php000064400000001206152665621660016747 0ustar00|null, delta: string} * * @implements ResponseContract */ final class TranscriptTextDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array|null $logprobs */ private function __construct( public readonly ?array $logprobs, public readonly string $delta, public readonly MetaInformation $meta, ) {} /** * @param TranscriptTextDeltaType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { if (isset($attributes['logprobs'])) { $logprobs = array_map( fn (array $logprob): Logprobs => Logprobs::from($logprob, $meta), $attributes['logprobs'] ); } return new self( logprobs: $logprobs ?? null, delta: $attributes['delta'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'logprobs' => $this->logprobs ? array_map( fn (Logprobs $logprob): array => $logprob->toArray(), $this->logprobs ) : null, 'delta' => $this->delta, ]; } } src/Responses/Audio/Streaming/TranscriptTextDone.php000064400000003603152665621660016644 0ustar00|null, text: string} * * @implements ResponseContract */ final class TranscriptTextDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array|null $logprobs */ private function __construct( public readonly ?array $logprobs, public readonly string $text, public readonly MetaInformation $meta, ) {} /** * @param TranscriptTextDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { if (isset($attributes['logprobs'])) { $logprobs = array_map( fn (array $logprob): Logprobs => Logprobs::from($logprob, $meta), $attributes['logprobs'] ); } return new self( logprobs: $logprobs ?? null, text: $attributes['text'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'logprobs' => $this->logprobs ? array_map( fn (Logprobs $logprob): array => $logprob->toArray(), $this->logprobs ) : null, 'text' => $this->text, ]; } } src/Responses/Audio/Streaming/Logprobs.php000064400000003047152665621660014631 0ustar00, logprobs: int, token: string} * * @implements ResponseContract */ final class Logprobs implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $bytes */ private function __construct( public readonly array $bytes, public readonly int $logprobs, public readonly string $token, public readonly MetaInformation $meta, ) {} /** * @param LogprobsType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( bytes: $attributes['bytes'], logprobs: $attributes['logprobs'], token: $attributes['token'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'bytes' => $this->bytes, 'logprobs' => $this->logprobs, 'token' => $this->token, ]; } } src/Responses/Audio/TranscriptionResponseSegment.php000064400000005464152665621660017017 0ustar00, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}> */ final class TranscriptionResponseSegment implements ResponseContract { /** * @use ArrayAccessible, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}> */ use ArrayAccessible; /** * @param array $tokens */ private function __construct( public readonly int $id, public readonly int $seek, public readonly float $start, public readonly float $end, public readonly string $text, public readonly array $tokens, public readonly float $temperature, public readonly float $avgLogprob, public readonly float $compressionRatio, public readonly float $noSpeechProb, public readonly ?bool $transient, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: int, seek: int, start: float, end: float, text: string, tokens: array, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], $attributes['seek'], $attributes['start'], $attributes['end'], $attributes['text'], $attributes['tokens'], $attributes['temperature'], $attributes['avg_logprob'], $attributes['compression_ratio'], $attributes['no_speech_prob'], $attributes['transient'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { $data = [ 'id' => $this->id, 'seek' => $this->seek, 'start' => $this->start, 'end' => $this->end, 'text' => $this->text, 'tokens' => $this->tokens, 'temperature' => $this->temperature, 'avg_logprob' => $this->avgLogprob, 'compression_ratio' => $this->compressionRatio, 'no_speech_prob' => $this->noSpeechProb, ]; if ($this->transient !== null) { $data['transient'] = $this->transient; } return $data; } } src/Responses/Audio/SpeechStreamResponse.php000064400000003034152665621660015207 0ustar00 */ final class SpeechStreamResponse implements ResponseHasMetaInformationContract, ResponseStreamContract { public function __construct( private readonly ResponseInterface $response, ) { // } /** * {@inheritDoc} */ public function getIterator(): Generator { while (! $this->response->getBody()->eof()) { yield $this->response->getBody()->read(1024); } } public function meta(): MetaInformation { // @phpstan-ignore-next-line return MetaInformation::from($this->response->getHeaders()); } public static function fake(?string $content = null, ?MetaInformation $meta = null): static { $psr17Factory = new Psr17Factory; $response = $psr17Factory->createResponse() ->withBody($psr17Factory->createStream($content ?? (string) file_get_contents(__DIR__ . '/../../Testing/Responses/Fixtures/Audio/speech-streamed.mp3'))); if ($meta instanceof \OpenAI\Responses\Meta\MetaInformation) { foreach ($meta->toArray() as $key => $value) { $response = $response->withHeader($key, (string) $value); } } return new self($response); } } src/Responses/Audio/TranscriptionStreamResponse.php000064400000003650152665621660016643 0ustar00} * * @implements ResponseContract */ final class TranscriptionStreamResponse implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use FakeableForStreamedResponse; private function __construct( public readonly string $event, public readonly TranscriptTextDelta|TranscriptTextDone $response, ) {} /** * @param array $attributes */ public static function from(array $attributes): self { $event = $attributes['type'] ?? throw new UnknownEventException('Missing event type in streamed response'); $meta = $attributes['__meta']; unset($attributes['__meta']); $response = match ($event) { 'transcript.text.delta' => TranscriptTextDelta::from($attributes, $meta), // @phpstan-ignore-line 'transcript.text.done' => TranscriptTextDone::from($attributes, $meta), // @phpstan-ignore-line default => throw new UnknownEventException('Unknown Audio Transcription streaming event: ' . $event), }; return new self( event: $event, // @phpstan-ignore-line response: $response, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'event' => $this->event, 'data' => $this->response->toArray(), ]; } } src/Responses/Audio/TranscriptionResponse.php000064400000007322152665621660015467 0ustar00, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, words: array, text: string}> */ final class TranscriptionResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, words: array, text: string}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $segments * @param array $words */ private function __construct( public readonly ?string $task, public readonly ?string $language, public readonly ?float $duration, public readonly array $segments, public readonly array $words, public readonly string $text, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{task: ?string, language: ?string, duration: ?float, segments: array, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, words: array, text: string}|string $attributes */ public static function from(array|string $attributes, MetaInformation $meta): self { if (is_string($attributes)) { $attributes = ['text' => $attributes]; } $segments = isset($attributes['segments']) ? array_map(fn (array $result): TranscriptionResponseSegment => TranscriptionResponseSegment::from( $result ), $attributes['segments']) : []; $words = isset($attributes['words']) ? array_map(fn (array $result): TranscriptionResponseWord => TranscriptionResponseWord::from( $result ), $attributes['words']) : []; return new self( $attributes['task'] ?? null, $attributes['language'] ?? null, $attributes['duration'] ?? null, $segments, $words, $attributes['text'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'task' => $this->task, 'language' => $this->language, 'duration' => $this->duration, 'segments' => array_map( static fn (TranscriptionResponseSegment $result): array => $result->toArray(), $this->segments, ), 'words' => array_map( static fn (TranscriptionResponseWord $result): array => $result->toArray(), $this->words, ), 'text' => $this->text, ]; } } src/Responses/Audio/TranscriptionResponseWord.php000064400000002231152665621660016315 0ustar00 */ final class TranscriptionResponseWord implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $word, public readonly float $start, public readonly float $end, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{word: string, start: float, end: float} $attributes */ public static function from(array $attributes): self { return new self( $attributes['word'], $attributes['start'], $attributes['end'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'word' => $this->word, 'start' => $this->start, 'end' => $this->end, ]; } } src/Responses/Audio/TranslationResponse.php000064400000006022152665621660015122 0ustar00, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, text: string}> */ final class TranslationResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, text: string}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $segments */ private function __construct( public readonly ?string $task, public readonly ?string $language, public readonly ?float $duration, public readonly array $segments, public readonly string $text, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{task: ?string, language: ?string, duration: ?float, segments: array, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, text: string} $attributes */ public static function from(array|string $attributes, MetaInformation $meta): self { if (is_string($attributes)) { $attributes = ['text' => $attributes]; } $segments = isset($attributes['segments']) ? array_map(fn (array $result): TranslationResponseSegment => TranslationResponseSegment::from( $result ), $attributes['segments']) : []; return new self( $attributes['task'] ?? null, $attributes['language'] ?? null, $attributes['duration'] ?? null, $segments, $attributes['text'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'task' => $this->task, 'language' => $this->language, 'duration' => $this->duration, 'segments' => array_map( static fn (TranslationResponseSegment $result): array => $result->toArray(), $this->segments, ), 'text' => $this->text, ]; } } src/Responses/Audio/TranslationResponseSegment.php000064400000005462152665621660016454 0ustar00, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}> */ final class TranslationResponseSegment implements ResponseContract { /** * @use ArrayAccessible, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}> */ use ArrayAccessible; /** * @param array $tokens */ private function __construct( public readonly int $id, public readonly int $seek, public readonly float $start, public readonly float $end, public readonly string $text, public readonly array $tokens, public readonly float $temperature, public readonly float $avgLogprob, public readonly float $compressionRatio, public readonly float $noSpeechProb, public readonly ?bool $transient, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: int, seek: int, start: float, end: float, text: string, tokens: array, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], $attributes['seek'], $attributes['start'], $attributes['end'], $attributes['text'], $attributes['tokens'], $attributes['temperature'], $attributes['avg_logprob'], $attributes['compression_ratio'], $attributes['no_speech_prob'], $attributes['transient'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { $data = [ 'id' => $this->id, 'seek' => $this->seek, 'start' => $this->start, 'end' => $this->end, 'text' => $this->text, 'tokens' => $this->tokens, 'temperature' => $this->temperature, 'avg_logprob' => $this->avgLogprob, 'compression_ratio' => $this->compressionRatio, 'no_speech_prob' => $this->noSpeechProb, ]; if ($this->transient !== null) { $data['transient'] = $this->transient; } return $data; } } src/Responses/Threads/ThreadResponse.php000064400000005025152665621660014366 0ustar00}, file_search?: array{vector_store_ids: array}}, metadata: array}> */ final class ThreadResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}, file_search?: array{vector_store_ids: array}}, metadata: array}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $metadata */ private function __construct( public string $id, public string $object, public int $createdAt, public ?AssistantResponseToolResources $toolResources, public array $metadata, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, tool_resources: ?array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], isset($attributes['tool_resources']) ? AssistantResponseToolResources::from($attributes['tool_resources']) : null, $attributes['metadata'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'tool_resources' => $this->toolResources?->toArray(), 'metadata' => $this->metadata, ]; } } src/Responses/Threads/ThreadDeleteResponse.php000064400000003041152665621660015505 0ustar00 */ final class ThreadDeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Threads/Runs/ThreadRunResponseToolChoice.php000064400000002647152665621660017762 0ustar00 */ final class ThreadRunResponseToolChoice implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public ?ThreadRunResponseToolChoiceFunction $function ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: string, function?: array{name: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], empty($attributes['function']) ? null : ThreadRunResponseToolChoiceFunction::from($attributes['function']), ); } /** * {@inheritDoc} */ public function toArray(): array { $response = [ 'type' => $this->type, ]; if ($this->function instanceof \OpenAI\Responses\Threads\Runs\ThreadRunResponseToolChoiceFunction) { $response['function'] = $this->function->toArray(); } return $response; } } src/Responses/Threads/Runs/ThreadRunResponseLastError.php000064400000002133152665621660017635 0ustar00 */ final class ThreadRunResponseLastError implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $code, public string $message, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{code: string, message: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['code'], $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'message' => $this->message, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepListResponse.php000064400000011623152665621660020571 0ustar00}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class ThreadRunStepListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): ThreadRunStepResponse => ThreadRunStepResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (ThreadRunStepResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseUsage.php000064400000002605152665621660020722 0ustar00 */ final class ThreadRunStepResponseUsage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public int $completionTokens, public int $promptTokens, public int $totalTokens, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{prompt_tokens: int, completion_tokens: int, total_tokens: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['completion_tokens'], $attributes['prompt_tokens'], $attributes['total_tokens'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'prompt_tokens' => $this->promptTokens, 'completion_tokens' => $this->completionTokens, 'total_tokens' => $this->totalTokens, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreterOutputLogs.php000064400000002212152665621660025014 0ustar00 */ final class ThreadRunStepResponseCodeInterpreterOutputLogs implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'logs' $type */ private function __construct( public string $type, public string $logs, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'logs', logs: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], $attributes['logs'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'logs' => $this->logs, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreter.php000064400000004644152665621660022761 0ustar00}> */ final class ThreadRunStepResponseCodeInterpreter implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param \OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseCodeInterpreterOutputLogs[]|\OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseCodeInterpreterOutputImage[]|null $outputs */ private function __construct( public ?string $input, public ?array $outputs, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{input?: string, outputs?: array} $attributes */ public static function from(array $attributes): self { $outputs = array_map( fn (array $output): \OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseCodeInterpreterOutputImage|\OpenAI\Responses\Threads\Runs\Steps\ThreadRunStepResponseCodeInterpreterOutputLogs => match ($output['type']) { 'image' => ThreadRunStepResponseCodeInterpreterOutputImage::from($output), 'logs' => ThreadRunStepResponseCodeInterpreterOutputLogs::from($output), }, $attributes['outputs'] ?? [], ); return new self( $attributes['input'] ?? null, $outputs, ); } /** * {@inheritDoc} */ public function toArray(): array { $response = []; if (! is_null($this->input)) { $response['input'] = $this->input; } if ($this->outputs) { $response['outputs'] = array_map( fn (ThreadRunStepResponseCodeInterpreterOutputImage|ThreadRunStepResponseCodeInterpreterOutputLogs $output): array => $output->toArray(), $this->outputs, ); } return $response; } } src/Responses/Threads/Runs/Steps/Delta/ThreadRunStepDeltaObject.php000064400000005772152665621660021360 0ustar00}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}> */ final class ThreadRunStepDeltaObject implements ResponseContract { /** * @use ArrayAccessible}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}> */ use ArrayAccessible; use Fakeable; private function __construct( public ThreadRunStepResponseMessageCreationStepDetails|ThreadRunStepResponseToolCallsStepDetails $stepDetails, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{step_details: array{type: 'tool_calls', tool_calls: array}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}} $attributes */ public static function from(array $attributes): self { $stepDetails = match ($attributes['step_details']['type']) { 'message_creation' => ThreadRunStepResponseMessageCreationStepDetails::from($attributes['step_details']), 'tool_calls' => ThreadRunStepResponseToolCallsStepDetails::from($attributes['step_details']), }; return new self( $stepDetails, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'step_details' => $this->stepDetails->toArray(), ]; } } src/Responses/Threads/Runs/Steps/Delta/ThreadRunStepDeltaResponse.php000064400000005476152665621660021751 0ustar00}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}}> */ final class ThreadRunStepDeltaResponse implements ResponseContract { /** * @use ArrayAccessible}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}}> */ use ArrayAccessible; use Fakeable; private function __construct( public ?string $id, public string $object, public ThreadRunStepDeltaObject $delta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id?: string, object: string, delta: array{step_details: array{type: 'tool_calls', tool_calls: array}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'] ?? null, $attributes['object'], ThreadRunStepDeltaObject::from($attributes['delta']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'delta' => $this->delta->toArray(), ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseFileSearchToolCall.php000064400000002674152665621660023323 0ustar00}> */ final class ThreadRunStepResponseFileSearchToolCall implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param 'file_search' $type * @param array $file_search */ private function __construct( public string $id, public string $type, public array $file_search, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, type: 'file_search', file_search: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], $attributes['type'], $attributes['file_search'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'type' => $this->type, 'file_search' => $this->file_search, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseMessageCreationStepDetails.php000064400000002647152665621660025077 0ustar00 */ final class ThreadRunStepResponseMessageCreationStepDetails implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'message_creation' $type */ private function __construct( public string $type, public ThreadRunStepResponseMessageCreation $messageCreation, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'message_creation', message_creation: array{message_id: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadRunStepResponseMessageCreation::from($attributes['message_creation']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'message_creation' => $this->messageCreation->toArray(), ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeToolCall.php000064400000003553152665621660022165 0ustar00}}> */ final class ThreadRunStepResponseCodeToolCall implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; /** * @param 'code_interpreter' $type */ private function __construct( public ?string $id, public string $type, public ThreadRunStepResponseCodeInterpreter $codeInterpreter, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id?: string, type: 'code_interpreter', code_interpreter: array{input?: string, outputs?: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'] ?? null, $attributes['type'], ThreadRunStepResponseCodeInterpreter::from($attributes['code_interpreter']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'type' => $this->type, 'code_interpreter' => $this->codeInterpreter->toArray(), ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseToolCallsStepDetails.php000064400000006312152665621660023713 0ustar00}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}> */ final class ThreadRunStepResponseToolCallsStepDetails implements ResponseContract { /** * @use ArrayAccessible}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}> */ use ArrayAccessible; use Fakeable; /** * @param 'tool_calls' $type * @param array $toolCalls */ private function __construct( public string $type, public array $toolCalls, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'tool_calls', tool_calls: array}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>} $attributes */ public static function from(array $attributes): self { $toolCalls = array_map( fn (array $toolCall): ThreadRunStepResponseCodeToolCall|ThreadRunStepResponseFileSearchToolCall|ThreadRunStepResponseFunctionToolCall => match ($toolCall['type']) { 'code_interpreter' => ThreadRunStepResponseCodeToolCall::from($toolCall), 'file_search' => ThreadRunStepResponseFileSearchToolCall::from($toolCall), 'function' => ThreadRunStepResponseFunctionToolCall::from($toolCall), }, $attributes['tool_calls'], ); return new self( $attributes['type'], $toolCalls, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'tool_calls' => array_map( fn (ThreadRunStepResponseCodeToolCall|ThreadRunStepResponseFileSearchToolCall|ThreadRunStepResponseFunctionToolCall $toolCall): array => $toolCall->toArray(), $this->toolCalls, ), ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreterOutputImage.php000064400000002474152665621660025144 0ustar00 */ final class ThreadRunStepResponseCodeInterpreterOutputImage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'image' $type */ private function __construct( public string $type, public ThreadRunStepResponseCodeInterpreterOutputImageImage $image, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'image', image: array{file_id: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadRunStepResponseCodeInterpreterOutputImageImage::from($attributes['image']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'image' => $this->image->toArray(), ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseFunctionToolCall.php000064400000003036152665621660023074 0ustar00 */ final class ThreadRunStepResponseFunctionToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'function' $type */ private function __construct( public ?string $id, public string $type, public ThreadRunStepResponseFunction $function, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'] ?? null, $attributes['type'], ThreadRunStepResponseFunction::from($attributes['function']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'type' => $this->type, 'function' => $this->function->toArray(), ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreterOutputImageImage.php000064400000001753152665621660026106 0ustar00 */ final class ThreadRunStepResponseCodeInterpreterOutputImageImage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $fileId, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_id: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['file_id'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseMessageCreation.php000064400000001760152665621660022730 0ustar00 */ final class ThreadRunStepResponseMessageCreation implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $messageId, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{message_id: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['message_id'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'message_id' => $this->messageId, ]; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponse.php000064400000014455152665621660017743 0ustar00}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> */ final class ThreadRunStepResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}|array{id: string, type: 'file_search', file_search: array}|array{id: ?string, type: 'function', function: array{name: ?string, arguments: string, output: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $metadata */ private function __construct( public string $id, public string $object, public int $createdAt, public string $threadId, public string $assistantId, public string $runId, public string $type, public string $status, public ThreadRunStepResponseMessageCreationStepDetails|ThreadRunStepResponseToolCallsStepDetails $stepDetails, public ?ThreadRunResponseLastError $lastError, public ?int $expiresAt, public ?int $cancelledAt, public ?int $failedAt, public ?int $completedAt, public array $metadata, private readonly MetaInformation $meta, public ?ThreadRunStepResponseUsage $usage ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, thread_id: string, assistant_id: string, run_id: string, type: string, status: string, step_details: array{type: 'tool_calls', tool_calls: array}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $stepDetails = match ($attributes['step_details']['type']) { 'message_creation' => ThreadRunStepResponseMessageCreationStepDetails::from($attributes['step_details']), 'tool_calls' => ThreadRunStepResponseToolCallsStepDetails::from($attributes['step_details']), }; return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], $attributes['thread_id'], $attributes['assistant_id'], $attributes['run_id'], $attributes['type'], $attributes['status'], $stepDetails, isset($attributes['last_error']) ? ThreadRunResponseLastError::from($attributes['last_error']) : null, $attributes['expires_at'], $attributes['cancelled_at'], $attributes['failed_at'], $attributes['completed_at'], $attributes['metadata'] ?? [], $meta, empty($attributes['usage']) ? null : ThreadRunStepResponseUsage::from($attributes['usage']), ); } /** * {@inheritDoc} */ public function toArray(): array { $data = [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'run_id' => $this->runId, 'assistant_id' => $this->assistantId, 'thread_id' => $this->threadId, 'type' => $this->type, 'status' => $this->status, 'cancelled_at' => $this->cancelledAt, 'completed_at' => $this->completedAt, 'expires_at' => $this->expiresAt, 'failed_at' => $this->failedAt, 'last_error' => $this->lastError?->toArray(), 'step_details' => $this->stepDetails->toArray(), 'usage' => $this->usage?->toArray(), ]; if ($this->metadata !== []) { $data['metadata'] = $this->metadata; } return $data; } } src/Responses/Threads/Runs/Steps/ThreadRunStepResponseFunction.php000064400000002451152665621660021442 0ustar00 */ final class ThreadRunStepResponseFunction implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public ?string $name, public string $arguments, public ?string $output, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{name?: string, arguments: string, output?: ?string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['name'] ?? null, $attributes['arguments'], $attributes['output'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'arguments' => $this->arguments, 'output' => $this->output, ]; } } src/Responses/Threads/Runs/ThreadRunStreamResponse.php000064400000006551152665621660017163 0ustar00}> */ class ThreadRunStreamResponse implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use FakeableForStreamedResponse; private function __construct( public readonly string $event, public readonly ThreadResponse|ThreadRunResponse|ThreadRunStepResponse|ThreadRunStepDeltaResponse|ThreadMessageResponse|ThreadMessageDeltaResponse $response, ) {} /** * Acts as static factory, and returns a new Response instance. * * Maps the appropriate classes onto each event from the assistants streaming api * https://platform.openai.com/docs/api-reference/assistants-streaming/events * * @param array $attributes */ public static function from(array $attributes): self { $event = $attributes['__event']; unset($attributes['__event']); $meta = $attributes['__meta']; unset($attributes['__meta']); $response = match ($event) { 'thread.created' => ThreadResponse::from($attributes, $meta), // @phpstan-ignore-line 'thread.run.created', 'thread.run.queued', 'thread.run.in_progress', 'thread.run.requires_action', 'thread.run.completed', 'thread.run.incomplete', 'thread.run.failed', 'thread.run.cancelling', 'thread.run.cancelled', 'thread.run.expired' => ThreadRunResponse::from($attributes, $meta), // @phpstan-ignore-line 'thread.run.step.created', 'thread.run.step.in_progress', 'thread.run.step.completed', 'thread.run.step.failed', 'thread.run.step.cancelled', 'thread.run.step.expired' => ThreadRunStepResponse::from($attributes, $meta), // @phpstan-ignore-line 'thread.run.step.delta' => ThreadRunStepDeltaResponse::from($attributes), // @phpstan-ignore-line 'thread.message.created', 'thread.message.in_progress', 'thread.message.completed', 'thread.message.incomplete' => ThreadMessageResponse::from($attributes, $meta), // @phpstan-ignore-line 'thread.message.delta' => ThreadMessageDeltaResponse::from($attributes), // @phpstan-ignore-line default => throw new UnknownEventException('Unknown event: ' . $event), }; return new self( $event, // @phpstan-ignore-line $response, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'event' => $this->event, 'data' => $this->response->toArray(), ]; } } src/Responses/Threads/Runs/ThreadRunResponseFileSearch.php000064400000001700152665621660017724 0ustar00 */ final class ThreadRunResponseFileSearch implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'file_search'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Threads/Runs/ThreadRunResponseToolCodeInterpreter.php000064400000001716152665621660021662 0ustar00 */ final class ThreadRunResponseToolCodeInterpreter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'code_interpreter'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Threads/Runs/ThreadRunResponseToolFunction.php000064400000002615152665621660020350 0ustar00}}> */ final class ThreadRunResponseToolFunction implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public ThreadRunResponseToolFunctionFunction $function, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'function', function: array{description: string, name: string, parameters: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadRunResponseToolFunctionFunction::from($attributes['function']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'function' => $this->function->toArray(), ]; } } src/Responses/Threads/Runs/ThreadRunResponseTruncationStrategy.php000064400000002212152665621660021567 0ustar00 */ final class ThreadRunResponseTruncationStrategy implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public ?int $lastMessages, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: string, last_messages: ?int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], $attributes['last_messages'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'last_messages' => $this->lastMessages, ]; } } src/Responses/Threads/Runs/ThreadRunResponseRequiredActionSubmitToolOutputs.php000064400000003203152665621660024263 0ustar00}> */ final class ThreadRunResponseRequiredActionSubmitToolOutputs implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $toolCalls */ private function __construct( public array $toolCalls, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{tool_calls: array} $attributes */ public static function from(array $attributes): self { $toolCalls = array_map(fn (array $toolCall): ThreadRunResponseRequiredActionFunctionToolCall => ThreadRunResponseRequiredActionFunctionToolCall::from($toolCall), $attributes['tool_calls']); return new self( $toolCalls, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'tool_calls' => array_map(fn (ThreadRunResponseRequiredActionFunctionToolCall $toolCall): array => $toolCall->toArray(), $this->toolCalls), ]; } } src/Responses/Threads/Runs/ThreadRunResponseRequiredActionFunctionToolCall.php000064400000002726152665621660024006 0ustar00 */ final class ThreadRunResponseRequiredActionFunctionToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $id, public string $type, public ThreadRunResponseRequiredActionFunctionToolCallFunction $function, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, type: string, function: array{name: string, arguments: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], $attributes['type'], ThreadRunResponseRequiredActionFunctionToolCallFunction::from($attributes['function']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'type' => $this->type, 'function' => $this->function->toArray(), ]; } } src/Responses/Threads/Runs/ThreadRunResponseRequiredAction.php000064400000003147152665621660020644 0ustar00}}> */ final class ThreadRunResponseRequiredAction implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public ThreadRunResponseRequiredActionSubmitToolOutputs $submitToolOutputs, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: string, submit_tool_outputs: array{tool_calls: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadRunResponseRequiredActionSubmitToolOutputs::from($attributes['submit_tool_outputs']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'submit_tool_outputs' => $this->submitToolOutputs->toArray(), ]; } } src/Responses/Threads/Runs/ThreadRunResponseToolFunctionFunction.php000064400000002646152665621660022062 0ustar00}> */ final class ThreadRunResponseToolFunctionFunction implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $parameters */ private function __construct( public string $name, public string $description, public array $parameters, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{description: string, name: string, parameters: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['name'], $attributes['description'], $attributes['parameters'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'description' => $this->description, 'parameters' => $this->parameters, ]; } } src/Responses/Threads/Runs/ThreadRunResponseToolChoiceFunction.php000064400000001701152665621660021456 0ustar00 */ final class ThreadRunResponseToolChoiceFunction implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $name, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{name: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['name'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, ]; } } src/Responses/Threads/Runs/ThreadRunResponseUsage.php000064400000001755152665621660016775 0ustar00 $this->promptTokens, 'completion_tokens' => $this->completionTokens, 'total_tokens' => $this->totalTokens, ]; } } src/Responses/Threads/Runs/ThreadRunResponseIncompleteDetails.php000064400000001716152665621660021333 0ustar00 */ final class ThreadRunResponseIncompleteDetails implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $reason, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{reason: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['reason'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'reason' => $this->reason, ]; } } src/Responses/Threads/Runs/ThreadRunResponse.php000064400000023550152665621660016005 0ustar00}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: null|array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: ?array{type: string, last_messages: ?int}, tool_choice: null|string|array{type: string, function?: array{name: string}}, response_format: null|string|array{type: string}}> */ final class ThreadRunResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: ?array{type: string, last_messages: ?int}, tool_choice: null|string|array{type: string, function?: array{name: string}}, response_format: null|string|array{type: string}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $tools * @param array $metadata */ private function __construct( public string $id, public string $object, public int $createdAt, public string $threadId, public string $assistantId, public string $status, public ?ThreadRunResponseRequiredAction $requiredAction, public ?ThreadRunResponseLastError $lastError, public ?int $expiresAt, public ?int $startedAt, public ?int $cancelledAt, public ?int $failedAt, public ?int $completedAt, public ?ThreadRunResponseIncompleteDetails $incompleteDetails, public string $model, public ?string $instructions, public array $tools, public array $metadata, public ?ThreadRunResponseUsage $usage, public ?float $temperature, public ?float $topP, public ?int $maxPromptTokens, public ?int $maxCompletionTokens, public ?ThreadRunResponseTruncationStrategy $truncationStrategy, public null|string|ThreadRunResponseToolChoice $toolChoice, public null|string|AssistantResponseResponseFormat $responseFormat, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, thread_id: string, assistant_id: string, status: string, required_action?: array{type: string, submit_tool_outputs: array{tool_calls: array}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: ?array{type: string, last_messages: ?int}, tool_choice: null|string|array{type: string, function?: array{name: string}}, response_format: null|string|array{type: 'text'|'json_object'}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $tools = array_map( fn (array $tool): ThreadRunResponseToolCodeInterpreter|ThreadRunResponseFileSearch|ThreadRunResponseToolFunction => match ($tool['type']) { 'code_interpreter' => ThreadRunResponseToolCodeInterpreter::from($tool), 'file_search' => ThreadRunResponseFileSearch::from($tool), 'function' => ThreadRunResponseToolFunction::from($tool), }, $attributes['tools'], ); $responseFormat = is_array($attributes['response_format']) ? AssistantResponseResponseFormat::from($attributes['response_format']) : $attributes['response_format']; return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], $attributes['thread_id'], $attributes['assistant_id'], $attributes['status'], isset($attributes['required_action']) ? ThreadRunResponseRequiredAction::from($attributes['required_action']) : null, isset($attributes['last_error']) ? ThreadRunResponseLastError::from($attributes['last_error']) : null, $attributes['expires_at'], $attributes['started_at'], $attributes['cancelled_at'], $attributes['failed_at'], $attributes['completed_at'], isset($attributes['incomplete_details']) ? ThreadRunResponseIncompleteDetails::from($attributes['incomplete_details']) : null, $attributes['model'], $attributes['instructions'], $tools, $attributes['metadata'], isset($attributes['usage']) ? ThreadRunResponseUsage::from($attributes['usage']) : null, $attributes['temperature'] ?? null, $attributes['top_p'] ?? null, $attributes['max_prompt_tokens'] ?? null, $attributes['max_completion_tokens'] ?? null, $attributes['truncation_strategy'] !== null ? ThreadRunResponseTruncationStrategy::from($attributes['truncation_strategy']) : null, is_array($attributes['tool_choice']) ? ThreadRunResponseToolChoice::from($attributes['tool_choice']) : $attributes['tool_choice'], $responseFormat, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { $data = [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'assistant_id' => $this->assistantId, 'thread_id' => $this->threadId, 'status' => $this->status, 'started_at' => $this->startedAt, 'expires_at' => $this->expiresAt, 'cancelled_at' => $this->cancelledAt, 'failed_at' => $this->failedAt, 'completed_at' => $this->completedAt, 'incomplete_details' => $this->incompleteDetails?->toArray(), 'required_action' => $this->requiredAction?->toArray(), 'last_error' => $this->lastError?->toArray(), 'model' => $this->model, 'instructions' => $this->instructions, 'tools' => array_map( fn (ThreadRunResponseToolCodeInterpreter|ThreadRunResponseFileSearch|ThreadRunResponseToolFunction $tool): array => $tool->toArray(), $this->tools, ), 'metadata' => $this->metadata, 'usage' => $this->usage?->toArray(), 'temperature' => $this->temperature, 'top_p' => $this->topP, 'max_prompt_tokens' => $this->maxPromptTokens, 'max_completion_tokens' => $this->maxCompletionTokens, 'truncation_strategy' => $this->truncationStrategy?->toArray(), 'tool_choice' => $this->toolChoice instanceof ThreadRunResponseToolChoice ? $this->toolChoice->toArray() : $this->toolChoice, 'response_format' => $this->responseFormat instanceof AssistantResponseResponseFormat ? $this->responseFormat->toArray() : $this->responseFormat, ]; if ($data['required_action'] === null) { unset($data['required_action']); } if ($data['usage'] === null) { unset($data['usage']); } return $data; } } src/Responses/Threads/Runs/ThreadRunResponseRequiredActionFunctionToolCallFunction.php000064400000002210152665621660025500 0ustar00 */ final class ThreadRunResponseRequiredActionFunctionToolCallFunction implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $name, public string $arguments, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{name: string, arguments: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['name'], $attributes['arguments'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'arguments' => $this->arguments, ]; } } src/Responses/Threads/Runs/ThreadRunListResponse.php000064400000012742152665621660016642 0ustar00}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: null|array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: ?array{type: string, last_messages: ?int}, tool_choice: null|string|array{type: string, function?: array{name: string}}, response_format: null|string|array{type: string}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class ThreadRunListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: null|array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: ?array{type: string, last_messages: ?int}, tool_choice: null|string|array{type: string, function?: array{name: string}}, response_format: null|string|array{type: string}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): ThreadRunResponse => ThreadRunResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (ThreadRunResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentTextAnnotationFilePath.php000064400000001750152665621660025313 0ustar00 */ final class ThreadMessageResponseContentTextAnnotationFilePath implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $fileId, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_id: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['file_id'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentTextAnnotationFileCitation.php000064400000002307152665621660026170 0ustar00 */ final class ThreadMessageResponseContentTextAnnotationFileCitation implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $fileId, public ?string $quote, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_id: string, quote?: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['file_id'], $attributes['quote'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'file_id' => $this->fileId, 'quote' => $this->quote, ], fn (?string $value): bool => $value !== null); } } src/Responses/Threads/Messages/Delta/ThreadMessageDeltaObject.php000064400000006473152665621660021065 0ustar00}}>, file_ids: ?array}> */ final class ThreadMessageDeltaObject implements ResponseContract { /** * @use ArrayAccessible}}>, file_ids: ?array}> */ use ArrayAccessible; use Fakeable; /** * @param array $content * @param array|null $fileIds */ private function __construct( public ?string $role, public array $content, public ?array $fileIds, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{role?: string, content: array}}>, file_ids?: array} $attributes */ public static function from(array $attributes): self { $content = array_map( fn (array $content): ThreadMessageDeltaResponseContentTextObject|ThreadMessageDeltaResponseContentImageFileObject => match ($content['type']) { 'text' => ThreadMessageDeltaResponseContentTextObject::from($content), 'image_file' => ThreadMessageDeltaResponseContentImageFileObject::from($content), }, $attributes['content'], ); return new self( $attributes['role'] ?? null, $content, $attributes['file_ids'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'role' => $this->role, 'content' => array_map(fn (ThreadMessageDeltaResponseContentImageFileObject|ThreadMessageDeltaResponseContentTextObject $content): array => $content->toArray(), $this->content), 'file_ids' => $this->fileIds, ]; } } src/Responses/Threads/Messages/Delta/ThreadMessageDeltaResponseContentImageFileObject.php000064400000003150152665621660025667 0ustar00 */ final class ThreadMessageDeltaResponseContentImageFileObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'image_file' $type */ private function __construct( public int $index, public string $type, public ThreadMessageResponseContentImageFile $imageFile, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{index: int, type: 'image_file', image_file: array{file_id: string, detail?: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['index'], $attributes['type'], ThreadMessageResponseContentImageFile::from($attributes['image_file']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'index' => $this->index, 'type' => $this->type, 'image_file' => $this->imageFile->toArray(), ]; } } src/Responses/Threads/Messages/Delta/ThreadMessageDeltaResponseContentTextObject.php000064400000004265152665621660025001 0ustar00}}> */ final class ThreadMessageDeltaResponseContentTextObject implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; /** * @param 'text' $type */ private function __construct( public int $index, public string $type, public ThreadMessageDeltaResponseContentText $text, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{index: int, type: 'text', text: array{value?: string, annotations: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['index'], $attributes['type'], ThreadMessageDeltaResponseContentText::from($attributes['text']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'index' => $this->index, 'type' => $this->type, 'text' => $this->text->toArray(), ]; } } src/Responses/Threads/Messages/Delta/ThreadMessageDeltaResponseContentText.php000064400000006021152665621660023642 0ustar00}> */ final class ThreadMessageDeltaResponseContentText implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param \OpenAI\Responses\Threads\Messages\ThreadMessageResponseContentTextAnnotationFilePathObject[]|\OpenAI\Responses\Threads\Messages\ThreadMessageResponseContentTextAnnotationFileCitationObject[] $annotations */ private function __construct( public ?string $value, public array $annotations, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{value?: string, annotations?: array} $attributes */ public static function from(array $attributes): self { $annotations = array_map( fn (array $annotation): ThreadMessageResponseContentTextAnnotationFileCitationObject|ThreadMessageResponseContentTextAnnotationFilePathObject => match ($annotation['type']) { 'file_citation' => ThreadMessageResponseContentTextAnnotationFileCitationObject::from($annotation), 'file_path' => ThreadMessageResponseContentTextAnnotationFilePathObject::from($annotation), }, $attributes['annotations'] ?? [], ); return new self( $attributes['value'] ?? null, $annotations, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'value' => $this->value, 'annotations' => array_map( fn (ThreadMessageResponseContentTextAnnotationFilePathObject|ThreadMessageResponseContentTextAnnotationFileCitationObject $annotation): array => $annotation->toArray(), $this->annotations, ), ]; } } src/Responses/Threads/Messages/Delta/ThreadMessageDeltaResponse.php000064400000005254152665621660021451 0ustar00}}>, file_ids: array|null}}> */ final class ThreadMessageDeltaResponse implements ResponseContract { /** * @use ArrayAccessible}}>, file_ids: array|null}}> */ use ArrayAccessible; use Fakeable; private function __construct( public string $id, public string $object, public ThreadMessageDeltaObject $delta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, delta: array{role?: string, content: array}}>, file_ids?: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], $attributes['object'], ThreadMessageDeltaObject::from($attributes['delta']) ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'delta' => $this->delta->toArray(), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentTextAnnotationFileCitationObject.php000064400000003701152665621660027316 0ustar00 */ final class ThreadMessageResponseContentTextAnnotationFileCitationObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'file_citation' $type */ private function __construct( public string $type, public string $text, public int $startIndex, public int $endIndex, public ThreadMessageResponseContentTextAnnotationFileCitation $fileCitation, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'file_citation', text: string, file_citation: array{file_id: string, quote?: string}, start_index: int, end_index: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], $attributes['text'], $attributes['start_index'], $attributes['end_index'], ThreadMessageResponseContentTextAnnotationFileCitation::from($attributes['file_citation']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'text' => $this->text, 'start_index' => $this->startIndex, 'end_index' => $this->endIndex, 'file_citation' => $this->fileCitation->toArray(), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentImageUrlObject.php000064400000002554152665621660023556 0ustar00 */ final class ThreadMessageResponseContentImageUrlObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'image_url' $type */ private function __construct( public string $type, public ThreadMessageResponseContentImageUrl $imageFile, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'image_url', image_url: array{url: string, detail?: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadMessageResponseContentImageUrl::from($attributes['image_url']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'image_url' => $this->imageFile->toArray(), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentText.php000064400000005362152665621660021646 0ustar00}> */ final class ThreadMessageResponseContentText implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $annotations */ private function __construct( public string $value, public array $annotations, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{value: string, annotations: array} $attributes */ public static function from(array $attributes): self { $annotations = array_map( fn (array $annotation): ThreadMessageResponseContentTextAnnotationFileCitationObject|ThreadMessageResponseContentTextAnnotationFilePathObject => match ($annotation['type']) { 'file_citation' => ThreadMessageResponseContentTextAnnotationFileCitationObject::from($annotation), 'file_path' => ThreadMessageResponseContentTextAnnotationFilePathObject::from($annotation), }, $attributes['annotations'], ); return new self( $attributes['value'], $annotations, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'value' => $this->value, 'annotations' => array_map( fn (ThreadMessageResponseContentTextAnnotationFilePathObject|ThreadMessageResponseContentTextAnnotationFileCitationObject $annotation): array => $annotation->toArray(), $this->annotations, ), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseAttachment.php000064400000003655152665621660021462 0ustar00}> */ final class ThreadMessageResponseAttachment implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $tools */ private function __construct( public string $fileId, public array $tools, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_id: string, tools: array} $attributes */ public static function from(array $attributes): self { $tools = array_map(fn (array $tool): ThreadMessageResponseAttachmentFileSearchTool|ThreadMessageResponseAttachmentCodeInterpreterTool => match ($tool['type']) { 'file_search' => ThreadMessageResponseAttachmentFileSearchTool::from($tool), 'code_interpreter' => ThreadMessageResponseAttachmentCodeInterpreterTool::from($tool), }, $attributes['tools']); return new self( $attributes['file_id'], $tools, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, 'tools' => array_map( fn (ThreadMessageResponseAttachmentCodeInterpreterTool|ThreadMessageResponseAttachmentFileSearchTool $tool): array => $tool->toArray(), $this->tools, ), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentTextObject.php000064400000004025152665621660022770 0ustar00}}> */ final class ThreadMessageResponseContentTextObject implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; /** * @param 'text' $type */ private function __construct( public string $type, public ThreadMessageResponseContentText $text, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'text', text: array{value: string, annotations: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadMessageResponseContentText::from($attributes['text']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'text' => $this->text->toArray(), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseIncompleteDetails.php000064400000001726152665621660022774 0ustar00 */ final class ThreadMessageResponseIncompleteDetails implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $reason, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{reason: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['reason'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'reason' => $this->reason, ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentImageFile.php000064400000002274152665621660022543 0ustar00 */ final class ThreadMessageResponseContentImageFile implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $fileId, public ?string $detail, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_id: string, detail?: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['file_id'], $attributes['detail'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'file_id' => $this->fileId, 'detail' => $this->detail, ], fn (?string $value): bool => $value !== null); } } src/Responses/Threads/Messages/ThreadMessageResponseAttachmentFileSearchTool.php000064400000002030152665621660024230 0ustar00 */ final class ThreadMessageResponseAttachmentFileSearchTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'file_search' $type */ private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'file_search'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Threads/Messages/ThreadMessageResponseAttachmentCodeInterpreterTool.php000064400000002061152665621660025325 0ustar00 */ final class ThreadMessageResponseAttachmentCodeInterpreterTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'code_interpreter' $type */ private function __construct( public string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'code_interpreter'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Threads/Messages/ThreadMessageListResponse.php000064400000010654152665621660020302 0ustar00}}|array{type: string, image_file: array{file_id: string}}|array{type: 'image_url', image_url: array{url: string, detail?: string}}>, assistant_id: ?string, run_id: ?string, attachments: array}>, metadata: array}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class ThreadMessageListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}|array{type: string, image_file: array{file_id: string}}|array{type: 'image_url', image_url: array{url: string, detail?: string}}>, assistant_id: ?string, run_id: ?string, attachments: array}>, metadata: array}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array}}>, assistant_id: ?string, run_id: ?string, attachments?: array}>, metadata: array}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): ThreadMessageResponse => ThreadMessageResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (ThreadMessageResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Threads/Messages/ThreadMessageDeleteResponse.php000064400000003061152665621660020563 0ustar00 */ final class ThreadMessageDeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Threads/Messages/ThreadMessageResponse.php000064400000013354152665621660017446 0ustar00}}|array{type: string, image_file: array{file_id: string, detail?: string}}|array{type: 'image_url', image_url: array{url: string, detail?: string}}>, assistant_id: ?string, run_id: ?string, attachments: array}>, metadata: array}> */ final class ThreadMessageResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}}|array{type: string, image_file: array{file_id: string, detail?: string}}|array{type: 'image_url', image_url: array{url: string, detail?: string}}>, assistant_id: ?string, run_id: ?string, attachments: array}>, metadata: array}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $content * @param array $attachments * @param array $metadata */ private function __construct( public string $id, public string $object, public int $createdAt, public string $threadId, public string $role, public array $content, public ?string $assistantId, public ?string $runId, public array $attachments, public array $metadata, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, thread_id: string, role: string, content: array}}>, assistant_id: ?string, run_id: ?string, attachments?: array}>, metadata: array} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $content = array_map( fn (array $content): ThreadMessageResponseContentTextObject|ThreadMessageResponseContentImageFileObject|ThreadMessageResponseContentImageUrlObject => match ($content['type']) { 'text' => ThreadMessageResponseContentTextObject::from($content), 'image_file' => ThreadMessageResponseContentImageFileObject::from($content), 'image_url' => ThreadMessageResponseContentImageUrlObject::from($content), }, $attributes['content'], ); $attachments = array_map( fn (array $attachment): ThreadMessageResponseAttachment => ThreadMessageResponseAttachment::from($attachment), $attributes['attachments'] ?? [] ); return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], $attributes['thread_id'], $attributes['role'], $content, $attributes['assistant_id'], $attributes['run_id'], $attachments, $attributes['metadata'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'thread_id' => $this->threadId, 'role' => $this->role, 'content' => array_map( fn (ThreadMessageResponseContentImageFileObject|ThreadMessageResponseContentTextObject|ThreadMessageResponseContentImageUrlObject $content): array => $content->toArray(), $this->content, ), 'attachments' => array_map( fn (ThreadMessageResponseAttachment $attachment): array => $attachment->toArray(), $this->attachments ), 'assistant_id' => $this->assistantId, 'run_id' => $this->runId, 'metadata' => $this->metadata, ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentImageUrl.php000064400000002243152665621660022422 0ustar00 */ final class ThreadMessageResponseContentImageUrl implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $url, public ?string $detail, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{url: string, detail?: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['url'], $attributes['detail'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'url' => $this->url, 'detail' => $this->detail, ], fn (?string $value): bool => $value !== null); } } src/Responses/Threads/Messages/ThreadMessageResponseContentImageFileObject.php000064400000002500152665621660023662 0ustar00 */ final class ThreadMessageResponseContentImageFileObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public ThreadMessageResponseContentImageFile $imageFile, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: string, image_file: array{file_id: string, detail?: string}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadMessageResponseContentImageFile::from($attributes['image_file']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'image_file' => $this->imageFile->toArray(), ]; } } src/Responses/Threads/Messages/ThreadMessageResponseContentTextAnnotationFilePathObject.php000064400000003523152665621660026442 0ustar00 */ final class ThreadMessageResponseContentTextAnnotationFilePathObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'file_path' $type */ private function __construct( public string $type, public string $text, public int $startIndex, public int $endIndex, public ThreadMessageResponseContentTextAnnotationFilePath $filePath, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'file_path', text: string, file_path: array{file_id: string}, start_index: int, end_index: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], $attributes['text'], $attributes['start_index'], $attributes['end_index'], ThreadMessageResponseContentTextAnnotationFilePath::from($attributes['file_path']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'text' => $this->text, 'start_index' => $this->startIndex, 'end_index' => $this->endIndex, 'file_path' => $this->filePath->toArray(), ]; } } src/Responses/Batches/BatchResponseErrorsData.php000064400000002457152665621660016154 0ustar00 */ final class BatchResponseErrorsData implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public string $code, public string $message, public ?string $param, public ?int $line, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{code: string, message: string, param: ?string, line: ?int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['code'], $attributes['message'], $attributes['param'], $attributes['line'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'message' => $this->message, 'param' => $this->param, 'line' => $this->line, ]; } } src/Responses/Batches/BatchListResponse.php000064400000007575152665621660015027 0ustar00}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts: ?array{total: int, completed: int, failed: int}, metadata: ?array}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class BatchListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts: ?array{total: int, completed: int, failed: int}, metadata: ?array}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts?: array{total: int, completed: int, failed: int}, metadata: ?array}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): BatchResponse => BatchResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (BatchResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Batches/BatchResponse.php000064400000012710152665621660014156 0ustar00}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts: ?array{total: int, completed: int, failed: int}, metadata: ?array}> */ final class BatchResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts: ?array{total: int, completed: int, failed: int}, metadata: ?array}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array|null $metadata */ private function __construct( public string $id, public string $object, public string $endpoint, public ?BatchResponseErrors $errors, public string $inputFileId, public string $completionWindow, public string $status, public ?string $outputFileId, public ?string $errorFileId, public int $createdAt, public ?int $inProgressAt, public ?int $expiresAt, public ?int $finalizingAt, public ?int $completedAt, public ?int $failedAt, public ?int $expiredAt, public ?int $cancellingAt, public ?int $cancelledAt, public ?BatchResponseRequestCounts $requestCounts, public ?array $metadata, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, endpoint: string, errors?: array{object: string, data: array}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts?: array{total: int, completed: int, failed: int}, metadata: ?array} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['endpoint'], isset($attributes['errors']) ? BatchResponseErrors::from($attributes['errors']) : null, $attributes['input_file_id'], $attributes['completion_window'], $attributes['status'], $attributes['output_file_id'], $attributes['error_file_id'], $attributes['created_at'], $attributes['in_progress_at'], $attributes['expires_at'], $attributes['finalizing_at'], $attributes['completed_at'], $attributes['failed_at'], $attributes['expired_at'], $attributes['cancelling_at'], $attributes['cancelled_at'], isset($attributes['request_counts']) ? BatchResponseRequestCounts::from($attributes['request_counts']) : null, $attributes['metadata'], $meta ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'endpoint' => $this->endpoint, 'errors' => $this->errors?->toArray(), 'input_file_id' => $this->inputFileId, 'completion_window' => $this->completionWindow, 'status' => $this->status, 'output_file_id' => $this->outputFileId, 'error_file_id' => $this->errorFileId, 'created_at' => $this->createdAt, 'in_progress_at' => $this->inProgressAt, 'expires_at' => $this->expiresAt, 'finalizing_at' => $this->finalizingAt, 'completed_at' => $this->completedAt, 'failed_at' => $this->failedAt, 'expired_at' => $this->expiredAt, 'cancelling_at' => $this->cancellingAt, 'cancelled_at' => $this->cancelledAt, 'request_counts' => $this->requestCounts?->toArray(), 'metadata' => $this->metadata, ]; } } src/Responses/Batches/BatchResponseErrors.php000064400000003046152665621660015355 0ustar00}> */ final class BatchResponseErrors implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; /** * @param array $data */ private function __construct( public string $object, public array $data, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['object'], array_map( fn (array $data): \OpenAI\Responses\Batches\BatchResponseErrorsData => BatchResponseErrorsData::from($data), $attributes['data'] ) ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map(fn (BatchResponseErrorsData $data): array => $data->toArray(), $this->data), ]; } } src/Responses/Batches/BatchResponseRequestCounts.php000064400000002242152665621660016722 0ustar00 */ final class BatchResponseRequestCounts implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public int $total, public int $completed, public int $failed, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{total: int, completed: int, failed: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['total'], $attributes['completed'], $attributes['failed'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'total' => $this->total, 'completed' => $this->completed, 'failed' => $this->failed, ]; } } src/Responses/Models/ListResponse.php000064400000003643152665621660013727 0ustar00}> */ final class ListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, private readonly MetaInformation $meta, ) {} /** * @param array{object: string, data: array} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): RetrieveResponse => RetrieveResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (RetrieveResponse $response): array => $response->toArray(), $this->data, ), ]; } } src/Responses/Models/DeleteResponse.php000064400000003032152665621660014206 0ustar00 */ final class DeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Models/RetrieveResponse.php000064400000003375152665621660014603 0ustar00 */ final class RetrieveResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly ?int $created, public readonly ?string $ownedBy, private readonly MetaInformation $meta, ) {} /** * @param array{id: string, object: string, created: ?int, created_at?: ?int, owned_by: ?string} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( id: $attributes['id'], object: $attributes['object'], created: $attributes['created'] ?? $attributes['created_at'] ?? null, ownedBy: $attributes['owned_by'] ?? null, meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created' => $this->created, 'owned_by' => $this->ownedBy, ]; } } src/Responses/Concerns/HasMetaInformation.php000064400000000344152665621660015347 0ustar00meta; } } src/Responses/Concerns/ArrayAccessible.php000064400000001604152665621660014653 0ustar00 */ trait ArrayAccessible { /** * {@inheritDoc} */ public function offsetExists(mixed $offset): bool { return array_key_exists($offset, $this->toArray()); } /** * {@inheritDoc} */ public function offsetGet(mixed $offset): mixed { return $this->toArray()[$offset]; // @phpstan-ignore-line } /** * {@inheritDoc} */ public function offsetSet(mixed $offset, mixed $value): never { throw new BadMethodCallException('Cannot set response attributes.'); } /** * {@inheritDoc} */ public function offsetUnset(mixed $offset): never { throw new BadMethodCallException('Cannot unset response attributes.'); } } src/Responses/Edits/CreateResponse.php000064400000004712152665621660014042 0ustar00, usage: array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, usage: array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $choices */ private function __construct( public readonly string $object, public readonly int $created, public readonly array $choices, public readonly CreateResponseUsage $usage, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, created: int, choices: array, usage: array{prompt_tokens: int, completion_tokens: int, total_tokens: int}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $choices = array_map(fn (array $result): CreateResponseChoice => CreateResponseChoice::from( $result ), $attributes['choices']); return new self( $attributes['object'], $attributes['created'], $choices, CreateResponseUsage::from($attributes['usage']), $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'created' => $this->created, 'choices' => array_map( static fn (CreateResponseChoice $result): array => $result->toArray(), $this->choices, ), 'usage' => $this->usage->toArray(), ]; } } src/Responses/Edits/CreateResponseChoice.php000064400000001255152665621660015154 0ustar00 $this->text, 'index' => $this->index, ]; } } src/Responses/Edits/CreateResponseUsage.php000064400000001720152665621660015023 0ustar00 $this->promptTokens, 'completion_tokens' => $this->completionTokens, 'total_tokens' => $this->totalTokens, ]; } } src/Responses/Completions/CreateResponseChoiceLogprobs.php000064400000002636152665621660020114 0ustar00 $tokens * @param array $tokenLogprobs * @param array|null $topLogprobs * @param array $textOffset */ private function __construct( public readonly array $tokens, public readonly array $tokenLogprobs, public readonly ?array $topLogprobs, public readonly array $textOffset, ) {} /** * @param array{tokens: array, token_logprobs: array, top_logprobs: array|null, text_offset: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['tokens'], $attributes['token_logprobs'], $attributes['top_logprobs'], $attributes['text_offset'], ); } /** * @return array{tokens: array, token_logprobs: array, top_logprobs: array|null, text_offset: array} */ public function toArray(): array { return [ 'tokens' => $this->tokens, 'token_logprobs' => $this->tokenLogprobs, 'top_logprobs' => $this->topLogprobs, 'text_offset' => $this->textOffset, ]; } } src/Responses/Completions/CreateStreamedResponse.php000064400000005230152665621660016747 0ustar00, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string|null}>}> */ final class CreateStreamedResponse implements ResponseContract { /** * @use ArrayAccessible, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string|null}>}> */ use ArrayAccessible; use FakeableForStreamedResponse; /** * @param array $choices */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $created, public readonly string $model, public readonly array $choices, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created: int, model: string, choices: array, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string}>, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}} $attributes */ public static function from(array $attributes): self { $choices = array_map(fn (array $result): CreateResponseChoice => CreateResponseChoice::from( $result ), $attributes['choices']); return new self( $attributes['id'], $attributes['object'], $attributes['created'], $attributes['model'], $choices, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created' => $this->created, 'model' => $this->model, 'choices' => array_map( static fn (CreateResponseChoice $result): array => $result->toArray(), $this->choices, ), ]; } } src/Responses/Completions/CreateResponse.php000064400000006336152665621660015272 0ustar00, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string|null}>, usage: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string|null}>, usage: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $choices */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $created, public readonly string $model, public readonly array $choices, public readonly CreateResponseUsage $usage, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created: int, model: string, choices: array, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string}>, usage: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $choices = array_map(fn (array $result): CreateResponseChoice => CreateResponseChoice::from( $result ), $attributes['choices']); return new self( $attributes['id'], $attributes['object'], $attributes['created'], $attributes['model'], $choices, CreateResponseUsage::from($attributes['usage']), $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created' => $this->created, 'model' => $this->model, 'choices' => array_map( static fn (CreateResponseChoice $result): array => $result->toArray(), $this->choices, ), 'usage' => $this->usage->toArray(), ]; } } src/Responses/Completions/CreateResponseChoice.php000064400000003012152665621660016371 0ustar00, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string|null} $attributes */ public static function from(array $attributes): self { return new self( $attributes['text'], $attributes['index'], isset($attributes['logprobs']) ? CreateResponseChoiceLogprobs::from($attributes['logprobs']) : null, $attributes['finish_reason'], ); } /** * @return array{text: string, index: int, logprobs: array{tokens: array, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string|null} */ public function toArray(): array { return [ 'text' => $this->text, 'index' => $this->index, 'logprobs' => $this->logprobs instanceof CreateResponseChoiceLogprobs ? $this->logprobs->toArray() : null, 'finish_reason' => $this->finishReason, ]; } } src/Responses/Completions/CreateResponseUsage.php000064400000001751152665621660016253 0ustar00 $this->promptTokens, 'completion_tokens' => $this->completionTokens, 'total_tokens' => $this->totalTokens, ]; } } src/Responses/Containers/Objects/ExpiresAfter.php000064400000002176152665621660016151 0ustar00 */ final class ExpiresAfter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'last_active_at' $anchor */ private function __construct( public readonly string $anchor, public readonly int $minutes, ) {} /** * @param ExpiresAfterType $attributes */ public static function from(array $attributes): self { return new self( anchor: $attributes['anchor'], minutes: $attributes['minutes'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'anchor' => $this->anchor, 'minutes' => $this->minutes, ]; } } src/Responses/Containers/RetrieveContainer.php000064400000004560152665621660015606 0ustar00 */ final class RetrieveContainer implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param 'container' $object */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $createdAt, public readonly string $status, public readonly ExpiresAfter $expiresAfter, public readonly int $lastActiveAt, public readonly string $name, private readonly MetaInformation $meta, ) {} /** * @param RetrieveContainerType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( id: $attributes['id'], object: $attributes['object'], createdAt: $attributes['created_at'], status: $attributes['status'], expiresAfter: ExpiresAfter::from($attributes['expires_after']), lastActiveAt: $attributes['last_active_at'], name: $attributes['name'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'status' => $this->status, 'expires_after' => $this->expiresAfter->toArray(), 'last_active_at' => $this->lastActiveAt, 'name' => $this->name, ]; } } src/Responses/Containers/ListContainers.php000064400000004362152665621660015117 0ustar00 */ final class ListContainers implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param 'list' $object * @param RetrieveContainer[] $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * @param ListContainersType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( object: $attributes['object'], data: array_map( fn (array $container): RetrieveContainer => RetrieveContainer::from($container, $meta), $attributes['data'] ), firstId: $attributes['first_id'] ?? null, lastId: $attributes['last_id'] ?? null, hasMore: $attributes['has_more'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( fn (RetrieveContainer $container): array => $container->toArray(), $this->data ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Containers/CreateContainer.php000064400000004546152665621660015230 0ustar00 */ final class CreateContainer implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param 'container' $object */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $createdAt, public readonly string $status, public readonly ExpiresAfter $expiresAfter, public readonly int $lastActiveAt, public readonly string $name, private readonly MetaInformation $meta, ) {} /** * @param CreateContainerType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( id: $attributes['id'], object: $attributes['object'], createdAt: $attributes['created_at'], status: $attributes['status'], expiresAfter: ExpiresAfter::from($attributes['expires_after']), lastActiveAt: $attributes['last_active_at'], name: $attributes['name'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'status' => $this->status, 'expires_after' => $this->expiresAfter->toArray(), 'last_active_at' => $this->lastActiveAt, 'name' => $this->name, ]; } } src/Responses/Containers/DeleteContainer.php000064400000002761152665621660015224 0ustar00 */ final class DeleteContainer implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * @param DeleteContainerType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( id: $attributes['id'], object: $attributes['object'], deleted: $attributes['deleted'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Chat/CreateResponseChoiceLogprobs.php000064400000002326152665621660016473 0ustar00 $content */ private function __construct( public readonly ?array $content, ) {} /** * @param array{content: ?array}>} $attributes */ public static function from(array $attributes): self { $content = null; if (isset($attributes['content'])) { $content = array_map(fn (array $result): CreateResponseChoiceLogprobsContent => CreateResponseChoiceLogprobsContent::from( $result ), $attributes['content']); } return new self( $content, ); } /** * @return array{content: ?array}>} */ public function toArray(): array { return [ 'content' => $this->content ? array_map( static fn (CreateResponseChoiceLogprobsContent $result): array => $result->toArray(), $this->content, ) : null, ]; } } src/Responses/Chat/CreateResponseToolCall.php000064400000001725152665621660015304 0ustar00 $this->id, 'type' => $this->type, 'function' => $this->function->toArray(), ]; } } src/Responses/Chat/CreateResponseUsageCompletionTokensDetails.php000064400000003210152665621660021352 0ustar00reasoningTokens)) { $result['reasoning_tokens'] = $this->reasoningTokens; } if (! is_null($this->acceptedPredictionTokens)) { $result['accepted_prediction_tokens'] = $this->acceptedPredictionTokens; } if (! is_null($this->rejectedPredictionTokens)) { $result['rejected_prediction_tokens'] = $this->rejectedPredictionTokens; } if (! is_null($this->audioTokens)) { $result['audio_tokens'] = $this->audioTokens; } return $result; } } src/Responses/Chat/CreateResponseChoiceLogprobsContent.php000064400000002000152665621660020013 0ustar00 $bytes */ private function __construct( public readonly string $token, public readonly float $logprob, public readonly ?array $bytes, ) {} /** * @param array{ * token: string, * logprob: float, * bytes: ?array * } $attributes */ public static function from(array $attributes): self { return new self( $attributes['token'], $attributes['logprob'], $attributes['bytes'], ); } /** * @return array{ * token: string, * logprob: float, * bytes: ?array * } */ public function toArray(): array { return [ 'token' => $this->token, 'logprob' => $this->logprob, 'bytes' => $this->bytes, ]; } } src/Responses/Chat/CreateResponseChoiceAnnotationsUrlCitations.php000064400000001770152665621660021544 0ustar00 $this->endIndex, 'start_index' => $this->startIndex, 'title' => $this->title, 'url' => $this->url, ]; } } src/Responses/Chat/CreateStreamedResponse.php000064400000005672152665621660015344 0ustar00, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> */ final class CreateStreamedResponse implements ResponseContract { /** * @use ArrayAccessible, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> */ use ArrayAccessible; use FakeableForStreamedResponse; /** * @param array $choices */ private function __construct( public readonly ?string $id, public readonly string $object, public readonly int $created, public readonly string $model, public readonly array $choices, public readonly ?CreateResponseUsage $usage, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id?: string, object: string, created: int, model: string, choices: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}} $attributes */ public static function from(array $attributes): self { $choices = array_map(fn (array $result): CreateStreamedResponseChoice => CreateStreamedResponseChoice::from( $result ), $attributes['choices']); return new self( $attributes['id'] ?? null, $attributes['object'], $attributes['created'], $attributes['model'], $choices, isset($attributes['usage']) ? CreateResponseUsage::from($attributes['usage']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'id' => $this->id, 'object' => $this->object, 'created' => $this->created, 'model' => $this->model, 'choices' => array_map( static fn (CreateStreamedResponseChoice $result): array => $result->toArray(), $this->choices, ), 'usage' => $this->usage?->toArray(), ], fn (mixed $value): bool => ! is_null($value)); } } src/Responses/Chat/CreateResponseToolCallFunction.php000064400000001333152665621660017005 0ustar00 $this->name, 'arguments' => $this->arguments, ]; } } src/Responses/Chat/CreateResponseFunctionCall.php000064400000001356152665621660016154 0ustar00 $this->name, 'arguments' => $this->arguments, ]; } } src/Responses/Chat/CreateStreamedResponseFunctionCall.php000064400000001613152665621660017635 0ustar00name)) { $data['name'] = $this->name; } if (! is_null($this->arguments)) { $data['arguments'] = $this->arguments; } return $data; } } src/Responses/Chat/CreateResponse.php000064400000011206152665621660013645 0ustar00, function_call?: array{name: string, arguments: string}, tool_calls?: array}, logprobs: ?array{content: ?array}>}, finish_reason: string|null}>, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, function_call?: array{name: string, arguments: string}, tool_calls?: array}, logprobs: ?array{content: ?array}>}, finish_reason: string|null}>, usage: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $choices */ private function __construct( public readonly ?string $id, public readonly string $object, public readonly int $created, public readonly string $model, public readonly ?string $systemFingerprint, public readonly array $choices, public readonly ?CreateResponseUsage $usage, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id?: string, object: string, created: int, model: string, system_fingerprint?: string, choices: array, function_call: ?array{name: string, arguments: string}, tool_calls: ?array}, logprobs: ?array{content: ?array}>}, finish_reason: string|null}>, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int, prompt_tokens_details?:array{cached_tokens:int}, completion_tokens_details?:array{audio_tokens?:int, reasoning_tokens:int, accepted_prediction_tokens:int, rejected_prediction_tokens:int}}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $choices = array_map(fn (array $result): CreateResponseChoice => CreateResponseChoice::from( $result ), $attributes['choices']); return new self( $attributes['id'] ?? null, $attributes['object'], $attributes['created'], $attributes['model'], $attributes['system_fingerprint'] ?? null, $choices, isset($attributes['usage']) ? CreateResponseUsage::from($attributes['usage']) : null, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'id' => $this->id, 'object' => $this->object, 'created' => $this->created, 'model' => $this->model, 'system_fingerprint' => $this->systemFingerprint, 'choices' => array_map( static fn (CreateResponseChoice $result): array => $result->toArray(), $this->choices, ), 'usage' => $this->usage?->toArray(), ], fn (mixed $value): bool => ! is_null($value)); } } src/Responses/Chat/CreateStreamedResponseDelta.php000064400000003744152665621660016314 0ustar00 $toolCalls */ private function __construct( public readonly ?string $role, public readonly ?string $content, public readonly array $toolCalls, public readonly ?CreateStreamedResponseFunctionCall $functionCall, ) {} /** * @param array{role?: string, content?: string, function_call?: array{name?: ?string, arguments?: ?string}, tool_calls?: array} $attributes */ public static function from(array $attributes): self { $toolCalls = array_map(fn (array $result): CreateStreamedResponseToolCall => CreateStreamedResponseToolCall::from( $result ), $attributes['tool_calls'] ?? []); return new self( $attributes['role'] ?? null, $attributes['content'] ?? null, $toolCalls, isset($attributes['function_call']) ? CreateStreamedResponseFunctionCall::from($attributes['function_call']) : null, ); } /** * @return array{role?: string, content?: string}|array{role?: string, content: null, function_call: array{name?: string, arguments?: string}} */ public function toArray(): array { $data = array_filter([ 'role' => $this->role, 'content' => $this->content, ], fn (?string $value): bool => ! is_null($value)); if ($this->functionCall instanceof CreateStreamedResponseFunctionCall) { $data['content'] = null; $data['function_call'] = $this->functionCall->toArray(); } if ($this->toolCalls !== []) { $data['tool_calls'] = array_map(fn (CreateStreamedResponseToolCall $toolCall): array => $toolCall->toArray(), $this->toolCalls); } return $data; } } src/Responses/Chat/CreateResponseUsagePromptTokensDetails.php000064400000001576152665621660020537 0ustar00 $this->cachedTokens, ]; if (! is_null($this->audioTokens)) { $result['audio_tokens'] = $this->audioTokens; } return $result; } } src/Responses/Chat/CreateStreamedResponseChoice.php000064400000002175152665621660016452 0ustar00 $this->index, 'delta' => $this->delta->toArray(), 'finish_reason' => $this->finishReason, ]; } } src/Responses/Chat/CreateStreamedResponseToolCallFunction.php000064400000001463152665621660020476 0ustar00 $this->name, 'arguments' => $this->arguments, ], fn (?string $value): bool => ! is_null($value)); } } src/Responses/Chat/CreateResponseChoice.php000064400000004032152665621660014757 0ustar00, function_call: ?array{name: string, arguments: string}, tool_calls: ?array} ,logprobs?: ?array{content: ?array}>}, finish_reason: string|null} $attributes */ public static function from(array $attributes): self { return new self( $attributes['index'], CreateResponseMessage::from($attributes['message']), isset($attributes['logprobs']) ? CreateResponseChoiceLogprobs::from($attributes['logprobs']) : null, $attributes['finish_reason'] ?? null, ); } /** * @return array{index: int, message: array{role: string, content: string|null, annotations?: array, function_call?: array{name: string, arguments: string}, tool_calls?: array}, logprobs: ?array{content: ?array}>}, finish_reason: string|null} */ public function toArray(): array { return [ 'index' => $this->index, 'message' => $this->message->toArray(), 'logprobs' => $this->logprobs?->toArray(), 'finish_reason' => $this->finishReason, ]; } } src/Responses/Chat/CreateResponseUsage.php000064400000003765152665621660014645 0ustar00 $this->promptTokens, 'completion_tokens' => $this->completionTokens, 'total_tokens' => $this->totalTokens, ]; if ($this->promptTokensDetails) { $result['prompt_tokens_details'] = $this->promptTokensDetails->toArray(); } if ($this->completionTokensDetails) { $result['completion_tokens_details'] = $this->completionTokensDetails->toArray(); } return $result; } } src/Responses/Chat/CreateResponseChoiceAnnotations.php000064400000001661152665621660017202 0ustar00 $this->type, 'url_citation' => $this->urlCitations->toArray(), ]; } } src/Responses/Chat/CreateResponseChoiceAudio.php000064400000002622152665621660015744 0ustar00 */ final class CreateResponseChoiceAudio implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $id, public readonly string $data, public readonly int $expiresAt, public readonly string $transcript, ) {} /** * @param CreateResponseChoiceAudioType $attributes */ public static function from(array $attributes): self { return new self( id: $attributes['id'], data: $attributes['data'], expiresAt: $attributes['expires_at'], transcript: $attributes['transcript'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'data' => $this->data, 'expires_at' => $this->expiresAt, 'transcript' => $this->transcript, ]; } } src/Responses/Chat/CreateStreamedResponseToolCall.php000064400000002323152665621660016764 0ustar00 $this->index, 'id' => $this->id, 'type' => $this->type, 'function' => $this->function->toArray(), ], fn (mixed $value): bool => ! is_null($value)); } } src/Responses/Chat/CreateResponseMessage.php000064400000006164152665621660015161 0ustar00 $toolCalls * @param array $annotations */ private function __construct( public readonly string $role, public readonly ?string $content, public readonly array $annotations, public readonly array $toolCalls, public readonly ?CreateResponseFunctionCall $functionCall, public readonly ?CreateResponseChoiceAudio $audio = null, ) {} /** * @param array{role: string, content: ?string, annotations?: array, function_call: ?array{name: string, arguments: string}, tool_calls: ?array, audio?: CreateResponseChoiceAudioType} $attributes */ public static function from(array $attributes): self { $toolCalls = array_map(fn (array $result): CreateResponseToolCall => CreateResponseToolCall::from( $result ), $attributes['tool_calls'] ?? []); $annotations = array_map(fn (array $result): CreateResponseChoiceAnnotations => CreateResponseChoiceAnnotations::from( $result, ), $attributes['annotations'] ?? []); return new self( $attributes['role'], $attributes['content'] ?? null, $annotations, $toolCalls, isset($attributes['function_call']) ? CreateResponseFunctionCall::from($attributes['function_call']) : null, isset($attributes['audio']) ? CreateResponseChoiceAudio::from($attributes['audio']) : null, ); } /** * @return array{role: string, content: string|null, annotations?: array, function_call?: array{name: string, arguments: string}, tool_calls?: array, audio?: CreateResponseChoiceAudioType} */ public function toArray(): array { $data = [ 'role' => $this->role, 'content' => $this->content, ]; if ($this->annotations !== []) { $data['annotations'] = array_map(fn (CreateResponseChoiceAnnotations $annotations): array => $annotations->toArray(), $this->annotations); } if ($this->functionCall instanceof CreateResponseFunctionCall) { $data['function_call'] = $this->functionCall->toArray(); } if ($this->toolCalls !== []) { $data['tool_calls'] = array_map(fn (CreateResponseToolCall $toolCall): array => $toolCall->toArray(), $this->toolCalls); } if ($this->audio instanceof CreateResponseChoiceAudio) { $data['audio'] = $this->audio->toArray(); } return $data; } } src/Responses/StreamResponse.php000064400000005260152665621660013021 0ustar00 */ final class StreamResponse implements ResponseHasMetaInformationContract, ResponseStreamContract { /** * Creates a new Stream Response instance. * * @param class-string $responseClass */ public function __construct( private readonly string $responseClass, private readonly ResponseInterface $response, ) { // } /** * {@inheritDoc} */ public function getIterator(): Generator { while (! $this->response->getBody()->eof()) { $line = $this->readLine($this->response->getBody()); $event = null; if (str_starts_with($line, 'event:')) { $event = trim(substr($line, strlen('event:'))); $line = $this->readLine($this->response->getBody()); } if (! str_starts_with($line, 'data:')) { continue; } $data = trim(substr($line, strlen('data:'))); if ($data === '[DONE]') { break; } /** @var array{error?: array{message: string|array, type: string, code: string}, type?: string} $response */ $response = json_decode($data, true, flags: JSON_THROW_ON_ERROR); if (isset($response['error'])) { throw new ErrorException($response['error'], $this->response->getStatusCode()); } if (isset($response['type']) && $response['type'] === 'ping') { continue; } if ($event !== null) { $response['__event'] = $event; } $response['__meta'] = $this->meta(); yield $this->responseClass::from($response); } } /** * Read a line from the stream. */ private function readLine(StreamInterface $stream): string { $buffer = ''; while (! $stream->eof()) { if ('' === ($byte = $stream->read(1))) { return $buffer; } $buffer .= $byte; if ($byte === "\n") { break; } } return $buffer; } public function meta(): MetaInformation { // @phpstan-ignore-next-line return MetaInformation::from($this->response->getHeaders()); } } src/Responses/Meta/MetaInformation.php000064400000010567152665621660014037 0ustar00 */ final class MetaInformation implements MetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public ?string $requestId, public readonly MetaInformationOpenAI $openai, public readonly ?MetaInformationRateLimit $requestLimit, public readonly ?MetaInformationRateLimit $tokenLimit, ) {} /** * @param array{x-request-id: string[], openai-model: string[], openai-organization: string[], openai-version: string[], openai-processing-ms: string[], x-ratelimit-limit-requests: string[], x-ratelimit-remaining-requests: string[], x-ratelimit-reset-requests: string[], x-ratelimit-limit-tokens: string[], x-ratelimit-remaining-tokens: string[], x-ratelimit-reset-tokens: string[]} $headers */ public static function from(array $headers): self { $headers = array_change_key_case($headers, CASE_LOWER); $requestId = $headers['x-request-id'][0] ?? null; $openai = MetaInformationOpenAI::from([ 'model' => $headers['openai-model'][0] ?? null, 'organization' => $headers['openai-organization'][0] ?? null, 'version' => $headers['openai-version'][0] ?? null, 'processingMs' => isset($headers['openai-processing-ms'][0]) ? (int) $headers['openai-processing-ms'][0] : null, ]); if (isset($headers['x-ratelimit-remaining-requests'][0])) { $requestLimit = MetaInformationRateLimit::from([ 'limit' => isset($headers['x-ratelimit-limit-requests'][0]) ? (int) $headers['x-ratelimit-limit-requests'][0] : null, 'remaining' => (int) $headers['x-ratelimit-remaining-requests'][0], 'reset' => $headers['x-ratelimit-reset-requests'][0] ?? null, ]); } else { $requestLimit = null; } if (isset($headers['x-ratelimit-remaining-tokens'][0])) { $tokenLimit = MetaInformationRateLimit::from([ 'limit' => isset($headers['x-ratelimit-limit-tokens'][0]) ? (int) $headers['x-ratelimit-limit-tokens'][0] : null, 'remaining' => (int) $headers['x-ratelimit-remaining-tokens'][0], 'reset' => $headers['x-ratelimit-reset-tokens'][0] ?? null, ]); } else { $tokenLimit = null; } return new self( $requestId, $openai, $requestLimit, $tokenLimit, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'openai-model' => $this->openai->model, 'openai-organization' => $this->openai->organization, 'openai-processing-ms' => $this->openai->processingMs, 'openai-version' => $this->openai->version, 'x-ratelimit-limit-requests' => $this->requestLimit->limit ?? null, 'x-ratelimit-limit-tokens' => $this->tokenLimit->limit ?? null, 'x-ratelimit-remaining-requests' => $this->requestLimit->remaining ?? null, 'x-ratelimit-remaining-tokens' => $this->tokenLimit->remaining ?? null, 'x-ratelimit-reset-requests' => $this->requestLimit->reset ?? null, 'x-ratelimit-reset-tokens' => $this->tokenLimit->reset ?? null, 'x-request-id' => $this->requestId, ], fn (string|int|null $value): bool => ! is_null($value)); } } src/Responses/Meta/MetaInformationOpenAI.php000064400000001250152665621660015060 0ustar00, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> */ final class VariationResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly int $created, public readonly array $data, private readonly MetaInformation $meta, public readonly ?ImageResponseUsage $usage = null, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{created: int, data: array, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $results = array_map(fn (array $result): VariationResponseData => VariationResponseData::from( $result ), $attributes['data']); return new self( $attributes['created'], $results, $meta, isset($attributes['usage']) ? ImageResponseUsage::from($attributes['usage']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { $result = [ 'created' => $this->created, 'data' => array_map( static fn (VariationResponseData $result): array => $result->toArray(), $this->data, ), ]; if ($this->usage !== null) { $result['usage'] = $this->usage->toArray(); } return $result; } } src/Responses/Images/EditResponse.php000064400000005011152665621660013652 0ustar00, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> */ final class EditResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly int $created, public readonly array $data, private readonly MetaInformation $meta, public readonly ?ImageResponseUsage $usage = null, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{created: int, data: array, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $results = array_map(fn (array $result): EditResponseData => EditResponseData::from( $result ), $attributes['data']); return new self( $attributes['created'], $results, $meta, isset($attributes['usage']) ? ImageResponseUsage::from($attributes['usage']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { $result = [ 'created' => $this->created, 'data' => array_map( static fn (EditResponseData $result): array => $result->toArray(), $this->data, ), ]; if ($this->usage !== null) { $result['usage'] = $this->usage->toArray(); } return $result; } } src/Responses/Images/ImageResponseUsageInputTokensDetails.php000064400000001405152665621660020511 0ustar00 $this->textTokens, 'image_tokens' => $this->imageTokens, ]; } } src/Responses/Images/CreateResponseData.php000064400000002701152665621660014765 0ustar00 */ final class CreateResponseData implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $url, public readonly string $b64_json, public readonly ?string $revisedPrompt, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{url?: string, b64_json?: string, revised_prompt?: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['url'] ?? '', $attributes['b64_json'] ?? '', $attributes['revised_prompt'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { $data = $this->url !== '' && $this->url !== '0' ? ['url' => $this->url] : ['b64_json' => $this->b64_json]; if ($this->revisedPrompt !== null) { $data['revised_prompt'] = $this->revisedPrompt; } return $data; } } src/Responses/Images/ImageResponseUsage.php000064400000002477152665621660015011 0ustar00 $this->totalTokens, 'input_tokens' => $this->inputTokens, 'output_tokens' => $this->outputTokens, 'input_tokens_details' => $this->inputTokensDetails->toArray(), ]; } } src/Responses/Images/CreateResponse.php000064400000005136152665621660014200 0ustar00, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly int $created, public readonly array $data, private readonly MetaInformation $meta, public readonly ?ImageResponseUsage $usage = null, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{created: int, data: array, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $results = array_map(fn (array $result): CreateResponseData => CreateResponseData::from( $result ), $attributes['data']); return new self( $attributes['created'], $results, $meta, isset($attributes['usage']) ? ImageResponseUsage::from($attributes['usage']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { $result = [ 'created' => $this->created, 'data' => array_map( static fn (CreateResponseData $result): array => $result->toArray(), $this->data, ), ]; if ($this->usage !== null) { $result['usage'] = $this->usage->toArray(); } return $result; } } src/Responses/Images/VariationResponseData.php000064400000002130152665621660015512 0ustar00 */ final class VariationResponseData implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $url, public readonly string $b64_json, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{url?: string, b64_json?: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['url'] ?? '', $attributes['b64_json'] ?? '', ); } /** * {@inheritDoc} */ public function toArray(): array { return $this->url !== '' && $this->url !== '0' ? ['url' => $this->url] : ['b64_json' => $this->b64_json]; } } src/Responses/Images/EditResponseData.php000064400000002123152665621660014445 0ustar00 */ final class EditResponseData implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $url, public readonly string $b64_json, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{url?: string, b64_json?: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['url'] ?? '', $attributes['b64_json'] ?? '', ); } /** * {@inheritDoc} */ public function toArray(): array { return $this->url !== '' && $this->url !== '0' ? ['url' => $this->url] : ['b64_json' => $this->b64_json]; } } src/Responses/Realtime/TranscriptionSession/InputAudioTranscription.php000064400000002643152665621660022657 0ustar00 */ final class InputAudioTranscription implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'gpt-4o-transcribe'|'gpt-4o-mini-transcribe'|"whisper-1" $model */ private function __construct( public readonly string $language, public readonly string $model, public readonly string $prompt, ) {} /** * @param InputAudioTranscriptionType $attributes */ public static function from(array $attributes): self { return new self( language: $attributes['language'], model: $attributes['model'], prompt: $attributes['prompt'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'language' => $this->language, 'model' => $this->model, 'prompt' => $this->prompt, ]; } } src/Responses/Realtime/Session/ClientSecret.php000064400000002106152665621660015614 0ustar00 */ final class ClientSecret implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly int $expiresAt, public readonly string $value, ) {} /** * @param ClientSecretType $attributes */ public static function from(array $attributes): self { return new self( expiresAt: $attributes['expires_at'], value: $attributes['value'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'expires_at' => $this->expiresAt, 'value' => $this->value, ]; } } src/Responses/Realtime/Session/InputAudioTranscription.php000064400000002026152665621660020072 0ustar00 */ final class InputAudioTranscription implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param "whisper-1" $model */ private function __construct( public readonly string $model ) {} /** * @param InputAudioTranscriptionType $attributes */ public static function from(array $attributes): self { return new self( model: $attributes['model'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'model' => $this->model, ]; } } src/Responses/Realtime/Session/TurnDetection.php000064400000003041152665621660016016 0ustar00 */ final class TurnDetection implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'server_vad' $type */ private function __construct( public readonly int $prefixPaddingMs, public readonly int $silenceDurationMs, public readonly float $threshold, public readonly string $type, ) {} /** * @param TurnDetectionType $attributes */ public static function from(array $attributes): self { return new self( prefixPaddingMs: $attributes['prefix_padding_ms'], silenceDurationMs: $attributes['silence_duration_ms'], threshold: $attributes['threshold'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'prefix_padding_ms' => $this->prefixPaddingMs, 'silence_duration_ms' => $this->silenceDurationMs, 'threshold' => $this->threshold, 'type' => $this->type, ]; } } src/Responses/Realtime/TranscriptionSessionResponse.php000064400000005507152665621660017537 0ustar00|null, turn_detection: TurnDetectionType|null} * * @implements ResponseContract */ final class TranscriptionSessionResponse implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'pcm16'|'g711_ulaw'|'g711_alaw' $inputAudioFormat * @param array|null $modalities */ private function __construct( public readonly ClientSecret $clientSecret, public readonly string $inputAudioFormat, public readonly ?InputAudioTranscription $inputAudioTranscription, public readonly ?array $modalities, public readonly ?TurnDetection $turnDetection, ) {} /** * @param TranscriptionSessionType $attributes */ public static function from(array $attributes): self { return new self( clientSecret: ClientSecret::from($attributes['client_secret']), inputAudioFormat: $attributes['input_audio_format'], inputAudioTranscription: isset($attributes['input_audio_transcription']) ? InputAudioTranscription::from($attributes['input_audio_transcription']) : null, modalities: $attributes['modalities'] ?? null, turnDetection: isset($attributes['turn_detection']) ? TurnDetection::from($attributes['turn_detection']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'client_secret' => $this->clientSecret->toArray(), 'input_audio_format' => $this->inputAudioFormat, 'input_audio_transcription' => $this->inputAudioTranscription?->toArray(), 'modalities' => $this->modalities, 'turn_detection' => $this->turnDetection?->toArray(), ]; } } src/Responses/Realtime/Tools/FunctionTool.php000064400000002752152665621660015337 0ustar00, type: 'function'} * * @implements ResponseContract */ final class FunctionTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $parameters * @param 'function' $type */ private function __construct( public readonly string $description, public readonly string $name, public readonly array $parameters, public readonly string $type, ) {} /** * @param FunctionToolType $attributes */ public static function from(array $attributes): self { return new self( description: $attributes['description'], name: $attributes['name'], parameters: $attributes['parameters'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'description' => $this->description, 'name' => $this->name, 'parameters' => $this->parameters, 'type' => $this->type, ]; } } src/Responses/Realtime/SessionResponse.php000064400000011341152665621660014750 0ustar00, output_audio_format: 'pcm16'|'g711_ulaw'|'g711_alaw', temperature: float, tool_choice: 'auto'|'none'|'required', tools: array, turn_detection: TurnDetectionType|null, voice: 'alloy'|'ash'|'ballad'|'coral'|'echo'|'sage'|'shimmer'|'verse'} * * @implements ResponseContract */ final class SessionResponse implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'pcm16'|'g711_ulaw'|'g711_alaw' $inputAudioFormat * @param int|'inf' $maxResponseOutputTokens * @param array $modalities * @param 'pcm16'|'g711_ulaw'|'g711_alaw' $outputAudioFormat * @param 'auto'|'none'|'required' $toolChoice * @param array $tools * @param 'alloy'|'ash'|'ballad'|'coral'|'echo'|'sage'|'shimmer'|'verse' $voice */ private function __construct( public readonly ClientSecret $clientSecret, public readonly string $inputAudioFormat, public readonly ?InputAudioTranscription $inputAudioTranscription, public readonly string $instructions, public readonly int|string $maxResponseOutputTokens, public readonly array $modalities, public readonly string $outputAudioFormat, public readonly float $temperature, public readonly string $toolChoice, public readonly array $tools, public readonly ?TurnDetection $turnDetection, public readonly string $voice, ) {} /** * @param SessionType $attributes */ public static function from(array $attributes): self { $tools = array_map( fn (array $tool): FunctionTool => match ($tool['type']) { 'function' => FunctionTool::from($tool), }, $attributes['tools'] ); return new self( clientSecret: ClientSecret::from($attributes['client_secret']), inputAudioFormat: $attributes['input_audio_format'], inputAudioTranscription: isset($attributes['input_audio_transcription']) ? InputAudioTranscription::from($attributes['input_audio_transcription']) : null, instructions: $attributes['instructions'], maxResponseOutputTokens: $attributes['max_response_output_tokens'], modalities: $attributes['modalities'], outputAudioFormat: $attributes['output_audio_format'], temperature: $attributes['temperature'], toolChoice: $attributes['tool_choice'], tools: $tools, turnDetection: isset($attributes['turn_detection']) ? TurnDetection::from($attributes['turn_detection']) : null, voice: $attributes['voice'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'client_secret' => $this->clientSecret->toArray(), 'input_audio_format' => $this->inputAudioFormat, 'input_audio_transcription' => $this->inputAudioTranscription?->toArray(), 'instructions' => $this->instructions, 'max_response_output_tokens' => $this->maxResponseOutputTokens, 'modalities' => $this->modalities, 'output_audio_format' => $this->outputAudioFormat, 'temperature' => $this->temperature, 'tool_choice' => $this->toolChoice, 'tools' => array_map( static fn (FunctionTool $tool): array => $tool->toArray(), $this->tools, ), 'turn_detection' => $this->turnDetection?->toArray(), 'voice' => $this->voice, ]; } } src/Responses/VectorStores/Search/VectorStoreSearchResponseContent.php000064400000002142152665621660022371 0ustar00 */ final class VectorStoreSearchResponseContent implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $type, public readonly string $text, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: string, text: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], $attributes['text'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'text' => $this->text, ]; } } src/Responses/VectorStores/Search/VectorStoreSearchResponse.php000064400000006213152665621660021041 0ustar00, data: array, content: array}>, has_more: bool, next_page: ?string}> */ final class VectorStoreSearchResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, data: array, content: array}>, has_more: bool, next_page: ?string}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data * @param string|array $searchQuery */ private function __construct( public readonly string $object, public readonly string|array $searchQuery, public readonly array $data, public readonly bool $hasMore, public readonly ?string $nextPage, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, search_query: string|array, data: array, content: array}>, has_more: bool, next_page: ?string} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map( static fn (array $result): VectorStoreSearchResponseFile => VectorStoreSearchResponseFile::from($result), $attributes['data'] ); return new self( $attributes['object'], $attributes['search_query'], $data, $attributes['has_more'], $attributes['next_page'], $meta, ); } /** * {@inheritDoc} * * @return array{object: string, search_query: string|array, data: array, content: array}>, has_more: bool, next_page: ?string} */ public function toArray(): array { return [ 'object' => $this->object, 'search_query' => $this->searchQuery, 'data' => array_map( static fn (VectorStoreSearchResponseFile $item): array => $item->toArray(), $this->data ), 'has_more' => $this->hasMore, 'next_page' => $this->nextPage, ]; } } src/Responses/VectorStores/Search/VectorStoreSearchResponseFile.php000064400000004412152665621660021640 0ustar00, content: array}> */ final class VectorStoreSearchResponseFile implements ResponseContract { /** * @use ArrayAccessible, content: array}> */ use ArrayAccessible; use Fakeable; /** * @param array $attributes * @param array $content */ private function __construct( public readonly string $fileId, public readonly string $filename, public readonly float $score, public readonly array $attributes, public readonly array $content, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{file_id: string, filename: string, score: float, attributes: array, content: array} $attributes */ public static function from(array $attributes): self { $content = array_map( static fn (array $content): VectorStoreSearchResponseContent => VectorStoreSearchResponseContent::from($content), $attributes['content'], ); return new self( $attributes['file_id'], $attributes['filename'], $attributes['score'], $attributes['attributes'], $content, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, 'filename' => $this->filename, 'score' => $this->score, 'attributes' => $this->attributes, 'content' => array_map( static fn (VectorStoreSearchResponseContent $content): array => $content->toArray(), $this->content, ), ]; } } src/Responses/VectorStores/VectorStoreDeleteResponse.php000064400000003053152665621660017630 0ustar00 */ final class VectorStoreDeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/VectorStores/VectorStoreResponse.php000064400000007722152665621660016514 0ustar00}> */ final class VectorStoreResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $metadata */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $createdAt, public readonly ?string $name, public readonly int $usageBytes, public readonly VectorStoreResponseFileCounts $fileCounts, public readonly string $status, public readonly ?VectorStoreResponseExpiresAfter $expiresAfter, public readonly ?int $expiresAt, public readonly ?int $lastActiveAt, public readonly array $metadata, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, name: ?string, usage_bytes: int, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}, status: string, expires_after: ?array{anchor: string, days: int}, expires_at: ?int, last_active_at: ?int, metadata: array} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], $attributes['name'], $attributes['usage_bytes'], VectorStoreResponseFileCounts::from($attributes['file_counts']), $attributes['status'], isset($attributes['expires_after']) ? VectorStoreResponseExpiresAfter::from($attributes['expires_after']) : null, $attributes['expires_at'], $attributes['last_active_at'], $attributes['metadata'], $meta, ); } /** * {@inheritDoc} * * @return array{id: string, object: string, name: string|null, status: string, usage_bytes: int, created_at: int, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}, metadata: mixed[], expires_after: array{anchor: string, days: int}|null, expires_at: int|null, last_active_at: int|null} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'name' => $this->name, 'status' => $this->status, 'usage_bytes' => $this->usageBytes, 'created_at' => $this->createdAt, 'file_counts' => $this->fileCounts->toArray(), 'metadata' => $this->metadata, 'expires_after' => $this->expiresAfter?->toArray(), 'expires_at' => $this->expiresAt, 'last_active_at' => $this->lastActiveAt, ]; } } src/Responses/VectorStores/VectorStoreResponseFileCounts.php000064400000003161152665621660020501 0ustar00 */ final class VectorStoreResponseFileCounts implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly int $inProgress, public readonly int $completed, public readonly int $failed, public readonly int $cancelled, public readonly int $total, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{in_progress: int, completed: int, failed: int, cancelled: int, total: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['in_progress'], $attributes['completed'], $attributes['cancelled'], $attributes['failed'], $attributes['total'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'in_progress' => $this->inProgress, 'completed' => $this->completed, 'failed' => $this->failed, 'cancelled' => $this->cancelled, 'total' => $this->total, ]; } } src/Responses/VectorStores/VectorStoreListResponse.php000064400000006510152665621660017342 0ustar00}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class VectorStoreListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): VectorStoreResponse => VectorStoreResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} * * @return array{object: string, data: array, first_id: string|null, last_id: string|null, has_more: bool} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (VectorStoreResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/VectorStores/VectorStoreResponseExpiresAfter.php000064400000002136152665621660021030 0ustar00 */ final class VectorStoreResponseExpiresAfter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $anchor, public readonly int $days, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{anchor: string, days: int} $attributes */ public static function from(array $attributes): self { return new self( $attributes['anchor'], $attributes['days'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'anchor' => $this->anchor, 'days' => $this->days, ]; } } src/Responses/VectorStores/Files/VectorStoreFileListResponse.php000064400000006471152665621660021212 0ustar00, last_error: ?array{code: string, message: string}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ final class VectorStoreFileListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, last_error: ?array{code: string, message: string}}>, first_id: ?string, last_id: ?string, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly ?string $firstId, public readonly ?string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}>, first_id: ?string, last_id: ?string, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): VectorStoreFileResponse => VectorStoreFileResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['first_id'], $attributes['last_id'], $attributes['has_more'], $meta, ); } /** * {@inheritDoc} * * @return array{object: string, data: array, last_error: array{code: string, message: string}|null}>, first_id: string|null, last_id: string|null, has_more: bool} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (VectorStoreFileResponse $response): array => $response->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/VectorStores/Files/VectorStoreFileResponseChunkingStrategyStatic.php000064400000003161152665621660024731 0ustar00 */ final class VectorStoreFileResponseChunkingStrategyStatic implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'static' $type */ private function __construct( public readonly string $type, public readonly int $maxChunkSizeTokens, public readonly int $chunkOverlapTokens, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], $attributes['static']['max_chunk_size_tokens'], $attributes['static']['chunk_overlap_tokens'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'static' => [ 'max_chunk_size_tokens' => $this->maxChunkSizeTokens, 'chunk_overlap_tokens' => $this->chunkOverlapTokens, ], ]; } } src/Responses/VectorStores/Files/VectorStoreFileResponse.php000064400000007410152665621660020350 0ustar00, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}> */ final class VectorStoreFileResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $attributes */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $usageBytes, public readonly int $createdAt, public readonly string $vectorStoreId, public readonly string $status, public readonly array $attributes, public readonly ?VectorStoreFileResponseLastError $lastError, public readonly VectorStoreFileResponseChunkingStrategyStatic|VectorStoreFileResponseChunkingStrategyOther $chunkingStrategy, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, usage_bytes: int, created_at: int, vector_store_id: string, status: string, attributes: ?array, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['usage_bytes'], $attributes['created_at'], $attributes['vector_store_id'], $attributes['status'], $attributes['attributes'] ?? [], isset($attributes['last_error']) ? VectorStoreFileResponseLastError::from($attributes['last_error']) : null, $attributes['chunking_strategy']['type'] === 'static' ? VectorStoreFileResponseChunkingStrategyStatic::from($attributes['chunking_strategy']) : VectorStoreFileResponseChunkingStrategyOther::from($attributes['chunking_strategy']), $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'usage_bytes' => $this->usageBytes, 'created_at' => $this->createdAt, 'vector_store_id' => $this->vectorStoreId, 'status' => $this->status, 'attributes' => $this->attributes, 'last_error' => $this->lastError instanceof VectorStoreFileResponseLastError ? $this->lastError->toArray() : null, 'chunking_strategy' => $this->chunkingStrategy->toArray(), ]; } } src/Responses/VectorStores/Files/VectorStoreFileResponseChunkingStrategyOther.php000064400000002012152665621660024555 0ustar00 */ final class VectorStoreFileResponseChunkingStrategyOther implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'other' $type */ private function __construct( public readonly string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'other'} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/VectorStores/Files/VectorStoreFileResponseLastError.php000064400000002171152665621660022205 0ustar00 */ final class VectorStoreFileResponseLastError implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $code, public readonly string $message, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{code: string, message: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['code'], $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'message' => $this->message, ]; } } src/Responses/VectorStores/Files/VectorStoreFileDeleteResponse.php000064400000003065152665621660021475 0ustar00 */ final class VectorStoreFileDeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/VectorStores/FileBatches/VectorStoreFileBatchResponse.php000064400000005023152665621660022417 0ustar00 */ final class VectorStoreFileBatchResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly int $createdAt, public readonly string $vectorStoreId, public readonly string $status, public readonly VectorStoreResponseFileCounts $fileCounts, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, vector_store_id: string, status: string, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['created_at'], $attributes['vector_store_id'], $attributes['status'], VectorStoreResponseFileCounts::from($attributes['file_counts']), $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'vector_store_id' => $this->vectorStoreId, 'status' => $this->status, 'file_counts' => $this->fileCounts->toArray(), ]; } } src/Responses/FineTuning/ListJobEventsResponse.php000064400000004711152665621660016367 0ustar00, has_more: bool}> */ final class ListJobEventsResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): ListJobEventsResponseEvent => ListJobEventsResponseEvent::from( $result ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (ListJobEventsResponseEvent $response): array => $response->toArray(), $this->data, ), 'has_more' => $this->hasMore, ]; } } src/Responses/FineTuning/RetrieveJobResponse.php000064400000011222152665621660016047 0ustar00, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}> */ final class RetrieveJobResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $resultFiles */ private function __construct( public readonly string $id, public readonly string $object, public readonly string $model, public readonly int $createdAt, public readonly ?int $finishedAt, public readonly ?string $fineTunedModel, public readonly RetrieveJobResponseHyperparameters $hyperparameters, public readonly string $organizationId, public readonly array $resultFiles, public readonly string $status, public readonly ?string $validationFile, public readonly string $trainingFile, public readonly ?int $trainedTokens, public readonly ?RetrieveJobResponseError $error, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, model: string, created_at: int, finished_at: ?int, fine_tuned_model: ?string, hyperparameters: array{n_epochs: int|string, batch_size: int|string|null, learning_rate_multiplier: float|string|null}, organization_id: string, result_files: array, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code?: string, param?: ?string, message?: string}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['model'], $attributes['created_at'], $attributes['finished_at'], $attributes['fine_tuned_model'], RetrieveJobResponseHyperparameters::from($attributes['hyperparameters']), $attributes['organization_id'], $attributes['result_files'], $attributes['status'], $attributes['validation_file'], $attributes['training_file'], $attributes['trained_tokens'], ( isset($attributes['error']) && isset($attributes['error']['code']) && isset($attributes['error']['param']) && isset($attributes['error']['message']) ) ? RetrieveJobResponseError::from($attributes['error']) : null, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'model' => $this->model, 'created_at' => $this->createdAt, 'finished_at' => $this->finishedAt, 'fine_tuned_model' => $this->fineTunedModel, 'hyperparameters' => $this->hyperparameters->toArray(), 'organization_id' => $this->organizationId, 'result_files' => $this->resultFiles, 'status' => $this->status, 'validation_file' => $this->validationFile, 'training_file' => $this->trainingFile, 'trained_tokens' => $this->trainedTokens, 'error' => $this->error?->toArray(), ]; } } src/Responses/FineTuning/ListJobEventsResponseEvent.php000064400000004343152665621660017372 0ustar00 */ final class ListJobEventsResponseEvent implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $object, public readonly string $id, public readonly int $createdAt, public readonly FineTuningEventLevel $level, public readonly string $message, public readonly ?ListJobEventsResponseEventData $data, public readonly string $type, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, id: string, created_at: int, level: string, message: string, data: array{step: int, train_loss: float, train_mean_token_accuracy: float}|null, type: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['object'], $attributes['id'], $attributes['created_at'], FineTuningEventLevel::from($attributes['level']), $attributes['message'], $attributes['data'] ? ListJobEventsResponseEventData::from($attributes['data']) : null, $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'id' => $this->id, 'created_at' => $this->createdAt, 'level' => $this->level->value, 'message' => $this->message, 'data' => $this->data?->toArray(), 'type' => $this->type, ]; } } src/Responses/FineTuning/ListJobsResponse.php000064400000006313152665621660015365 0ustar00, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}>, has_more: bool}> */ final class ListJobsResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}>, has_more: bool}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}>, has_more: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): RetrieveJobResponse => RetrieveJobResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $attributes['has_more'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (RetrieveJobResponse $response): array => $response->toArray(), $this->data, ), 'has_more' => $this->hasMore, ]; } } src/Responses/FineTuning/RetrieveJobResponseHyperparameters.php000064400000002764152665621660021156 0ustar00 */ final class RetrieveJobResponseHyperparameters implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly int|string $nEpochs, public readonly int|string|null $batchSize, public readonly float|string|null $learningRateMultiplier, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{n_epochs: int|string, batch_size: int|string|null, learning_rate_multiplier: float|string|null} $attributes */ public static function from(array $attributes): self { return new self( $attributes['n_epochs'], $attributes['batch_size'], $attributes['learning_rate_multiplier'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'n_epochs' => $this->nEpochs, 'batch_size' => $this->batchSize, 'learning_rate_multiplier' => $this->learningRateMultiplier, ]; } } src/Responses/FineTuning/RetrieveJobResponseError.php000064400000002310152665621660017057 0ustar00 */ final class RetrieveJobResponseError implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $code, public readonly ?string $param, public readonly string $message, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{code: string, param: ?string, message: string} $attributes */ public static function from(array $attributes): ?self { return new self( $attributes['code'], $attributes['param'], $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'param' => $this->param, 'message' => $this->message, ]; } } src/Responses/FineTuning/ListJobEventsResponseEventData.php000064400000002555152665621660020167 0ustar00 */ final class ListJobEventsResponseEventData implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly int $step, public readonly float $trainLoss, public readonly float $trainMeanTokenAccuracy, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{step: int, train_loss: float, train_mean_token_accuracy: float} $attributes */ public static function from(array $attributes): self { return new self( $attributes['step'], $attributes['train_loss'], $attributes['train_mean_token_accuracy'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'step' => $this->step, 'train_loss' => $this->trainLoss, 'train_mean_token_accuracy' => $this->trainMeanTokenAccuracy, ]; } } src/Responses/Embeddings/CreateResponseEmbedding.php000064400000002004152665621660016622 0ustar00 $embedding */ private function __construct( public readonly string $object, public readonly ?int $index, public readonly array $embedding, ) {} /** * @param array{object: string, index?: int, embedding: array} $attributes */ public static function from(array $attributes): self { return new self( $attributes['object'], $attributes['index'] ?? null, $attributes['embedding'], ); } /** * @return array{object: string, index?: int, embedding: array} */ public function toArray(): array { return array_filter([ 'object' => $this->object, 'index' => $this->index, 'embedding' => $this->embedding, ], fn (mixed $value): bool => ! is_null($value)); } } src/Responses/Embeddings/CreateResponse.php000064400000005071152665621660015032 0ustar00, index?: int}>, usage?: array{prompt_tokens: int, total_tokens: int}}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, index?: int}>, usage?: array{prompt_tokens: int, total_tokens: int}}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $embeddings */ private function __construct( public readonly string $object, public readonly ?string $model, public readonly array $embeddings, public readonly ?CreateResponseUsage $usage, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, model?: string|null, data: array, index?: int}>, usage?: array{prompt_tokens: int, total_tokens: int}} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $embeddings = array_map(fn (array $result): CreateResponseEmbedding => CreateResponseEmbedding::from( $result ), $attributes['data']); return new self( $attributes['object'], $attributes['model'] ?? null, $embeddings, isset($attributes['usage']) ? CreateResponseUsage::from($attributes['usage']) : null, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return array_filter([ 'object' => $this->object, 'model' => $this->model ?? null, 'data' => array_map( static fn (CreateResponseEmbedding $result): array => $result->toArray(), $this->embeddings, ), 'usage' => $this->usage?->toArray(), ], fn (mixed $value): bool => ! is_null($value)); } } src/Responses/Embeddings/CreateResponseUsage.php000064400000001404152665621660016013 0ustar00 $this->promptTokens, 'total_tokens' => $this->totalTokens, ]; } } src/Responses/Responses/ToolChoice/FunctionToolChoice.php000064400000002167152665621660017621 0ustar00 */ final class FunctionToolChoice implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'function' $type */ private function __construct( public readonly string $name, public readonly string $type, ) {} /** * @param FunctionToolChoiceType $attributes */ public static function from(array $attributes): self { return new self( name: $attributes['name'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'type' => $this->type, ]; } } src/Responses/Responses/ToolChoice/HostedToolChoice.php000064400000002115152665621660017253 0ustar00 */ final class HostedToolChoice implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'file_search'|'web_search_preview'|'computer_use_preview' $type */ private function __construct( public readonly string $type, ) {} /** * @param HostedToolChoiceType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Responses/Input/ComputerToolCallOutputScreenshot.php000064400000002575152665621660021644 0ustar00 */ final class ComputerToolCallOutputScreenshot implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'computer_screenshot' $type */ private function __construct( public readonly string $type, public readonly string $fileId, public readonly string $imageUrl, ) {} /** * @param ComputerToolCallOutputScreenshotType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], fileId: $attributes['file_id'], imageUrl: $attributes['image_url'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'file_id' => $this->fileId, 'image_url' => $this->imageUrl, ]; } } src/Responses/Responses/Input/InputMessage.php000064400000005275152665621660015541 0ustar00, id: string, role: 'user'|'system'|'developer', status: 'in_progress'|'completed'|'incomplete', type: 'message'} * * @implements ResponseContract */ final class InputMessage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $content * @param 'user'|'system'|'developer' $role * @param 'in_progress'|'completed'|'incomplete' $status * @param 'message' $type */ private function __construct( public readonly array $content, public readonly string $id, public readonly string $role, public readonly string $status, public readonly string $type, ) {} /** * @param InputMessageType $attributes */ public static function from(array $attributes): self { $content = array_map( fn (array $item): InputMessageContentInputText|InputMessageContentInputImage|InputMessageContentInputFile => match ($item['type']) { 'input_text' => InputMessageContentInputText::from($item), 'input_image' => InputMessageContentInputImage::from($item), 'input_file' => InputMessageContentInputFile::from($item), }, $attributes['content'], ); return new self( content: $content, id: $attributes['id'], role: $attributes['role'], status: $attributes['status'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content' => array_map( fn (InputMessageContentInputText|InputMessageContentInputImage|InputMessageContentInputFile $item): array => $item->toArray(), $this->content, ), 'id' => $this->id, 'role' => $this->role, 'status' => $this->status, 'type' => $this->type, ]; } } src/Responses/Responses/Input/AcknowledgedSafetyCheck.php000064400000002342152665621660017626 0ustar00 */ final class AcknowledgedSafetyCheck implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $code, public readonly string $id, public readonly string $message, ) {} /** * @param AcknowledgedSafetyCheckType $attributes */ public static function from(array $attributes): self { return new self( code: $attributes['code'], id: $attributes['id'], message: $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'id' => $this->id, 'message' => $this->message, ]; } } src/Responses/Responses/Input/InputMessageContentInputText.php000064400000002167152665621660020756 0ustar00 */ final class InputMessageContentInputText implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'input_text' $type */ private function __construct( public readonly string $text, public readonly string $type ) {} /** * @param ContentInputTextType $attributes */ public static function from(array $attributes): self { return new self( text: $attributes['text'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'text' => $this->text, 'type' => $this->type, ]; } } src/Responses/Responses/Input/FunctionToolCallOutput.php000064400000003236152665621660017570 0ustar00 */ final class FunctionToolCallOutput implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'function_call_output' $type * @param 'in_progress'|'completed'|'incompleted' $status */ private function __construct( public readonly string $callId, public readonly string $id, public readonly string $output, public readonly string $type, public readonly string $status, ) {} /** * @param FunctionToolCallOutputType $attributes */ public static function from(array $attributes): self { return new self( callId: $attributes['call_id'], id: $attributes['id'], output: $attributes['output'], type: $attributes['type'], status: $attributes['status'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'call_id' => $this->callId, 'id' => $this->id, 'output' => $this->output, 'type' => $this->type, 'status' => $this->status, ]; } } src/Responses/Responses/Input/ComputerToolCallOutput.php000064400000005331152665621660017577 0ustar00, status: 'in_progress'|'completed'|'incomplete'} * * @implements ResponseContract */ final class ComputerToolCallOutput implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'computer_call_output' $type * @param array $acknowledgedSafetyChecks * @param 'in_progress'|'completed'|'incomplete' $status */ private function __construct( public readonly string $callId, public readonly string $id, public readonly ComputerToolCallOutputScreenshot $output, public readonly string $type, public readonly array $acknowledgedSafetyChecks, public readonly string $status, ) {} /** * @param ComputerToolCallOutputType $attributes */ public static function from(array $attributes): self { $acknowledgedSafetyChecks = array_map( fn (array $acknowledgedSafetyCheck) => AcknowledgedSafetyCheck::from($acknowledgedSafetyCheck), $attributes['acknowledged_safety_checks'], ); return new self( callId: $attributes['call_id'], id: $attributes['id'], output: ComputerToolCallOutputScreenshot::from($attributes['output']), type: $attributes['type'], acknowledgedSafetyChecks: $acknowledgedSafetyChecks, status: $attributes['status'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'call_id' => $this->callId, 'id' => $this->id, 'output' => $this->output->toArray(), 'type' => $this->type, 'acknowledged_safety_checks' => array_map( fn (AcknowledgedSafetyCheck $acknowledgedSafetyCheck) => $acknowledgedSafetyCheck->toArray(), $this->acknowledgedSafetyChecks, ), 'status' => $this->status, ]; } } src/Responses/Responses/Input/InputMessageContentInputImage.php000064400000002707152665621660021054 0ustar00 */ final class InputMessageContentInputImage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'input_image' $type */ private function __construct( public readonly string $type, public readonly string $detail, public readonly ?string $fileId, public readonly ?string $imageUrl, ) {} /** * @param ContentInputImageType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], detail: $attributes['detail'], fileId: $attributes['file_id'], imageUrl: $attributes['image_url'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'detail' => $this->detail, 'file_id' => $this->fileId, 'image_url' => $this->imageUrl, ]; } } src/Responses/Responses/Input/InputMessageContentInputFile.php000064400000002676152665621660020716 0ustar00 */ final class InputMessageContentInputFile implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'input_file' $type */ private function __construct( public readonly string $type, public readonly string $fileData, public readonly string $fileId, public readonly string $filename, ) {} /** * @param ContentInputFileType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], fileData: $attributes['file_data'], fileId: $attributes['file_id'], filename: $attributes['filename'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'file_data' => $this->fileData, 'file_id' => $this->fileId, 'filename' => $this->filename, ]; } } src/Responses/Responses/Streaming/ImageGenerationPart.php000064400000003164152665621660017647 0ustar00 */ final class ImageGenerationPart implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $outputIndex, public readonly string $itemId, public readonly int $sequenceNumber, private readonly MetaInformation $meta, ) {} /** * @param ImageGenerationPartType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( outputIndex: $attributes['output_index'], itemId: $attributes['item_id'], sequenceNumber: $attributes['sequence_number'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'output_index' => $this->outputIndex, 'item_id' => $this->itemId, 'sequence_number' => $this->sequenceNumber, ]; } } src/Responses/Responses/Streaming/ReasoningSummaryTextDone.php000064400000003404152665621660020735 0ustar00 */ final class ReasoningSummaryTextDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $itemId, public readonly int $outputIndex, public readonly int $summaryIndex, public readonly string $text, private readonly MetaInformation $meta, ) {} /** * @param ReasoningSummaryTextDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], summaryIndex: $attributes['summary_index'], text: $attributes['text'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, 'summary_index' => $this->summaryIndex, 'text' => $this->text, ]; } } src/Responses/Responses/Streaming/CodeInterpreterCodeDone.php000064400000003121152665621660020452 0ustar00 */ final class CodeInterpreterCodeDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $code, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param CodeInterpreterCodeDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( code: $attributes['code'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/OutputTextDone.php000064400000003322152665621660016731 0ustar00 */ final class OutputTextDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $contentIndex, public readonly string $itemId, public readonly int $outputIndex, public readonly string $text, private readonly MetaInformation $meta, ) {} /** * @param OutputTextDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( contentIndex: $attributes['content_index'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], text: $attributes['text'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content_index' => $this->contentIndex, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, 'text' => $this->text, ]; } } src/Responses/Responses/Streaming/CodeInterpreterCodeDelta.php000064400000003133152665621660020621 0ustar00 */ final class CodeInterpreterCodeDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $delta, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param CodeInterpreterCodeDeltaType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( delta: $attributes['delta'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'delta' => $this->delta, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/OutputItem.php000064400000010611152665621660016074 0ustar00 */ final class OutputItem implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $outputIndex, public readonly OutputMessage|OutputCodeInterpreterToolCall|OutputFileSearchToolCall|OutputFunctionToolCall|OutputWebSearchToolCall|OutputComputerToolCall|OutputReasoning|OutputMcpListTools|OutputMcpApprovalRequest|OutputMcpCall|OutputImageGenerationToolCall $item, private readonly MetaInformation $meta, ) {} /** * @param OutputItemType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $item = match ($attributes['item']['type']) { 'message' => OutputMessage::from($attributes['item']), 'file_search_call' => OutputFileSearchToolCall::from($attributes['item']), 'function_call' => OutputFunctionToolCall::from($attributes['item']), 'web_search_call' => OutputWebSearchToolCall::from($attributes['item']), 'computer_call' => OutputComputerToolCall::from($attributes['item']), 'reasoning' => OutputReasoning::from($attributes['item']), 'image_generation_call' => OutputImageGenerationToolCall::from($attributes['item']), 'mcp_list_tools' => OutputMcpListTools::from($attributes['item']), 'mcp_approval_request' => OutputMcpApprovalRequest::from($attributes['item']), 'mcp_call' => OutputMcpCall::from($attributes['item']), 'code_interpreter_call' => OutputCodeInterpreterToolCall::from($attributes['item']), }; return new self( outputIndex: $attributes['output_index'], item: $item, meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'output_index' => $this->outputIndex, 'item' => $this->item->toArray(), ]; } } src/Responses/Responses/Streaming/McpCall.php000064400000002373152665621660015276 0ustar00 */ final class McpCall implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $sequenceNumber, private readonly MetaInformation $meta, ) {} /** * @param McpCallType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( sequenceNumber: $attributes['sequence_number'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'sequence_number' => $this->sequenceNumber, ]; } } src/Responses/Responses/Streaming/FunctionCallArgumentsDelta.php000064400000003145152665621660021202 0ustar00 */ final class FunctionCallArgumentsDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $delta, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param FunctionCallArgumentsDeltaType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( delta: $attributes['delta'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'delta' => $this->delta, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/RefusalDone.php000064400000003322152665621660016165 0ustar00 */ final class RefusalDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $contentIndex, public readonly string $itemId, public readonly int $outputIndex, public readonly string $refusal, private readonly MetaInformation $meta, ) {} /** * @param RefusalDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( contentIndex: $attributes['content_index'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], refusal: $attributes['refusal'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content_index' => $this->contentIndex, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, 'refusal' => $this->refusal, ]; } } src/Responses/Responses/Streaming/FileSearchCall.php000064400000002636152665621660016566 0ustar00 */ final class FileSearchCall implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param FileSearchCallType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/McpListToolsInProgress.php000064400000003133152665621660020366 0ustar00 */ final class McpListToolsInProgress implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $sequenceNumber, public readonly int $outputIndex, public readonly string $itemId, private readonly MetaInformation $meta, ) {} /** * @param McpListToolsType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( sequenceNumber: $attributes['sequence_number'], outputIndex: $attributes['output_index'], itemId: $attributes['item_id'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'sequence_number' => $this->sequenceNumber, 'output_index' => $this->outputIndex, 'item_id' => $this->itemId, ]; } } src/Responses/Responses/Streaming/ReasoningSummaryTextDelta.php000064400000003416152665621660021104 0ustar00 */ final class ReasoningSummaryTextDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $delta, public readonly string $itemId, public readonly int $outputIndex, public readonly int $summaryIndex, private readonly MetaInformation $meta, ) {} /** * @param ReasoningSummaryTextDeltaType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( delta: $attributes['delta'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], summaryIndex: $attributes['summary_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'delta' => $this->delta, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, 'summary_index' => $this->summaryIndex, ]; } } src/Responses/Responses/Streaming/Error.php000064400000002735152665621660015056 0ustar00 */ final class Error implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly ?string $code, public readonly string $message, public readonly ?string $param, private readonly MetaInformation $meta, ) {} /** * @param ErrorType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( code: $attributes['code'], message: $attributes['message'], param: $attributes['param'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'message' => $this->message, 'param' => $this->param, ]; } } src/Responses/Responses/Streaming/RefusalDelta.php000064400000003315152665621660016333 0ustar00 */ final class RefusalDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $contentIndex, public readonly string $delta, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param RefusalDeltaType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( contentIndex: $attributes['content_index'], delta: $attributes['delta'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content_index' => $this->contentIndex, 'delta' => $this->delta, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/FunctionCallArgumentsDone.php000064400000003164152665621660021037 0ustar00 */ final class FunctionCallArgumentsDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $arguments, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param FunctionCallArgumentsDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( arguments: $attributes['arguments'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'arguments' => $this->arguments, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/OutputTextAnnotationAdded.php000064400000007074152665621660021110 0ustar00 */ final class OutputTextAnnotationAdded implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly OutputMessageContentOutputTextAnnotationsContainerFile|OutputMessageContentOutputTextAnnotationsFileCitation|OutputMessageContentOutputTextAnnotationsFilePath|OutputMessageContentOutputTextAnnotationsUrlCitation $annotation, public readonly int $annotationIndex, public readonly int $contentIndex, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param OutputTextAnnotationAddedType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $annotation = match ($attributes['annotation']['type']) { 'file_citation' => OutputMessageContentOutputTextAnnotationsFileCitation::from($attributes['annotation']), 'file_path' => OutputMessageContentOutputTextAnnotationsFilePath::from($attributes['annotation']), 'url_citation' => OutputMessageContentOutputTextAnnotationsUrlCitation::from($attributes['annotation']), 'container_file_citation' => OutputMessageContentOutputTextAnnotationsContainerFile::from($attributes['annotation']), }; return new self( annotation: $annotation, annotationIndex: $attributes['annotation_index'], contentIndex: $attributes['content_index'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'annotation' => $this->annotation->toArray(), 'annotation_index' => $this->annotationIndex, 'content_index' => $this->contentIndex, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/ContentPart.php000064400000004441152665621660016222 0ustar00 */ final class ContentPart implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $contentIndex, public readonly string $itemId, public readonly int $outputIndex, public readonly OutputMessageContentOutputText|OutputMessageContentRefusal $part, private readonly MetaInformation $meta, ) {} /** * @param ContentPartType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $part = match ($attributes['part']['type']) { 'output_text' => OutputMessageContentOutputText::from($attributes['part']), 'refusal' => OutputMessageContentRefusal::from($attributes['part']), }; return new self( contentIndex: $attributes['content_index'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], part: $part, meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content_index' => $this->contentIndex, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, 'part' => $this->part->toArray(), ]; } } src/Responses/Responses/Streaming/OutputTextDelta.php000064400000003310152665621660017072 0ustar00 */ final class OutputTextDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $contentIndex, public readonly string $delta, public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param OutputTextType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( contentIndex: $attributes['content_index'], delta: $attributes['delta'], itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content_index' => $this->contentIndex, 'delta' => $this->delta, 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/ImageGenerationPartialImage.php000064400000004074152665621660021301 0ustar00 */ final class ImageGenerationPartialImage implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $outputIndex, public readonly string $itemId, public readonly int $sequenceNumber, public readonly int $partialImageIndex, public readonly string $partialImageB64, private readonly MetaInformation $meta, ) {} /** * @param ImageGenerationPartialImageType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( outputIndex: $attributes['output_index'], itemId: $attributes['item_id'], sequenceNumber: $attributes['sequence_number'], partialImageIndex: $attributes['partial_image_index'], partialImageB64: $attributes['partial_image_b64'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'output_index' => $this->outputIndex, 'item_id' => $this->itemId, 'sequence_number' => $this->sequenceNumber, 'partial_image_index' => $this->partialImageIndex, 'partial_image_b64' => $this->partialImageB64, ]; } } src/Responses/Responses/Streaming/McpCallArgumentsDelta.php000064400000003410152665621660020127 0ustar00 */ final class McpCallArgumentsDelta implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $sequenceNumber, public readonly int $outputIndex, public readonly string $itemId, public readonly string $delta, private readonly MetaInformation $meta, ) {} /** * @param McpCallArgumentsDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( sequenceNumber: $attributes['sequence_number'], outputIndex: $attributes['output_index'], itemId: $attributes['item_id'], delta: $attributes['delta'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'sequence_number' => $this->sequenceNumber, 'output_index' => $this->outputIndex, 'item_id' => $this->itemId, 'delta' => $this->delta, ]; } } src/Responses/Responses/Streaming/ReasoningSummaryPart.php000064400000003701152665621660020111 0ustar00 */ final class ReasoningSummaryPart implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $itemId, public readonly int $outputIndex, public readonly OutputReasoningSummary $part, public readonly int $summaryIndex, private readonly MetaInformation $meta, ) {} /** * @param ReasoningSummaryPartType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], part: OutputReasoningSummary::from($attributes['part']), summaryIndex: $attributes['summary_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, 'part' => $this->part->toArray(), 'summary_index' => $this->summaryIndex, ]; } } src/Responses/Responses/Streaming/CodeInterpreterCall.php000064400000002667152665621660017663 0ustar00 */ final class CodeInterpreterCall implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param CodeInterpreterCallType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/McpCallArgumentsDone.php000064400000003433152665621660017770 0ustar00 */ final class McpCallArgumentsDone implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $sequenceNumber, public readonly int $outputIndex, public readonly string $itemId, public readonly string $arguments, private readonly MetaInformation $meta, ) {} /** * @param McpCallArgumentsDoneType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( sequenceNumber: $attributes['sequence_number'], outputIndex: $attributes['output_index'], itemId: $attributes['item_id'], arguments: $attributes['arguments'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'sequence_number' => $this->sequenceNumber, 'output_index' => $this->outputIndex, 'item_id' => $this->itemId, 'arguments' => $this->arguments, ]; } } src/Responses/Responses/Streaming/WebSearchCall.php000064400000002631152665621660016417 0ustar00 */ final class WebSearchCall implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $itemId, public readonly int $outputIndex, private readonly MetaInformation $meta, ) {} /** * @param WebSearchCallType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( itemId: $attributes['item_id'], outputIndex: $attributes['output_index'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'item_id' => $this->itemId, 'output_index' => $this->outputIndex, ]; } } src/Responses/Responses/Streaming/McpListTools.php000064400000002424152665621660016354 0ustar00 */ final class McpListTools implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly int $sequenceNumber, private readonly MetaInformation $meta, ) {} /** * @param McpListToolsType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( sequenceNumber: $attributes['sequence_number'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'sequence_number' => $this->sequenceNumber, ]; } } src/Responses/Responses/CreateResponseUsageInputTokenDetails.php000064400000001764152665621660021273 0ustar00 */ final class CreateResponseUsageInputTokenDetails implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly int $cachedTokens, ) {} /** * @param InputTokenDetailsType $attributes */ public static function from(array $attributes): self { return new self( cachedTokens: $attributes['cached_tokens'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'cached_tokens' => $this->cachedTokens, ]; } } src/Responses/Responses/ListInputItems.php000064400000010632152665621660014764 0ustar00, first_id: string, has_more: bool, last_id: string, object: 'list'} * * @implements ResponseContract */ final class ListInputItems implements ResponseContract, ResponseHasMetaInformationContract { /** @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data * @param 'list' $object */ private function __construct( public readonly string $object, public readonly array $data, public readonly string $firstId, public readonly string $lastId, public readonly bool $hasMore, private readonly MetaInformation $meta, ) {} /** * @param ListInputItemsType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map( fn (array $item): InputMessage|OutputMessage|OutputFileSearchToolCall|OutputComputerToolCall|ComputerToolCallOutput|OutputWebSearchToolCall|OutputFunctionToolCall|FunctionToolCallOutput => match ($item['type']) { 'message' => $item['role'] === 'assistant' ? OutputMessage::from($item) : InputMessage::from($item), 'file_search_call' => OutputFileSearchToolCall::from($item), 'function_call' => OutputFunctionToolCall::from($item), 'function_call_output' => FunctionToolCallOutput::from($item), 'web_search_call' => OutputWebSearchToolCall::from($item), 'computer_call' => OutputComputerToolCall::from($item), 'computer_call_output' => ComputerToolCallOutput::from($item), }, $attributes['data'], ); return new self( object: $attributes['object'], data: $data, firstId: $attributes['first_id'], lastId: $attributes['last_id'], hasMore: $attributes['has_more'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( fn (InputMessage|OutputMessage|OutputFileSearchToolCall|OutputComputerToolCall|ComputerToolCallOutput|OutputWebSearchToolCall|OutputFunctionToolCall|FunctionToolCallOutput $item): array => $item->toArray(), $this->data, ), 'first_id' => $this->firstId, 'last_id' => $this->lastId, 'has_more' => $this->hasMore, ]; } } src/Responses/Responses/ReferencePromptObject.php000064400000002561152665621660016260 0ustar00|null, version?: string|null} * * @implements ResponseContract */ final class ReferencePromptObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array|null $variables */ private function __construct( public readonly string $id, public readonly ?array $variables = null, public readonly ?string $version = null, ) {} /** * @param ReferencePromptObjectType $attributes */ public static function from(array $attributes): self { return new self( id: $attributes['id'], variables: $attributes['variables'] ?? null, version: $attributes['version'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'variables' => $this->variables, 'version' => $this->version, ]; } } src/Responses/Responses/DeleteResponse.php000064400000002753152665621660014755 0ustar00 */ final class DeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * @param DeleteResponseType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( id: $attributes['id'], object: $attributes['object'], deleted: $attributes['deleted'], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Responses/CreateResponseUsageOutputTokenDetails.php000064400000002013152665621660021460 0ustar00 */ final class CreateResponseUsageOutputTokenDetails implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly int $reasoningTokens, ) {} /** * @param OutputTokenDetailsType $attributes */ public static function from(array $attributes): self { return new self( reasoningTokens: $attributes['reasoning_tokens'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'reasoning_tokens' => $this->reasoningTokens, ]; } } src/Responses/Responses/RetrieveResponse.php000064400000032454152665621660015341 0ustar00|string|null * @phpstan-type ToolChoiceType 'none'|'auto'|'required'|FunctionToolChoiceType|HostedToolChoiceType * @phpstan-type ToolsType array * @phpstan-type OutputType array * @phpstan-type RetrieveResponseType array{id: string, object: 'response', created_at: int, status: 'completed'|'failed'|'in_progress'|'incomplete', error: ErrorType|null, incomplete_details: IncompleteDetailsType|null, instructions: InstructionsType, max_output_tokens: int|null, model: string, output: OutputType, parallel_tool_calls: bool, previous_response_id: string|null, prompt: ReferencePromptObjectType|null, reasoning: ReasoningType|null, store: bool, temperature: float|null, text: ResponseFormatType, tool_choice: ToolChoiceType, tools: ToolsType, top_p: float|null, truncation: 'auto'|'disabled'|null, usage: UsageType|null, user: string|null, metadata: array|null} * * @implements ResponseContract */ final class RetrieveResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param 'response' $object * @param 'completed'|'failed'|'in_progress'|'incomplete' $status * @param array|string|null $instructions * @param array $output * @param array $tools * @param 'auto'|'disabled'|null $truncation * @param array $metadata */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $createdAt, public readonly string $status, public readonly ?CreateResponseError $error, public readonly ?CreateResponseIncompleteDetails $incompleteDetails, public readonly array|string|null $instructions, public readonly ?int $maxOutputTokens, public readonly string $model, public readonly array $output, public readonly bool $parallelToolCalls, public readonly ?string $previousResponseId, public readonly ?ReferencePromptObject $prompt, public readonly ?CreateResponseReasoning $reasoning, public readonly bool $store, public readonly ?float $temperature, public readonly CreateResponseFormat $text, public readonly string|FunctionToolChoice|HostedToolChoice $toolChoice, public readonly array $tools, public readonly ?float $topP, public readonly ?string $truncation, public readonly ?CreateResponseUsage $usage, public readonly ?string $user, public array $metadata, private readonly MetaInformation $meta, ) {} /** * @param RetrieveResponseType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $output = array_map( fn (array $output): OutputMessage|OutputComputerToolCall|OutputFileSearchToolCall|OutputWebSearchToolCall|OutputFunctionToolCall|OutputReasoning|OutputMcpListTools|OutputMcpApprovalRequest|OutputMcpCall|OutputImageGenerationToolCall|OutputCodeInterpreterToolCall => match ($output['type']) { 'message' => OutputMessage::from($output), 'file_search_call' => OutputFileSearchToolCall::from($output), 'function_call' => OutputFunctionToolCall::from($output), 'web_search_call' => OutputWebSearchToolCall::from($output), 'computer_call' => OutputComputerToolCall::from($output), 'reasoning' => OutputReasoning::from($output), 'mcp_list_tools' => OutputMcpListTools::from($output), 'mcp_approval_request' => OutputMcpApprovalRequest::from($output), 'mcp_call' => OutputMcpCall::from($output), 'image_generation_call' => OutputImageGenerationToolCall::from($output), 'code_interpreter_call' => OutputCodeInterpreterToolCall::from($output), }, $attributes['output'], ); $toolChoice = is_array($attributes['tool_choice']) ? match ($attributes['tool_choice']['type']) { 'file_search', 'web_search_preview', 'computer_use_preview' => HostedToolChoice::from($attributes['tool_choice']), 'function' => FunctionToolChoice::from($attributes['tool_choice']), } : $attributes['tool_choice']; $tools = array_map( fn (array $tool): ComputerUseTool|FileSearchTool|FunctionTool|WebSearchTool|ImageGenerationTool|RemoteMcpTool|CodeInterpreterTool => match ($tool['type']) { 'file_search' => FileSearchTool::from($tool), 'web_search_preview', 'web_search_preview_2025_03_11' => WebSearchTool::from($tool), 'function' => FunctionTool::from($tool), 'computer_use_preview' => ComputerUseTool::from($tool), 'image_generation' => ImageGenerationTool::from($tool), 'mcp' => RemoteMcpTool::from($tool), 'code_interpreter' => CodeInterpreterTool::from($tool), }, $attributes['tools'], ); return new self( id: $attributes['id'], object: $attributes['object'], createdAt: $attributes['created_at'], status: $attributes['status'], error: isset($attributes['error']) ? CreateResponseError::from($attributes['error']) : null, incompleteDetails: isset($attributes['incomplete_details']) ? CreateResponseIncompleteDetails::from($attributes['incomplete_details']) : null, instructions: $attributes['instructions'], maxOutputTokens: $attributes['max_output_tokens'], model: $attributes['model'], output: $output, parallelToolCalls: $attributes['parallel_tool_calls'], previousResponseId: $attributes['previous_response_id'], prompt: isset($attributes['prompt']) ? ReferencePromptObject::from($attributes['prompt']) : null, reasoning: isset($attributes['reasoning']) ? CreateResponseReasoning::from($attributes['reasoning']) : null, store: $attributes['store'], temperature: $attributes['temperature'], text: CreateResponseFormat::from($attributes['text']), toolChoice: $toolChoice, tools: $tools, topP: $attributes['top_p'], truncation: $attributes['truncation'], usage: isset($attributes['usage']) ? CreateResponseUsage::from($attributes['usage']) : null, user: $attributes['user'] ?? null, metadata: $attributes['metadata'] ?? [], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { // https://github.com/phpstan/phpstan/issues/8438 // @phpstan-ignore-next-line return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'status' => $this->status, 'error' => $this->error?->toArray(), 'incomplete_details' => $this->incompleteDetails?->toArray(), 'instructions' => $this->instructions, 'max_output_tokens' => $this->maxOutputTokens, 'metadata' => $this->metadata ?? [], 'model' => $this->model, 'output' => array_map( fn (OutputMessage|OutputComputerToolCall|OutputFileSearchToolCall|OutputWebSearchToolCall|OutputFunctionToolCall|OutputReasoning|OutputMcpListTools|OutputMcpCall|OutputMcpApprovalRequest|OutputImageGenerationToolCall|OutputCodeInterpreterToolCall $output): array => $output->toArray(), $this->output ), 'parallel_tool_calls' => $this->parallelToolCalls, 'previous_response_id' => $this->previousResponseId, 'prompt' => $this->prompt?->toArray(), 'reasoning' => $this->reasoning?->toArray(), 'store' => $this->store, 'temperature' => $this->temperature, 'text' => $this->text->toArray(), 'tool_choice' => is_string($this->toolChoice) ? $this->toolChoice : $this->toolChoice->toArray(), 'tools' => array_map( fn (ComputerUseTool|FileSearchTool|FunctionTool|WebSearchTool|ImageGenerationTool|RemoteMcpTool|CodeInterpreterTool $tool): array => $tool->toArray(), $this->tools ), 'top_p' => $this->topP, 'truncation' => $this->truncation, 'usage' => $this->usage?->toArray(), 'user' => $this->user, ]; } } src/Responses/Responses/CreateStreamedResponse.php000064400000017222152665621660016440 0ustar00} * * @implements ResponseContract */ final class CreateStreamedResponse implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use FakeableForStreamedResponse; private function __construct( public readonly string $event, public readonly CreateResponse|OutputItem|ContentPart|OutputTextDelta|OutputTextAnnotationAdded|OutputTextDone|RefusalDelta|RefusalDone|FunctionCallArgumentsDelta|FunctionCallArgumentsDone|FileSearchCall|WebSearchCall|CodeInterpreterCall|CodeInterpreterCodeDelta|CodeInterpreterCodeDone|ReasoningSummaryPart|ReasoningSummaryTextDelta|ReasoningSummaryTextDone|McpListTools|McpListToolsInProgress|McpCall|McpCallArgumentsDelta|McpCallArgumentsDone|ImageGenerationPart|ImageGenerationPartialImage|Error $response, ) {} /** * @param array $attributes */ public static function from(array $attributes): self { $event = $attributes['type'] ?? throw new UnknownEventException('Missing event type in streamed response'); $meta = $attributes['__meta']; unset($attributes['__meta']); $response = match ($event) { 'response.created', 'response.in_progress', 'response.completed', 'response.failed', 'response.incomplete' => CreateResponse::from($attributes['response'], $meta), // @phpstan-ignore-line 'response.output_item.added', 'response.output_item.done' => OutputItem::from($attributes, $meta), // @phpstan-ignore-line 'response.content_part.added', 'response.content_part.done' => ContentPart::from($attributes, $meta), // @phpstan-ignore-line 'response.output_text.delta' => OutputTextDelta::from($attributes, $meta), // @phpstan-ignore-line 'response.output_text.done' => OutputTextDone::from($attributes, $meta), // @phpstan-ignore-line 'response.output_text.annotation.added' => OutputTextAnnotationAdded::from($attributes, $meta), // @phpstan-ignore-line 'response.refusal.delta' => RefusalDelta::from($attributes, $meta), // @phpstan-ignore-line 'response.refusal.done' => RefusalDone::from($attributes, $meta), // @phpstan-ignore-line 'response.function_call_arguments.delta' => FunctionCallArgumentsDelta::from($attributes, $meta), // @phpstan-ignore-line 'response.function_call_arguments.done' => FunctionCallArgumentsDone::from($attributes, $meta), // @phpstan-ignore-line 'response.file_search_call.in_progress', 'response.file_search_call.searching', 'response.file_search_call.completed' => FileSearchCall::from($attributes, $meta), // @phpstan-ignore-line 'response.web_search_call.in_progress', 'response.web_search_call.searching', 'response.web_search_call.completed' => WebSearchCall::from($attributes, $meta), // @phpstan-ignore-line 'response.code_interpreter_call.in_progress', 'response.code_interpreter_call.running', 'response.code_interpreter_call.interpreting', 'response.code_interpreter_call.completed' => CodeInterpreterCall::from($attributes, $meta), // @phpstan-ignore-line 'response.code_interpreter_call_code.delta' => CodeInterpreterCodeDelta::from($attributes, $meta), // @phpstan-ignore-line 'response.code_interpreter_call_code.done' => CodeInterpreterCodeDone::from($attributes, $meta), // @phpstan-ignore-line 'response.reasoning_summary_part.added', 'response.reasoning_summary_part.done' => ReasoningSummaryPart::from($attributes, $meta), // @phpstan-ignore-line 'response.reasoning_summary_text.delta' => ReasoningSummaryTextDelta::from($attributes, $meta), // @phpstan-ignore-line 'response.reasoning_summary_text.done' => ReasoningSummaryTextDone::from($attributes, $meta), // @phpstan-ignore-line 'response.mcp_list_tools.in_progress' => McpListToolsInProgress::from($attributes, $meta), // @phpstan-ignore-line 'response.mcp_list_tools.failed', 'response.mcp_list_tools.completed' => McpListTools::from($attributes, $meta), // @phpstan-ignore-line 'response.mcp_call.in_progress', 'response.mcp_call.failed', 'response.mcp_call.completed' => McpCall::from($attributes, $meta), // @phpstan-ignore-line 'response.mcp_call.arguments.delta', 'response.mcp_call_arguments.delta' => McpCallArgumentsDelta::from($attributes, $meta), // @phpstan-ignore-line 'response.mcp_call.arguments.done', 'response.mcp_call_arguments.done' => McpCallArgumentsDone::from($attributes, $meta), // @phpstan-ignore-line 'response.image_generation_call.completed', 'response.image_generation_call.generating', 'response.image_generation_call.in_progress' => ImageGenerationPart::from($attributes, $meta), // @phpstan-ignore-line 'response.image_generation_call.partial_image' => ImageGenerationPartialImage::from($attributes, $meta), // @phpstan-ignore-line 'error' => Error::from($attributes, $meta), // @phpstan-ignore-line default => throw new UnknownEventException('Unknown Responses streaming event: ' . $event), }; return new self( event: $event, // @phpstan-ignore-line response: $response, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'event' => $this->event, 'data' => $this->response->toArray(), ]; } } src/Responses/Responses/Tool/ComputerUseTool.php000064400000003016152665621660016053 0ustar00 */ final class ComputerUseTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'computer_use_preview' $type */ private function __construct( public readonly int $displayHeight, public readonly int $displayWidth, public readonly string $environment, public readonly string $type, ) {} /** * @param ComputerUseToolType $attributes */ public static function from(array $attributes): self { return new self( displayHeight: $attributes['display_height'], displayWidth: $attributes['display_width'], environment: $attributes['environment'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'display_height' => $this->displayHeight, 'display_width' => $this->displayWidth, 'environment' => $this->environment, 'type' => $this->type, ]; } } src/Responses/Responses/Tool/FileSearchCompoundFilter.php000064400000003131152665621660017620 0ustar00, type: 'and'|'or'} * * @implements ResponseContract */ final class FileSearchCompoundFilter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $filters * @param 'and'|'or' $type */ private function __construct( public readonly array $filters, public readonly string $type, ) {} /** * @param CompoundFilterType $attributes */ public static function from(array $attributes): self { $filters = array_map( static fn (array $filter): FileSearchComparisonFilter => FileSearchComparisonFilter::from($filter), $attributes['filters'], ); return new self( filters: $filters, type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'filters' => array_map( static fn (FileSearchComparisonFilter $filter): array => $filter->toArray(), $this->filters, ), 'type' => $this->type, ]; } } src/Responses/Responses/Tool/CodeInterpreterTool.php000064400000003076152665621660016704 0ustar00 */ final class CodeInterpreterTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'code_interpreter' $type */ private function __construct( public readonly string|CodeInterpreterContainerAuto $container, public readonly string $type, ) {} /** * @param CodeInterpreterToolType $attributes */ public static function from(array $attributes): self { return new self( container: is_string($attributes['container']) ? $attributes['container'] : CodeInterpreterContainerAuto::from($attributes['container']), type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'container' => $this->container instanceof CodeInterpreterContainerAuto ? $this->container->toArray() : $this->container, 'type' => $this->type, ]; } } src/Responses/Responses/Tool/WebSearchUserLocation.php000064400000003057152665621660017142 0ustar00 */ final class WebSearchUserLocation implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'approximate' $type */ private function __construct( public readonly string $type, public readonly ?string $city, public readonly string $country, public readonly ?string $region, public readonly ?string $timezone, ) {} /** * @param UserLocationType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], city: $attributes['city'], country: $attributes['country'], region: $attributes['region'], timezone: $attributes['timezone'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'city' => $this->city, 'country' => $this->country, 'region' => $this->region, 'timezone' => $this->timezone, ]; } } src/Responses/Responses/Tool/RemoteMcpTool.php000064400000006440152665621660015477 0ustar00|null, allowed_tools: array|McpToolNamesFilterType|null, headers: array|null} * * @implements ResponseContract */ final class RemoteMcpTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'mcp' $type * @param 'never'|'always'|array<'never'|'always', McpToolNamesFilter>|null $requireApproval * @param array|McpToolNamesFilter|null $allowedTools * @param array|null $headers */ private function __construct( public readonly string $type, public readonly string $serverLabel, public readonly string $serverUrl, public readonly string|array|null $requireApproval = null, public readonly array|McpToolNamesFilter|null $allowedTools = null, public readonly ?array $headers = null, ) {} /** * @param RemoteMcpToolType $attributes */ public static function from(array $attributes): self { $requireApproval = $attributes['require_approval'] ?? null; if (is_array($requireApproval)) { $requireApproval = array_map(function (array $approvalAttributes): McpToolNamesFilter { return McpToolNamesFilter::from($approvalAttributes); }, $requireApproval); } $allowedTools = $attributes['allowed_tools'] ?? null; if ($allowedTools !== null && isset($allowedTools['tool_names']) && is_array($allowedTools['tool_names'])) { $allowedTools = McpToolNamesFilter::from($allowedTools); } return new self( type: $attributes['type'], serverLabel: $attributes['server_label'], serverUrl: $attributes['server_url'], requireApproval: $requireApproval, allowedTools: $allowedTools, // @phpstan-ignore-line headers: $attributes['headers'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { $requireApproval = $this->requireApproval; if (is_array($requireApproval)) { $requireApproval = array_map(function (McpToolNamesFilter $approvalFilter): array { return $approvalFilter->toArray(); }, $requireApproval); } $allowedTools = $this->allowedTools; if ($allowedTools instanceof McpToolNamesFilter) { $allowedTools = $allowedTools->toArray(); } return [ 'type' => $this->type, 'server_label' => $this->serverLabel, 'server_url' => $this->serverUrl, 'require_approval' => $requireApproval, 'allowed_tools' => $allowedTools, 'headers' => $this->headers, ]; } } src/Responses/Responses/Tool/WebSearchTool.php000064400000003346152665621660015451 0ustar00 */ final class WebSearchTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'web_search_preview'|'web_search_preview_2025_03_11' $type * @param 'low'|'medium'|'high' $searchContextSize */ private function __construct( public readonly string $type, public readonly string $searchContextSize, public readonly ?WebSearchUserLocation $userLocation, ) {} /** * @param WebSearchToolType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], searchContextSize: $attributes['search_context_size'], userLocation: isset($attributes['user_location']) ? WebSearchUserLocation::from($attributes['user_location']) : null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'search_context_size' => $this->searchContextSize, 'user_location' => $this->userLocation?->toArray(), ]; } } src/Responses/Responses/Tool/CodeInterpreterContainerAuto.php000064400000002377152665621660020545 0ustar00|null, type: 'auto'} * * @implements ResponseContract */ final class CodeInterpreterContainerAuto implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array|null $fileIds * @param 'auto' $type */ private function __construct( public readonly ?array $fileIds, public readonly string $type, ) {} /** * @param CodeInterpreterContainerAutoType $attributes */ public static function from(array $attributes): self { return new self( fileIds: $attributes['file_ids'] ?? null, type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_ids' => $this->fileIds, 'type' => $this->type, ]; } } src/Responses/Responses/Tool/FileSearchTool.php000064400000004751152665621660015614 0ustar00, filters: ComparisonFilterType|CompoundFilterType|null, max_num_results: int, ranking_options: RankingOptionType} * * @implements ResponseContract */ final class FileSearchTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $vectorStoreIds * @param 'file_search' $type */ private function __construct( public readonly string $type, public readonly array $vectorStoreIds, public readonly FileSearchComparisonFilter|FileSearchCompoundFilter|null $filters, public readonly int $maxNumResults, public readonly FileSearchRankingOption $rankingOptions, ) {} /** * @param FileSearchToolType $attributes */ public static function from(array $attributes): self { $filters = null; if (isset($attributes['filters']['type'])) { $filters = match ($attributes['filters']['type']) { 'eq', 'ne', 'gt', 'gte', 'lt', 'lte' => FileSearchComparisonFilter::from($attributes['filters']), 'and', 'or' => FileSearchCompoundFilter::from($attributes['filters']), }; } return new self( type: $attributes['type'], vectorStoreIds: $attributes['vector_store_ids'], filters: $filters, maxNumResults: $attributes['max_num_results'], rankingOptions: FileSearchRankingOption::from($attributes['ranking_options']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'vector_store_ids' => $this->vectorStoreIds, 'filters' => $this->filters?->toArray(), 'max_num_results' => $this->maxNumResults, 'ranking_options' => $this->rankingOptions->toArray(), ]; } } src/Responses/Responses/Tool/FileSearchRankingOption.php000064400000002177152665621660017461 0ustar00 */ final class FileSearchRankingOption implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $ranker, public readonly float $scoreThreshold, ) {} /** * @param RankingOptionType $attributes */ public static function from(array $attributes): self { return new self( ranker: $attributes['ranker'], scoreThreshold: $attributes['score_threshold'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'ranker' => $this->ranker, 'score_threshold' => $this->scoreThreshold, ]; } } src/Responses/Responses/Tool/ImageGenerationTool.php000064400000006151152665621660016641 0ustar00 */ final class ImageGenerationTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'image_generation' $type * @param 'transparent'|'opaque'|'auto' $background * @param 'jpeg'|'png'|'webp' $outputFormat * @param 'low'|'medium'|'high'|'auto' $quality * @param "1024x1024"|"1024x1536"|"1536x1024"|'auto' $size */ private function __construct( public readonly string $type, public readonly string $background, public readonly ?ImageGenerationInputImageMask $inputImageMask, public readonly ?string $model, public readonly string $moderation, public readonly int $outputCompression, public readonly string $outputFormat, public readonly int $partialImages, public readonly string $quality, public readonly string $size, ) {} /** * @param ImageGenerationToolType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], background: $attributes['background'], inputImageMask: isset($attributes['input_image_mask']) ? ImageGenerationInputImageMask::from($attributes['input_image_mask']) : null, model: $attributes['model'] ?? null, moderation: $attributes['moderation'], outputCompression: $attributes['output_compression'], outputFormat: $attributes['output_format'], partialImages: $attributes['partial_images'] ?? 0, quality: $attributes['quality'], size: $attributes['size'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'background' => $this->background, 'input_image_mask' => $this->inputImageMask?->toArray(), 'model' => $this->model, 'moderation' => $this->moderation, 'output_compression' => $this->outputCompression, 'output_format' => $this->outputFormat, 'partial_images' => $this->partialImages, 'quality' => $this->quality, 'size' => $this->size, ]; } } src/Responses/Responses/Tool/FunctionTool.php000064400000003206152665621660015366 0ustar00, strict: bool, type: 'function', description: ?string} * * @implements ResponseContract */ final class FunctionTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $parameters * @param 'function' $type */ private function __construct( public readonly string $name, public readonly array $parameters, public readonly bool $strict, public readonly string $type, public readonly ?string $description = null, ) {} /** * @param FunctionToolType $attributes */ public static function from(array $attributes): self { return new self( name: $attributes['name'], parameters: $attributes['parameters'], strict: $attributes['strict'], type: $attributes['type'], description: $attributes['description'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'parameters' => $this->parameters, 'strict' => $this->strict, 'type' => $this->type, 'description' => $this->description, ]; } } src/Responses/Responses/Tool/ImageGenerationInputImageMask.php000064400000002177152665621660020606 0ustar00 */ final class ImageGenerationInputImageMask implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly ?string $fileId, public readonly ?string $imageUrl, ) {} /** * @param InputImageMaskType $attributes */ public static function from(array $attributes): self { return new self( fileId: $attributes['file_id'] ?? null, imageUrl: $attributes['image_url'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, 'image_url' => $this->imageUrl, ]; } } src/Responses/Responses/Tool/FileSearchComparisonFilter.php000064400000002456152665621660020157 0ustar00 */ final class FileSearchComparisonFilter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'eq'|'ne'|'gt'|'gte'|'lt'|'lte' $type */ private function __construct( public readonly string $key, public readonly string $type, public readonly string|int|bool $value, ) {} /** * @param ComparisonFilterType $attributes */ public static function from(array $attributes): self { return new self( key: $attributes['key'], type: $attributes['type'], value: $attributes['value'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'key' => $this->key, 'type' => $this->type, 'value' => $this->value, ]; } } src/Responses/Responses/Tool/McpToolNamesFilter.php000064400000002050152665621660016446 0ustar00} * * @implements ResponseContract */ final class McpToolNamesFilter implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $toolNames */ private function __construct( public readonly array $toolNames, ) {} /** * @param McpToolNamesFilterType $attributes */ public static function from(array $attributes): self { return new self( toolNames: $attributes['tool_names'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'tool_names' => $this->toolNames, ]; } } src/Responses/Responses/CreateResponseError.php000064400000002030152665621660015754 0ustar00 */ final class CreateResponseError implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $code, public readonly string $message ) {} /** * @param ErrorType $attributes */ public static function from(array $attributes): self { return new self( code: $attributes['code'], message: $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'message' => $this->message, ]; } } src/Responses/Responses/CreateResponseFormat.php000064400000003220152665621660016115 0ustar00 */ final class CreateResponseFormat implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly TextFormat|JsonSchemaFormat|JsonObjectFormat $format ) {} /** * @param ResponseFormatType $attributes */ public static function from(array $attributes): self { $format = match ($attributes['format']['type']) { 'text' => TextFormat::from($attributes['format']), 'json_schema' => JsonSchemaFormat::from($attributes['format']), 'json_object' => JsonObjectFormat::from($attributes['format']), }; return new self( format: $format ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'format' => $this->format->toArray(), ]; } } src/Responses/Responses/CreateResponseReasoning.php000064400000002212152665621660016612 0ustar00 */ final class CreateResponseReasoning implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly ?string $effort, public readonly ?string $generate_summary, ) {} /** * @param ReasoningType $attributes */ public static function from(array $attributes): self { return new self( effort: $attributes['effort'] ?? null, generate_summary: $attributes['generate_summary'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'effort' => $this->effort, 'generate_summary' => $this->generate_summary, ]; } } src/Responses/Responses/CreateResponse.php000064400000033602152665621660014753 0ustar00|string|null * @phpstan-type ToolChoiceType 'none'|'auto'|'required'|FunctionToolChoiceType|HostedToolChoiceType * @phpstan-type ToolsType array * @phpstan-type OutputType array * @phpstan-type CreateResponseType array{id: string, object: 'response', created_at: int, status: 'completed'|'failed'|'in_progress'|'incomplete', error: ErrorType|null, incomplete_details: IncompleteDetailsType|null, instructions: InstructionsType, max_output_tokens: int|null, model: string, output: OutputType, output_text: string|null, parallel_tool_calls: bool, previous_response_id: string|null, prompt: ReferencePromptObjectType|null, reasoning: ReasoningType|null, store: bool, temperature: float|null, text: ResponseFormatType, tool_choice: ToolChoiceType, tools: ToolsType, top_p: float|null, truncation: 'auto'|'disabled'|null, usage: UsageType|null, user: string|null, metadata: array|null} * * @implements ResponseContract */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param 'response' $object * @param 'completed'|'failed'|'in_progress'|'incomplete' $status * @param array|string|null $instructions * @param array $output * @param array $tools * @param 'auto'|'disabled'|null $truncation * @param array $metadata */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $createdAt, public readonly string $status, public readonly ?CreateResponseError $error, public readonly ?CreateResponseIncompleteDetails $incompleteDetails, public readonly array|string|null $instructions, public readonly ?int $maxOutputTokens, public readonly string $model, public readonly array $output, public readonly ?string $outputText, public readonly bool $parallelToolCalls, public readonly ?string $previousResponseId, public readonly ?ReferencePromptObject $prompt, public readonly ?CreateResponseReasoning $reasoning, public readonly bool $store, public readonly ?float $temperature, public readonly CreateResponseFormat $text, public readonly string|FunctionToolChoice|HostedToolChoice $toolChoice, public readonly array $tools, public readonly ?float $topP, public readonly ?string $truncation, public readonly ?CreateResponseUsage $usage, public readonly ?string $user, public readonly array $metadata, private readonly MetaInformation $meta, ) {} /** * @param CreateResponseType $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $output = array_map( fn (array $output): OutputMessage|OutputComputerToolCall|OutputFileSearchToolCall|OutputWebSearchToolCall|OutputFunctionToolCall|OutputReasoning|OutputMcpListTools|OutputMcpApprovalRequest|OutputMcpCall|OutputImageGenerationToolCall|OutputCodeInterpreterToolCall => match ($output['type']) { 'message' => OutputMessage::from($output), 'file_search_call' => OutputFileSearchToolCall::from($output), 'function_call' => OutputFunctionToolCall::from($output), 'web_search_call' => OutputWebSearchToolCall::from($output), 'computer_call' => OutputComputerToolCall::from($output), 'reasoning' => OutputReasoning::from($output), 'mcp_list_tools' => OutputMcpListTools::from($output), 'mcp_approval_request' => OutputMcpApprovalRequest::from($output), 'mcp_call' => OutputMcpCall::from($output), 'image_generation_call' => OutputImageGenerationToolCall::from($output), 'code_interpreter_call' => OutputCodeInterpreterToolCall::from($output), }, $attributes['output'], ); $toolChoice = is_array($attributes['tool_choice']) ? match ($attributes['tool_choice']['type']) { 'file_search', 'web_search_preview', 'computer_use_preview' => HostedToolChoice::from($attributes['tool_choice']), 'function' => FunctionToolChoice::from($attributes['tool_choice']), } : $attributes['tool_choice']; $tools = array_map( fn (array $tool): ComputerUseTool|FileSearchTool|FunctionTool|WebSearchTool|ImageGenerationTool|RemoteMcpTool|CodeInterpreterTool => match ($tool['type']) { 'file_search' => FileSearchTool::from($tool), 'web_search_preview', 'web_search_preview_2025_03_11' => WebSearchTool::from($tool), 'function' => FunctionTool::from($tool), 'computer_use_preview' => ComputerUseTool::from($tool), 'image_generation' => ImageGenerationTool::from($tool), 'mcp' => RemoteMcpTool::from($tool), 'code_interpreter' => CodeInterpreterTool::from($tool), }, $attributes['tools'], ); // Remake the sdk only property output_text. $texts = []; foreach ($output as $item) { if ($item instanceof OutputMessage) { foreach ($item->content as $content) { if ($content instanceof OutputMessageContentOutputText) { $texts[] = $content->text; } } } } return new self( id: $attributes['id'], object: $attributes['object'], createdAt: $attributes['created_at'], status: $attributes['status'], error: isset($attributes['error']) ? CreateResponseError::from($attributes['error']) : null, incompleteDetails: isset($attributes['incomplete_details']) ? CreateResponseIncompleteDetails::from($attributes['incomplete_details']) : null, instructions: $attributes['instructions'], maxOutputTokens: $attributes['max_output_tokens'], model: $attributes['model'], output: $output, outputText: empty($texts) ? null : implode(' ', $texts), parallelToolCalls: $attributes['parallel_tool_calls'], previousResponseId: $attributes['previous_response_id'], prompt: isset($attributes['prompt']) ? ReferencePromptObject::from($attributes['prompt']) : null, reasoning: isset($attributes['reasoning']) ? CreateResponseReasoning::from($attributes['reasoning']) : null, store: $attributes['store'], temperature: $attributes['temperature'], text: CreateResponseFormat::from($attributes['text']), toolChoice: $toolChoice, tools: $tools, topP: $attributes['top_p'], truncation: $attributes['truncation'], usage: isset($attributes['usage']) ? CreateResponseUsage::from($attributes['usage']) : null, user: $attributes['user'] ?? null, metadata: $attributes['metadata'] ?? [], meta: $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { // https://github.com/phpstan/phpstan/issues/8438 // @phpstan-ignore-next-line return [ 'id' => $this->id, 'object' => $this->object, 'created_at' => $this->createdAt, 'status' => $this->status, 'error' => $this->error?->toArray(), 'incomplete_details' => $this->incompleteDetails?->toArray(), 'instructions' => $this->instructions, 'max_output_tokens' => $this->maxOutputTokens, 'metadata' => $this->metadata ?? [], 'model' => $this->model, 'output' => array_map( fn (OutputMessage|OutputComputerToolCall|OutputFileSearchToolCall|OutputWebSearchToolCall|OutputFunctionToolCall|OutputReasoning|OutputMcpListTools|OutputMcpApprovalRequest|OutputMcpCall|OutputImageGenerationToolCall|OutputCodeInterpreterToolCall $output): array => $output->toArray(), $this->output ), 'parallel_tool_calls' => $this->parallelToolCalls, 'previous_response_id' => $this->previousResponseId, 'prompt' => $this->prompt?->toArray(), 'reasoning' => $this->reasoning?->toArray(), 'store' => $this->store, 'temperature' => $this->temperature, 'text' => $this->text->toArray(), 'tool_choice' => is_string($this->toolChoice) ? $this->toolChoice : $this->toolChoice->toArray(), 'tools' => array_map( fn (ComputerUseTool|FileSearchTool|FunctionTool|WebSearchTool|ImageGenerationTool|RemoteMcpTool|CodeInterpreterTool $tool): array => $tool->toArray(), $this->tools ), 'top_p' => $this->topP, 'truncation' => $this->truncation, 'usage' => $this->usage?->toArray(), 'user' => $this->user, 'output_text' => $this->outputText, ]; } } src/Responses/Responses/CreateResponseIncompleteDetails.php000064400000001716152665621660020302 0ustar00 */ final class CreateResponseIncompleteDetails implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $reason, ) {} /** * @param IncompleteDetailsType $attributes */ public static function from(array $attributes): self { return new self( reason: $attributes['reason'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'reason' => $this->reason, ]; } } src/Responses/Responses/CreateResponseUsage.php000064400000004116152665621660015736 0ustar00 */ final class CreateResponseUsage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly int $inputTokens, public readonly CreateResponseUsageInputTokenDetails $inputTokensDetails, public readonly int $outputTokens, public readonly CreateResponseUsageOutputTokenDetails $outputTokensDetails, public readonly int $totalTokens, ) {} /** * @param UsageType $attributes */ public static function from(array $attributes): self { return new self( inputTokens: $attributes['input_tokens'], inputTokensDetails: CreateResponseUsageInputTokenDetails::from($attributes['input_tokens_details']), outputTokens: $attributes['output_tokens'], outputTokensDetails: CreateResponseUsageOutputTokenDetails::from($attributes['output_tokens_details']), totalTokens: $attributes['total_tokens'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'input_tokens' => $this->inputTokens, 'input_tokens_details' => $this->inputTokensDetails->toArray(), 'output_tokens' => $this->outputTokens, 'output_tokens_details' => $this->outputTokensDetails->toArray(), 'total_tokens' => $this->totalTokens, ]; } } src/Responses/Responses/Output/OutputReasoningSummary.php000064400000002167152665621660020057 0ustar00 */ final class OutputReasoningSummary implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'summary_text' $type */ private function __construct( public readonly string $text, public readonly string $type, ) {} /** * @param ReasoningSummaryType $attributes */ public static function from(array $attributes): self { return new self( text: $attributes['text'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'text' => $this->text, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputComputerToolCall.php000064400000011100152665621660017767 0ustar00, status: 'in_progress'|'completed'|'incomplete', type: 'computer_call'} * * @implements ResponseContract */ final class OutputComputerToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $pendingSafetyChecks * @param 'in_progress'|'completed'|'incomplete' $status * @param 'computer_call' $type */ private function __construct( public readonly Click|DoubleClick|Drag|KeyPress|Move|Screenshot|Scroll|Type|Wait $action, public readonly string $callId, public readonly string $id, public readonly array $pendingSafetyChecks, public readonly string $status, public readonly string $type, ) {} /** * @param OutputComputerToolCallType $attributes */ public static function from(array $attributes): self { $action = match ($attributes['action']['type']) { 'click' => Click::from($attributes['action']), 'double_click' => DoubleClick::from($attributes['action']), 'drag' => Drag::from($attributes['action']), 'keypress' => KeyPress::from($attributes['action']), 'move' => Move::from($attributes['action']), 'screenshot' => Screenshot::from($attributes['action']), 'scroll' => Scroll::from($attributes['action']), 'type' => Type::from($attributes['action']), 'wait' => Wait::from($attributes['action']), }; $pendingSafetyChecks = array_map( fn (array $safetyCheck): OutputComputerPendingSafetyCheck => OutputComputerPendingSafetyCheck::from($safetyCheck), $attributes['pending_safety_checks'] ); return new self( action: $action, callId: $attributes['call_id'], id: $attributes['id'], pendingSafetyChecks: $pendingSafetyChecks, status: $attributes['status'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'call_id' => $this->callId, 'id' => $this->id, 'action' => $this->action->toArray(), 'pending_safety_checks' => array_map( fn (OutputComputerPendingSafetyCheck $safetyCheck): array => $safetyCheck->toArray(), $this->pendingSafetyChecks, ), 'status' => $this->status, ]; } } src/Responses/Responses/Output/OutputMessage.php000064400000004612152665621660016135 0ustar00, id: string, role: 'assistant', status: 'in_progress'|'completed'|'incomplete', type: 'message'} * * @implements ResponseContract */ final class OutputMessage implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $content * @param 'assistant' $role * @param 'in_progress'|'completed'|'incomplete' $status * @param 'message' $type */ private function __construct( public readonly array $content, public readonly string $id, public readonly string $role, public readonly string $status, public readonly string $type, ) {} /** * @param OutputMessageType $attributes */ public static function from(array $attributes): self { $content = array_map( fn (array $item): OutputMessageContentOutputText|OutputMessageContentRefusal => match ($item['type']) { 'output_text' => OutputMessageContentOutputText::from($item), 'refusal' => OutputMessageContentRefusal::from($item), }, $attributes['content'], ); return new self( content: $content, id: $attributes['id'], role: $attributes['role'], status: $attributes['status'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'content' => array_map( fn (OutputMessageContentOutputText|OutputMessageContentRefusal $item): array => $item->toArray(), $this->content, ), 'id' => $this->id, 'role' => $this->role, 'status' => $this->status, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputFunctionToolCall.php000064400000003453152665621660017772 0ustar00 */ final class OutputFunctionToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'function_call' $type * @param 'in_progress'|'completed'|'incomplete' $status */ private function __construct( public readonly string $arguments, public readonly string $callId, public readonly string $name, public readonly string $type, public readonly string $id, public readonly string $status, ) {} /** * @param OutputFunctionToolCallType $attributes */ public static function from(array $attributes): self { return new self( arguments: $attributes['arguments'], callId: $attributes['call_id'], name: $attributes['name'], type: $attributes['type'], id: $attributes['id'], status: $attributes['status'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'arguments' => $this->arguments, 'call_id' => $this->callId, 'name' => $this->name, 'type' => $this->type, 'id' => $this->id, 'status' => $this->status, ]; } } src/Responses/Responses/Output/OutputFileSearchToolCallResult.php000064400000003243152665621660021406 0ustar00, file_id: string, filename: string, score: float, text: string} * * @implements ResponseContract */ final class OutputFileSearchToolCallResult implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $attributes */ private function __construct( public readonly array $attributes, public readonly string $fileId, public readonly string $filename, public readonly float $score, public readonly string $text, ) {} /** * @param OutputFileSearchToolCallResultType $attributes */ public static function from(array $attributes): self { return new self( attributes: $attributes['attributes'], fileId: $attributes['file_id'], filename: $attributes['filename'], score: $attributes['score'], text: $attributes['text'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'attributes' => $this->attributes, 'file_id' => $this->fileId, 'filename' => $this->filename, 'score' => $this->score, 'text' => $this->text, ]; } } src/Responses/Responses/Output/OutputMessageContentOutputTextAnnotationsContainerFile.php000064400000003514152665621660026437 0ustar00 */ final class OutputMessageContentOutputTextAnnotationsContainerFile implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'container_file_citation' $type */ private function __construct( public readonly string $fileId, public readonly string $type, public readonly ?string $text, public readonly ?int $startIndex, public readonly ?int $endIndex, ) {} /** * @param ContainerFileType $attributes */ public static function from(array $attributes): self { return new self( fileId: $attributes['file_id'], type: $attributes['type'], text: $attributes['text'] ?? null, startIndex: $attributes['start_index'] ?? null, endIndex: $attributes['end_index'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { $result = [ 'file_id' => $this->fileId, 'type' => $this->type, ]; if ($this->text !== null) { $result['text'] = $this->text; } if ($this->startIndex !== null) { $result['start_index'] = $this->startIndex; } if ($this->endIndex !== null) { $result['end_index'] = $this->endIndex; } return $result; } } src/Responses/Responses/Output/OutputReasoning.php000064400000004253152665621660016477 0ustar00, type: 'reasoning', encrypted_content: string|null, status?: 'in_progress'|'completed'|'incomplete'|null} * * @implements ResponseContract */ final class OutputReasoning implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $summary * @param 'reasoning' $type * @param 'in_progress'|'completed'|'incomplete'|null $status */ private function __construct( public readonly string $id, public readonly array $summary, public readonly string $type, public readonly ?string $encryptedContent, public readonly ?string $status, ) {} /** * @param OutputReasoningType $attributes */ public static function from(array $attributes): self { $summary = array_map( static fn (array $summary): OutputReasoningSummary => OutputReasoningSummary::from($summary), $attributes['summary'], ); return new self( id: $attributes['id'], summary: $summary, type: $attributes['type'], encryptedContent: $attributes['encrypted_content'] ?? null, status: $attributes['status'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'summary' => array_map( static fn (OutputReasoningSummary $summary): array => $summary->toArray(), $this->summary, ), 'type' => $this->type, 'encrypted_content' => $this->encryptedContent, 'status' => $this->status, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionMove.php000064400000002234152665621660023266 0ustar00 */ final class OutputComputerActionMove implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'move' $type */ private function __construct( public readonly string $type, public readonly int $x, public readonly int $y, ) {} /** * @param MoveType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], x: $attributes['x'], y: $attributes['y'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'x' => $this->x, 'y' => $this->y, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionScreenshot.php000064400000001764152665621660024504 0ustar00 */ final class OutputComputerActionScreenshot implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'screenshot' $type */ private function __construct( public readonly string $type, ) {} /** * @param ScreenshotType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionScroll.php000064400000002720152665621660023616 0ustar00 */ final class OutputComputerActionScroll implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'scroll' $type */ private function __construct( public readonly int $scrollX, public readonly int $scrollY, public readonly string $type, public readonly int $x, public readonly int $y, ) {} /** * @param ScrollType $attributes */ public static function from(array $attributes): self { return new self( scrollX: $attributes['scroll_x'], scrollY: $attributes['scroll_y'], type: $attributes['type'], x: $attributes['x'], y: $attributes['y'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'scroll_x' => $this->scrollX, 'scroll_y' => $this->scrollY, 'type' => $this->type, 'x' => $this->x, 'y' => $this->y, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionType.php000064400000002110152665621660023272 0ustar00 */ final class OutputComputerActionType implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'type' $type */ private function __construct( public readonly string $text, public readonly string $type, ) {} /** * @param TypeType $attributes */ public static function from(array $attributes): self { return new self( text: $attributes['text'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'text' => $this->text, 'type' => $this->type, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerPendingSafetyCheck.php000064400000002347152665621660024725 0ustar00 */ final class OutputComputerPendingSafetyCheck implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $code, public readonly string $id, public readonly string $message, ) {} /** * @param PendingSafetyCheckType $attributes */ public static function from(array $attributes): self { return new self( code: $attributes['code'], id: $attributes['id'], message: $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'id' => $this->id, 'message' => $this->message, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionWait.php000064400000001712152665621660023264 0ustar00 */ final class OutputComputerActionWait implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'wait' $type */ private function __construct( public readonly string $type, ) {} /** * @param WaitType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionDoubleClick.php000064400000002327152665621660024543 0ustar00 */ final class OutputComputerActionDoubleClick implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'double_click' $type */ private function __construct( public readonly string $type, public readonly float $x, public readonly float $y, ) {} /** * @param DoubleClickType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], x: $attributes['x'], y: $attributes['y'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'x' => $this->x, 'y' => $this->y, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionKeyPress.php000064400000002230152665621660024121 0ustar00, type: 'keypress'} * * @implements ResponseContract */ final class OutputComputerActionKeyPress implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $keys * @param 'keypress' $type */ private function __construct( public readonly array $keys, public readonly string $type, ) {} /** * @param KeyPressType $attributes */ public static function from(array $attributes): self { return new self( keys: $attributes['keys'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'keys' => $this->keys, 'type' => $this->type, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionDrag.php000064400000002765152665621660023246 0ustar00, type: 'drag'} * * @implements ResponseContract */ final class OutputComputerActionDrag implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $path * @param 'drag' $type */ private function __construct( public readonly array $path, public readonly string $type, ) {} /** * @param DragType $attributes */ public static function from(array $attributes): self { $paths = array_map( static fn (array $path): OutputComputerDragPath => OutputComputerDragPath::from($path), $attributes['path'], ); return new self( path: $paths, type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'path' => array_map( static fn (OutputComputerDragPath $path): array => $path->toArray(), $this->path, ), 'type' => $this->type, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerActionClick.php000064400000002624152665621660023410 0ustar00 */ final class OutputComputerActionClick implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'left'|'right'|'wheel'|'back'|'forward' $button * @param 'click' $type */ private function __construct( public readonly string $button, public readonly string $type, public readonly int $x, public readonly int $y, ) {} /** * @param ClickType $attributes */ public static function from(array $attributes): self { return new self( button: $attributes['button'], type: $attributes['type'], x: $attributes['x'], y: $attributes['y'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'button' => $this->button, 'type' => $this->type, 'x' => $this->x, 'y' => $this->y, ]; } } src/Responses/Responses/Output/ComputerAction/OutputComputerDragPath.php000064400000001771152665621660022721 0ustar00 */ final class OutputComputerDragPath implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly int $x, public readonly int $y, ) {} /** * @param DragPathType $attributes */ public static function from(array $attributes): self { return new self( x: $attributes['x'], y: $attributes['y'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'x' => $this->x, 'y' => $this->y, ]; } } src/Responses/Responses/Output/OutputCodeInterpreterToolCall.php000064400000005344152665621660021304 0ustar00|null * @phpstan-type OutputCodeInterpreterToolCallType array{code: string, id: string, outputs: OutputType, status: string, type: 'code_interpreter_call', container_id: string} * * @implements ResponseContract */ final class OutputCodeInterpreterToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array|null $outputs * @param 'code_interpreter_call' $type */ private function __construct( public readonly string $code, public readonly string $id, public readonly ?array $outputs, public readonly string $status, public readonly string $type, public readonly string $containerId, ) {} /** * @param OutputCodeInterpreterToolCallType $attributes */ public static function from(array $attributes): self { $outputs = null; if (is_array($attributes['outputs'])) { $outputs = array_map( static fn (array $output): CodeFileOutput|CodeTextOutput => match ($output['type']) { 'files' => CodeFileOutput::from($output), 'logs' => CodeTextOutput::from($output), }, $attributes['outputs'] ); } return new self( code: $attributes['code'], id: $attributes['id'], outputs: $outputs, status: $attributes['status'], type: $attributes['type'], containerId: $attributes['container_id'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'code' => $this->code, 'id' => $this->id, 'outputs' => $this->outputs ? array_map(static fn (CodeFileOutput|CodeTextOutput $output): array => $output->toArray(), $this->outputs) : null, 'status' => $this->status, 'type' => $this->type, 'container_id' => $this->containerId, ]; } } src/Responses/Responses/Output/OutputMessageContentOutputText.php000064400000006105152665621660021555 0ustar00, text: string, type: 'output_text'} * * @implements ResponseContract */ final class OutputMessageContentOutputText implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $annotations * @param 'output_text' $type */ private function __construct( public readonly array $annotations, public readonly string $text, public readonly string $type ) {} /** * @param OutputTextType $attributes */ public static function from(array $attributes): self { $annotations = array_map( fn (array $annotation): AnnotationFileCitation|AnnotationFilePath|AnnotationUrlCitation|AnnotationContainerFile => match ($annotation['type']) { 'file_citation' => AnnotationFileCitation::from($annotation), 'file_path' => AnnotationFilePath::from($annotation), 'url_citation' => AnnotationUrlCitation::from($annotation), 'container_file_citation' => AnnotationContainerFile::from($annotation), }, $attributes['annotations'], ); return new self( annotations: $annotations, text: $attributes['text'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'annotations' => array_map( fn (AnnotationContainerFile|AnnotationFileCitation|AnnotationFilePath|AnnotationUrlCitation $annotation): array => $annotation->toArray(), $this->annotations, ), 'text' => $this->text, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputMcpApprovalRequest.php000064400000003177152665621660020353 0ustar00 */ final class OutputMcpApprovalRequest implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'mcp_approval_request' $type */ private function __construct( public readonly string $id, public readonly string $serverLabel, public readonly string $name, public readonly string $arguments, public readonly string $type, ) {} /** * @param OutputMcpApprovalRequestType $attributes */ public static function from(array $attributes): self { return new self( id: $attributes['id'], serverLabel: $attributes['server_label'], name: $attributes['name'], arguments: $attributes['arguments'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'server_label' => $this->serverLabel, 'type' => $this->type, 'arguments' => $this->arguments, 'name' => $this->name, ]; } } src/Responses/Responses/Output/CodeInterpreter/CodeTextOutput.php000064400000002147152665621660021367 0ustar00 */ final class CodeTextOutput implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'logs' $type */ private function __construct( public readonly string $logs, public readonly string $type, ) {} /** * @param CodeTextOutputType $attributes */ public static function from(array $attributes): self { return new self( logs: $attributes['logs'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'logs' => $this->logs, ]; } } src/Responses/Responses/Output/CodeInterpreter/CodeFileOutput.php000064400000003000152665621660021307 0ustar00, type: 'files'} * * @implements ResponseContract */ final class CodeFileOutput implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $files * @param 'files' $type */ private function __construct( public readonly array $files, public readonly string $type, ) {} /** * @param CodeFileOutputType $attributes */ public static function from(array $attributes): self { $files = array_map( static fn (array $file): CodeFileObject => CodeFileObject::from($file), $attributes['files'] ); return new self( files: $files, type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'files' => array_map( static fn (CodeFileObject $file): array => $file->toArray(), $this->files ), ]; } } src/Responses/Responses/Output/CodeInterpreter/CodeFileObject.php000064400000002146152665621660021227 0ustar00 */ final class CodeFileObject implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; private function __construct( public readonly string $fileId, public readonly string $mimeType, ) {} /** * @param CodeFileObjectType $attributes */ public static function from(array $attributes): self { return new self( fileId: $attributes['file_id'], mimeType: $attributes['mime_type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, 'mime_type' => $this->mimeType, ]; } } src/Responses/Responses/Output/OutputMessageContentOutputTextAnnotationsFileCitation.php000064400000002554152665621660026272 0ustar00 */ final class OutputMessageContentOutputTextAnnotationsFileCitation implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'file_citation' $type */ private function __construct( public readonly string $fileId, public readonly int $index, public readonly string $type, ) {} /** * @param array{file_id: string, index: int, type: 'file_citation'} $attributes */ public static function from(array $attributes): self { return new self( fileId: $attributes['file_id'], index: $attributes['index'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, 'index' => $this->index, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputMessageContentOutputTextAnnotationsFilePath.php000064400000002376152665621660025416 0ustar00 */ final class OutputMessageContentOutputTextAnnotationsFilePath implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'file_path' $type */ private function __construct( public readonly string $fileId, public readonly int $index, public readonly string $type, ) {} /** * @param FilePathType $attributes */ public static function from(array $attributes): self { return new self( fileId: $attributes['file_id'], index: $attributes['index'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'file_id' => $this->fileId, 'index' => $this->index, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputFileSearchToolCall.php000064400000004535152665621660020214 0ustar00, status: 'in_progress'|'searching'|'incomplete'|'failed', type: 'file_search_call', results: ?array} * * @implements ResponseContract */ final class OutputFileSearchToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $queries * @param 'in_progress'|'searching'|'incomplete'|'failed' $status * @param 'file_search_call' $type * @param ?array $results */ private function __construct( public readonly string $id, public readonly array $queries, public readonly string $status, public readonly string $type, public readonly ?array $results = null, ) {} /** * @param OutputFileSearchToolCallType $attributes */ public static function from(array $attributes): self { $results = isset($attributes['results']) ? array_map( fn (array $result): OutputFileSearchToolCallResult => OutputFileSearchToolCallResult::from($result), $attributes['results'] ) : null; return new self( id: $attributes['id'], queries: $attributes['queries'], status: $attributes['status'], type: $attributes['type'], results: $results, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'queries' => $this->queries, 'status' => $this->status, 'type' => $this->type, 'results' => isset($this->results) ? array_map( fn (OutputFileSearchToolCallResult $result) => $result->toArray(), $this->results ) : null, ]; } } src/Responses/Responses/Output/OutputImageGenerationToolCall.php000064400000002741152665621660021242 0ustar00 */ final class OutputImageGenerationToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'image_generation_call' $type */ private function __construct( public readonly string $id, public readonly ?string $result, public readonly string $status, public readonly string $type, ) {} /** * @param OutputImageGenerationToolCallType $attributes */ public static function from(array $attributes): self { return new self( id: $attributes['id'], result: $attributes['result'] ?? null, status: $attributes['status'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'result' => $this->result, 'status' => $this->status, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputMessageContentRefusal.php000064400000002177152665621660021016 0ustar00 */ final class OutputMessageContentRefusal implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'refusal' $type */ private function __construct( public readonly string $refusal, public readonly string $type, ) {} /** * @param ContentRefusalType $attributes */ public static function from(array $attributes): self { return new self( refusal: $attributes['refusal'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'refusal' => $this->refusal, 'type' => $this->type, ]; } } src/Responses/Responses/Output/OutputMcpListTools.php000064400000003562152665621660017150 0ustar00} * * @implements ResponseContract */ final class OutputMcpListTools implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'mcp_list_tools' $type * @param array $tools */ private function __construct( public readonly string $id, public readonly string $serverLabel, public readonly string $type, public readonly array $tools, ) {} /** * @param OutputMcpListToolsType $attributes */ public static function from(array $attributes): self { $tools = array_map( fn (array $result): OutputMcpListToolsTool => OutputMcpListToolsTool::from($result), $attributes['tools'] ); return new self( id: $attributes['id'], serverLabel: $attributes['server_label'], type: $attributes['type'], tools: $tools, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'server_label' => $this->serverLabel, 'type' => $this->type, 'tools' => array_map( fn (OutputMcpListToolsTool $tool) => $tool->toArray(), $this->tools ), ]; } } src/Responses/Responses/Output/OutputMcpCall.php000064400000004151152665621660016062 0ustar00 */ final class OutputMcpCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'mcp_call' $type */ private function __construct( public readonly string $id, public readonly string $serverLabel, public readonly string $type, public readonly string $arguments, public readonly string $name, public readonly ?string $approvalRequestId = null, public readonly ?string $error = null, public readonly ?string $output = null, ) {} /** * @param OutputMcpCallType $attributes */ public static function from(array $attributes): self { return new self( id: $attributes['id'], serverLabel: $attributes['server_label'], type: $attributes['type'], arguments: $attributes['arguments'], name: $attributes['name'], approvalRequestId: $attributes['approval_request_id'], error: $attributes['error'], output: $attributes['output'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'server_label' => $this->serverLabel, 'type' => $this->type, 'arguments' => $this->arguments, 'name' => $this->name, 'approval_request_id' => $this->approvalRequestId, 'error' => $this->error, 'output' => $this->output, ]; } } src/Responses/Responses/Output/OutputMcpListToolsTool.php000064400000003226152665621660020003 0ustar00|null, description: ?string, input_schema: array, name: string} * * @implements ResponseContract */ final class OutputMcpListToolsTool implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $inputSchema * @param array|null $annotations */ private function __construct( public readonly string $name, public readonly array $inputSchema, public readonly ?string $description = null, public readonly ?array $annotations = null, ) {} /** * @param OutputMcpListToolsToolType $attributes */ public static function from(array $attributes): self { return new self( name: $attributes['name'], inputSchema: $attributes['input_schema'], description: $attributes['description'] ?? null, annotations: $attributes['annotations'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'input_schema' => $this->inputSchema, 'description' => $this->description, 'annotations' => $this->annotations, ]; } } src/Responses/Responses/Output/OutputMessageContentOutputTextAnnotationsUrlCitation.php000064400000003110152665621660026142 0ustar00 */ final class OutputMessageContentOutputTextAnnotationsUrlCitation implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'url_citation' $type */ private function __construct( public readonly int $endIndex, public readonly int $startIndex, public readonly string $title, public readonly string $type, public readonly string $url, ) {} /** * @param UrlCitationType $attributes */ public static function from(array $attributes): self { return new self( endIndex: $attributes['end_index'], startIndex: $attributes['start_index'], title: $attributes['title'], type: $attributes['type'], url: $attributes['url'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'end_index' => $this->endIndex, 'start_index' => $this->startIndex, 'title' => $this->title, 'type' => $this->type, 'url' => $this->url, ]; } } src/Responses/Responses/Output/OutputWebSearchToolCall.php000064400000002436152665621660020050 0ustar00 */ final class OutputWebSearchToolCall implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'web_search_call' $type */ private function __construct( public readonly string $id, public readonly string $status, public readonly string $type, ) {} /** * @param OutputWebSearchToolCallType $attributes */ public static function from(array $attributes): self { return new self( id: $attributes['id'], status: $attributes['status'], type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'status' => $this->status, 'type' => $this->type, ]; } } src/Responses/Responses/Format/JsonSchemaFormat.php000064400000003224152665621660016461 0ustar00, type: 'json_schema', description: ?string, strict: ?bool} * * @implements ResponseContract */ final class JsonSchemaFormat implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param array $schema * @param 'json_schema' $type */ private function __construct( public readonly string $name, public readonly array $schema, public readonly string $type, public readonly ?string $description, public readonly ?bool $strict = null, ) {} /** * @param JsonSchemaFormatType $attributes */ public static function from(array $attributes): self { return new self( name: $attributes['name'], schema: $attributes['schema'], type: $attributes['type'], description: $attributes['description'] ?? null, strict: $attributes['strict'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'name' => $this->name, 'schema' => $this->schema, 'type' => $this->type, 'description' => $this->description, 'strict' => $this->strict, ]; } } src/Responses/Responses/Format/TextFormat.php000064400000001705152665621660015355 0ustar00 */ final class TextFormat implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'text' $type */ private function __construct( public readonly string $type, ) {} /** * @param TextFormatType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Responses/Format/JsonObjectFormat.php000064400000001761152665621660016473 0ustar00 */ final class JsonObjectFormat implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; /** * @param 'json_object' $type */ private function __construct( public readonly string $type, ) {} /** * @param JsonObjectFormatType $attributes */ public static function from(array $attributes): self { return new self( type: $attributes['type'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, ]; } } src/Responses/Files/ListResponse.php000064400000004340152665621660013541 0ustar00|string|null}>}> */ final class ListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible|string|null}>}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array|string|null}>} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): RetrieveResponse => RetrieveResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (RetrieveResponse $response): array => $response->toArray(), $this->data, ), ]; } } src/Responses/Files/DeleteResponse.php000064400000003031152665621660014024 0ustar00 */ final class DeleteResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible */ use ArrayAccessible; use Fakeable; use HasMetaInformation; private function __construct( public readonly string $id, public readonly string $object, public readonly bool $deleted, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, deleted: bool} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['deleted'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'deleted' => $this->deleted, ]; } } src/Responses/Files/RetrieveResponse.php000064400000005166152665621660014422 0ustar00|string|null}> */ final class RetrieveResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible|string|null}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array|null $statusDetails */ private function __construct( public readonly string $id, public readonly string $object, public readonly ?int $bytes, public readonly int $createdAt, public readonly string $filename, public readonly string $purpose, public readonly string $status, public readonly array|string|null $statusDetails, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, bytes: ?int, filename: string, purpose: string, status: string, status_details: array|string|null} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['bytes'], $attributes['created_at'], $attributes['filename'], $attributes['purpose'], $attributes['status'], $attributes['status_details'] ?? null, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'bytes' => $this->bytes, 'created_at' => $this->createdAt, 'filename' => $this->filename, 'purpose' => $this->purpose, 'status' => $this->status, 'status_details' => $this->statusDetails, ]; } } src/Responses/Files/CreateResponse.php000064400000005160152665621660014032 0ustar00|string|null}> */ final class CreateResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible|string|null}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array|null $statusDetails */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $bytes, public readonly int $createdAt, public readonly string $filename, public readonly string $purpose, public readonly string $status, public readonly array|string|null $statusDetails, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, bytes: int, filename: string, purpose: string, status: string, status_details: array|string|null} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { return new self( $attributes['id'], $attributes['object'], $attributes['bytes'], $attributes['created_at'], $attributes['filename'], $attributes['purpose'], $attributes['status'], $attributes['status_details'] ?? null, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'bytes' => $this->bytes, 'created_at' => $this->createdAt, 'filename' => $this->filename, 'purpose' => $this->purpose, 'status' => $this->status, 'status_details' => $this->statusDetails, ]; } } src/Responses/FineTunes/ListResponse.php000064400000010777152665621660014412 0ustar00, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}>}> */ final class ListResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}>}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}>} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): RetrieveResponse => RetrieveResponse::from( $result, $meta, ), $attributes['data']); return new self( $attributes['object'], $data, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (RetrieveResponse $response): array => $response->toArray(), $this->data, ), ]; } } src/Responses/FineTunes/RetrieveStreamedResponseEvent.php000064400000002765152665621660017751 0ustar00 */ final class RetrieveStreamedResponseEvent implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; use FakeableForStreamedResponse; private function __construct( public readonly string $object, public readonly int $createdAt, public readonly string $level, public readonly string $message, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, created_at: int, level: string, message: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['object'], $attributes['created_at'], $attributes['level'], $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'created_at' => $this->createdAt, 'level' => $this->level, 'message' => $this->message, ]; } } src/Responses/FineTunes/RetrieveResponse.php000064400000015660152665621660015260 0ustar00, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}> */ final class RetrieveResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $events * @param array $resultFiles * @param array $validationFiles * @param array $trainingFiles */ private function __construct( public readonly string $id, public readonly string $object, public readonly string $model, public readonly int $createdAt, public readonly array $events, public readonly ?string $fineTunedModel, public readonly RetrieveResponseHyperparams $hyperparams, public readonly string $organizationId, public readonly array $resultFiles, public readonly string $status, public readonly array $validationFiles, public readonly array $trainingFiles, public readonly int $updatedAt, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, model: string, created_at: int, events?: array, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $events = array_map(fn (array $result): RetrieveResponseEvent => RetrieveResponseEvent::from( $result ), $attributes['events'] ?? []); $resultFiles = array_map(fn (array $result): RetrieveResponseFile => RetrieveResponseFile::from( $result ), $attributes['result_files']); $validationFiles = array_map(fn (array $result): RetrieveResponseFile => RetrieveResponseFile::from( $result ), $attributes['validation_files']); $trainingFiles = array_map(fn (array $result): RetrieveResponseFile => RetrieveResponseFile::from( $result ), $attributes['training_files']); return new self( $attributes['id'], $attributes['object'], $attributes['model'], $attributes['created_at'], $events, $attributes['fine_tuned_model'], RetrieveResponseHyperparams::from($attributes['hyperparams']), $attributes['organization_id'], $resultFiles, $attributes['status'], $validationFiles, $trainingFiles, $attributes['updated_at'], $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'model' => $this->model, 'created_at' => $this->createdAt, 'events' => array_map( static fn (RetrieveResponseEvent $result): array => $result->toArray(), $this->events ), 'fine_tuned_model' => $this->fineTunedModel, 'hyperparams' => $this->hyperparams->toArray(), 'organization_id' => $this->organizationId, 'result_files' => array_map( static fn (RetrieveResponseFile $result): array => $result->toArray(), $this->resultFiles ), 'status' => $this->status, 'validation_files' => array_map( static fn (RetrieveResponseFile $result): array => $result->toArray(), $this->validationFiles ), 'training_files' => array_map( static fn (RetrieveResponseFile $result): array => $result->toArray(), $this->trainingFiles ), 'updated_at' => $this->updatedAt, ]; } } src/Responses/FineTunes/RetrieveResponseHyperparams.php000064400000003154152665621660017467 0ustar00 */ final class RetrieveResponseHyperparams implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly ?int $batchSize, public readonly ?float $learningRateMultiplier, public readonly int $nEpochs, public readonly float $promptLossWeight, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float} $attributes */ public static function from(array $attributes): self { return new self( $attributes['batch_size'], $attributes['learning_rate_multiplier'], $attributes['n_epochs'], $attributes['prompt_loss_weight'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'batch_size' => $this->batchSize, 'learning_rate_multiplier' => $this->learningRateMultiplier, 'n_epochs' => $this->nEpochs, 'prompt_loss_weight' => $this->promptLossWeight, ]; } } src/Responses/FineTunes/RetrieveResponseEvent.php000064400000002604152665621660016254 0ustar00 */ final class RetrieveResponseEvent implements ResponseContract { /** * @use ArrayAccessible */ use ArrayAccessible; private function __construct( public readonly string $object, public readonly int $createdAt, public readonly string $level, public readonly string $message, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, created_at: int, level: string, message: string} $attributes */ public static function from(array $attributes): self { return new self( $attributes['object'], $attributes['created_at'], $attributes['level'], $attributes['message'], ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'created_at' => $this->createdAt, 'level' => $this->level, 'message' => $this->message, ]; } } src/Responses/FineTunes/RetrieveResponseFile.php000064400000004407152665621660016055 0ustar00|string|null}> */ final class RetrieveResponseFile implements ResponseContract { /** * @use ArrayAccessible|string|null}> */ use ArrayAccessible; /** * @param array|null $statusDetails */ private function __construct( public readonly string $id, public readonly string $object, public readonly int $bytes, public readonly int $createdAt, public readonly string $filename, public readonly string $purpose, public readonly string $status, public readonly array|string|null $statusDetails, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{id: string, object: string, created_at: int, bytes: int, filename: string, purpose: string, status: string, status_details: array|string|null} $attributes */ public static function from(array $attributes): self { return new self( $attributes['id'], $attributes['object'], $attributes['bytes'], $attributes['created_at'], $attributes['filename'], $attributes['purpose'], $attributes['status'], $attributes['status_details'] ?? null, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'id' => $this->id, 'object' => $this->object, 'bytes' => $this->bytes, 'created_at' => $this->createdAt, 'filename' => $this->filename, 'purpose' => $this->purpose, 'status' => $this->status, 'status_details' => $this->statusDetails, ]; } } src/Responses/FineTunes/ListEventsResponse.php000064400000003707152665621660015572 0ustar00}> */ final class ListEventsResponse implements ResponseContract, ResponseHasMetaInformationContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; use HasMetaInformation; /** * @param array $data */ private function __construct( public readonly string $object, public readonly array $data, private readonly MetaInformation $meta, ) {} /** * Acts as static factory, and returns a new Response instance. * * @param array{object: string, data: array} $attributes */ public static function from(array $attributes, MetaInformation $meta): self { $data = array_map(fn (array $result): RetrieveResponseEvent => RetrieveResponseEvent::from( $result ), $attributes['data']); return new self( $attributes['object'], $data, $meta, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'object' => $this->object, 'data' => array_map( static fn (RetrieveResponseEvent $response): array => $response->toArray(), $this->data, ), ]; } } src/Resources/FineTuning.php000064400000012275152665621660012112 0ustar00 $parameters */ public function createJob(array $parameters): RetrieveJobResponse { $payload = Payload::create('fine_tuning/jobs', $parameters); /** @var Response, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveJobResponse::from($response->data(), $response->meta()); } /** * List your organization's fine-tuning jobs. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/undefined * * @param array $parameters */ public function listJobs(array $parameters = []): ListJobsResponse { $payload = Payload::list('fine_tuning/jobs', $parameters); /** @var Response, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}>, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return ListJobsResponse::from($response->data(), $response->meta()); } /** * Gets info about the fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/retrieve */ public function retrieveJob(string $jobId): RetrieveJobResponse { $payload = Payload::retrieve('fine_tuning/jobs', $jobId); /** @var Response, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveJobResponse::from($response->data(), $response->meta()); } /** * Immediately cancel a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/cancel */ public function cancelJob(string $jobId): RetrieveJobResponse { $payload = Payload::cancel('fine_tuning/jobs', $jobId); /** @var Response, status: string, validation_file: ?string, training_file: string, trained_tokens: ?int, error: ?array{code: string, param: ?string, message: string}}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveJobResponse::from($response->data(), $response->meta()); } /** * Get status updates for a fine-tuning job. * * @see https://platform.openai.com/docs/api-reference/fine-tuning/list-events * * @param array $parameters */ public function listJobEvents(string $jobId, array $parameters = []): ListJobEventsResponse { $payload = Payload::retrieve('fine_tuning/jobs', $jobId, '/events', $parameters); /** @var Response, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return ListJobEventsResponse::from($response->data(), $response->meta()); } } src/Resources/Assistants.php000064400000012673152665621660012202 0ustar00 $parameters */ public function create(array $parameters): AssistantResponse { $payload = Payload::create('assistants', $parameters); /** @var Response}}>, tool_resources: array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return AssistantResponse::from($response->data(), $response->meta()); } /** * Retrieves an assistant. * * @see https://platform.openai.com/docs/api-reference/assistants/getAssistant */ public function retrieve(string $id): AssistantResponse { $payload = Payload::retrieve('assistants', $id); /** @var Response}}>, tool_resources: array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return AssistantResponse::from($response->data(), $response->meta()); } /** * Modifies an assistant. * * @see https://platform.openai.com/docs/api-reference/assistants/modifyAssistant * * @param array $parameters */ public function modify(string $id, array $parameters): AssistantResponse { $payload = Payload::modify('assistants', $id, $parameters); /** @var Response}}>, tool_resources: array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return AssistantResponse::from($response->data(), $response->meta()); } /** * Delete an assistant. * * @see https://platform.openai.com/docs/api-reference/assistants/deleteAssistant */ public function delete(string $id): AssistantDeleteResponse { $payload = Payload::delete('assistants', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return AssistantDeleteResponse::from($response->data(), $response->meta()); } /** * Returns a list of assistants. * * @see https://platform.openai.com/docs/api-reference/assistants/listAssistants * * @param array $parameters */ public function list(array $parameters = []): AssistantListResponse { $payload = Payload::list('assistants', $parameters); /** @var Response}}>, tool_resources: array{code_interpreter?: array{file_ids: array}, file_search?: array{vector_store_ids: array}}, metadata: array, temperature: ?float, top_p: ?float, response_format: string|array{type: 'text'|'json_object'}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return AssistantListResponse::from($response->data(), $response->meta()); } } src/Resources/Batches.php000064400000011030152665621660011401 0ustar00 $parameters */ public function create(array $parameters): BatchResponse { $payload = Payload::create('batches', $parameters); /** @var Response}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts?: array{total: int, completed: int, failed: int}, metadata: ?array}> $response */ $response = $this->transporter->requestObject($payload); return BatchResponse::from($response->data(), $response->meta()); } /** * Retrieves a batch. * * * @see https://platform.openai.com/docs/api-reference/batch/retrieve */ public function retrieve(string $id): BatchResponse { $payload = Payload::retrieve('batches', $id); /** @var Response}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts?: array{total: int, completed: int, failed: int}, metadata: ?array}> $response */ $response = $this->transporter->requestObject($payload); return BatchResponse::from($response->data(), $response->meta()); } /** * Cancels an in-progress batch. * * * @see https://platform.openai.com/docs/api-reference/batch/cancel */ public function cancel(string $id): BatchResponse { $payload = Payload::cancel('batches', $id); /** @var Response}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts?: array{total: int, completed: int, failed: int}, metadata: ?array}> $response */ $response = $this->transporter->requestObject($payload); return BatchResponse::from($response->data(), $response->meta()); } /** * List your organization's batches. * * @see https://platform.openai.com/docs/api-reference/batch/list * * @param array $parameters */ public function list(array $parameters = []): BatchListResponse { $payload = Payload::list('batches', $parameters); /** @var Response}, input_file_id: string, completion_window: string, status: string, output_file_id: ?string, error_file_id: ?string, created_at: int, in_progress_at: ?int, expires_at: ?int, finalizing_at: ?int, completed_at: ?int, failed_at: ?int, expired_at: ?int, cancelling_at: ?int, cancelled_at: ?int, request_counts?: array{total: int, completed: int, failed: int}, metadata: ?array}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return BatchListResponse::from($response->data(), $response->meta()); } } src/Resources/Chat.php000064400000004220152665621660010712 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $this->ensureNotStreamed($parameters); $payload = Payload::create('chat/completions', $parameters); /** @var Response}, logprobs: ?array{content: ?array}>}, finish_reason: string|null}>, usage: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } /** * Creates a streamed completion for the chat message * * @see https://platform.openai.com/docs/api-reference/chat/create * * @param array $parameters * * @return StreamResponse */ 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); } } src/Resources/Completions.php000064400000004067152665621660012340 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $this->ensureNotStreamed($parameters); $payload = Payload::create('completions', $parameters); /** @var Response, token_logprobs: array, top_logprobs: array|null, text_offset: array}|null, finish_reason: string}>, usage: array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } /** * Creates a streamed completion for the provided prompt and parameters * * @see https://platform.openai.com/docs/api-reference/completions/create-completion * * @param array $parameters * * @return StreamResponse */ public function createStreamed(array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::create('completions', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(CreateStreamedResponse::class, $response); } } src/Resources/ThreadsRuns.php000064400000030203152665621660012275 0ustar00 $parameters */ public function create(string $threadId, array $parameters): ThreadRunResponse { $payload = Payload::create('threads/' . $threadId . '/runs', $parameters); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunResponse::from($response->data(), $response->meta()); } /** * Creates a streamed run * * @see https://platform.openai.com/docs/api-reference/runs/createRun * * @param array $parameters * * @return StreamResponse */ public function createStreamed(string $threadId, array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::create('threads/' . $threadId . '/runs', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(ThreadRunStreamResponse::class, $response); } /** * Retrieves a run. * * @see https://platform.openai.com/docs/api-reference/runs/getRun */ public function retrieve(string $threadId, string $runId): ThreadRunResponse { $payload = Payload::retrieve('threads/' . $threadId . '/runs', $runId); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunResponse::from($response->data(), $response->meta()); } /** * Modifies a run. * * @see https://platform.openai.com/docs/api-reference/runs/modifyRun * * @param array $parameters */ public function modify(string $threadId, string $runId, array $parameters): ThreadRunResponse { $payload = Payload::modify('threads/' . $threadId . '/runs', $runId, $parameters); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunResponse::from($response->data(), $response->meta()); } /** * This endpoint can be used to submit the outputs from the tool calls once they're all completed. * * @see https://platform.openai.com/docs/api-reference/runs/submitToolOutputs * * @param array $parameters */ public function submitToolOutputs(string $threadId, string $runId, array $parameters): ThreadRunResponse { $payload = Payload::create('threads/' . $threadId . '/runs/' . $runId . '/submit_tool_outputs', $parameters); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunResponse::from($response->data(), $response->meta()); } /** * This endpoint can be used to submit the outputs from the tool calls once they're all completed. * And stream back the response * * @see https://platform.openai.com/docs/api-reference/runs/submitToolOutputs * * @param array $parameters * * @return StreamResponse */ public function submitToolOutputsStreamed(string $threadId, string $runId, array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::create('threads/' . $threadId . '/runs/' . $runId . '/submit_tool_outputs', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(ThreadRunStreamResponse::class, $response); } /** * Cancels a run that is `in_progress`. * * @see https://platform.openai.com/docs/api-reference/runs/cancelRun */ public function cancel(string $threadId, string $runId): ThreadRunResponse { $payload = Payload::cancel('threads/' . $threadId . '/runs', $runId); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunResponse::from($response->data(), $response->meta()); } /** * Returns a list of runs belonging to a thread. * * @see https://platform.openai.com/docs/api-reference/runs/listRuns * * @param array $parameters */ public function list(string $threadId, array $parameters = []): ThreadRunListResponse { $payload = Payload::list('threads/' . $threadId . '/runs', $parameters); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunListResponse::from($response->data(), $response->meta()); } /** * Get steps attached to a run. * * @see https://platform.openai.com/docs/api-reference/runs/step-object */ public function steps(): ThreadsRunsStepsContract { return new ThreadsRunsSteps($this->transporter); } } src/Resources/Containers.php000064400000005430152665621660012144 0ustar00 $parameters */ public function create(array $parameters): CreateContainer { $payload = Payload::create('containers', $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return CreateContainer::from($response->data(), $response->meta()); } /** * Retrieves a container with the given ID. * * @see https://platform.openai.com/docs/api-reference/containers/retrieveContainer */ public function retrieve(string $id): RetrieveContainer { $payload = Payload::retrieve('containers', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return RetrieveContainer::from($response->data(), $response->meta()); } /** * Delete a container with the given ID. * * @see https://platform.openai.com/docs/api-reference/containers/deleteContainer */ public function delete(string $id): DeleteContainer { $payload = Payload::delete('containers', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return DeleteContainer::from($response->data(), $response->meta()); } /** * List containers * * @see https://platform.openai.com/docs/api-reference/containers/listContainers * * @param array $parameters */ public function list(array $parameters = []): ListContainers { $payload = Payload::list('containers', $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return ListContainers::from($response->data(), $response->meta()); } } src/Resources/Embeddings.php000064400000002037152665621660012100 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $payload = Payload::create('embeddings', $parameters); /** @var Response, index: int}>, usage: array{prompt_tokens: int, total_tokens: int}}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } } src/Resources/FineTunes.php000064400000016657152665621660011754 0ustar00 $parameters */ public function create(array $parameters): RetrieveResponse { $payload = Payload::create('fine-tunes', $parameters); /** @var Response, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * List your organization's fine-tuning jobs. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/list */ public function list(): ListResponse { $payload = Payload::list('fine-tunes'); /** @var Response, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}>}> $response */ $response = $this->transporter->requestObject($payload); return ListResponse::from($response->data(), $response->meta()); } /** * Gets info about the fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/list */ public function retrieve(string $fineTuneId): RetrieveResponse { $payload = Payload::retrieve('fine-tunes', $fineTuneId); /** @var Response, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * Immediately cancel a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/cancel */ public function cancel(string $fineTuneId): RetrieveResponse { $payload = Payload::cancel('fine-tunes', $fineTuneId); /** @var Response, fine_tuned_model: ?string, hyperparams: array{batch_size: ?int, learning_rate_multiplier: ?float, n_epochs: int, prompt_loss_weight: float}, organization_id: string, result_files: array|string|null}>, status: string, validation_files: array|string|null}>, training_files: array|string|null}>, updated_at: int}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * Get fine-grained status updates for a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/events */ public function listEvents(string $fineTuneId): ListEventsResponse { $payload = Payload::retrieve('fine-tunes', $fineTuneId, '/events'); /** @var Response}> $response */ $response = $this->transporter->requestObject($payload); return ListEventsResponse::from($response->data(), $response->meta()); } /** * Get streamed fine-grained status updates for a fine-tune job. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/events * * @return StreamResponse */ public function listEventsStreamed(string $fineTuneId): StreamResponse { $payload = Payload::retrieve('fine-tunes', $fineTuneId, '/events?stream=true'); $response = $this->transporter->requestStream($payload); return new StreamResponse(RetrieveStreamedResponseEvent::class, $response); } } src/Resources/Threads.php000064400000013726152665621660011440 0ustar00 $parameters */ public function create(array $parameters = []): ThreadResponse { $payload = Payload::create('threads', $parameters); /** @var Response}, file_search?: array{vector_store_ids: array}}, metadata: array}> $response */ $response = $this->transporter->requestObject($payload); return ThreadResponse::from($response->data(), $response->meta()); } /** * Create a thread and run it in one request. * * @see https://platform.openai.com/docs/api-reference/runs/createThreadAndRun * * @param array $parameters */ public function createAndRun(array $parameters): ThreadRunResponse { $payload = Payload::create('threads/runs', $parameters); /** @var Response}}, last_error: ?array{code: string, message: string}, expires_at: ?int, started_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, model: string, instructions: ?string, tools: array}}>, metadata: array, usage?: array{prompt_tokens: int, completion_tokens: int|null, total_tokens: int}, incomplete_details: ?array{reason: string}, temperature: float|int|null, top_p: null|float|int, max_prompt_tokens: ?int, max_completion_tokens: ?int, truncation_strategy: array{type: string, last_messages: ?int}, tool_choice: string|array{type: string, function?: array{name: string}}, response_format: string|array{type: 'text'|'json_object'}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunResponse::from($response->data(), $response->meta()); } /** * Create a thread and run it in one request, returning a stream. * * @see https://platform.openai.com/docs/api-reference/runs/createThreadAndRun * * @param array $parameters * * @return StreamResponse */ public function createAndRunStreamed(array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::create('threads/runs', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(ThreadRunStreamResponse::class, $response); } /** * Retrieves a thread. * * @see https://platform.openai.com/docs/api-reference/threads/getThread */ public function retrieve(string $id): ThreadResponse { $payload = Payload::retrieve('threads', $id); /** @var Response}, file_search?: array{vector_store_ids: array}}, metadata: array}> $response */ $response = $this->transporter->requestObject($payload); return ThreadResponse::from($response->data(), $response->meta()); } /** * Modifies a thread. * * @see https://platform.openai.com/docs/api-reference/threads/modifyThread * * @param array $parameters */ public function modify(string $id, array $parameters): ThreadResponse { $payload = Payload::modify('threads', $id, $parameters); /** @var Response}, file_search?: array{vector_store_ids: array}}, metadata: array}> $response */ $response = $this->transporter->requestObject($payload); return ThreadResponse::from($response->data(), $response->meta()); } /** * Delete a thread. * * @see https://platform.openai.com/docs/api-reference/threads/deleteThread */ public function delete(string $id): ThreadDeleteResponse { $payload = Payload::delete('threads', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return ThreadDeleteResponse::from($response->data(), $response->meta()); } /** * Manage messages attached to a thread. * * @see https://platform.openai.com/docs/api-reference/messages */ public function messages(): ThreadsMessagesContract { return new ThreadsMessages($this->transporter); } /** * Represents an execution run on a thread. * * @see https://platform.openai.com/docs/api-reference/runs */ public function runs(): ThreadsRunsContract { return new ThreadsRuns($this->transporter); } } src/Resources/VectorStores.php000064400000014015152665621660012500 0ustar00 $parameters */ public function create(array $parameters): VectorStoreResponse { $payload = Payload::create('vector_stores', $parameters); /** @var Response}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreResponse::from($response->data(), $response->meta()); } /** * Returns a list of vector stores. * * @see https://platform.openai.com/docs/api-reference/vector-stores/list * * @param array $parameters */ public function list(array $parameters = []): VectorStoreListResponse { $payload = Payload::list('vector_stores', $parameters); /** @var Response}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreListResponse::from($response->data(), $response->meta()); } /** * Retrieves a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores/retrieve */ public function retrieve(string $vectorStoreId): VectorStoreResponse { $payload = Payload::retrieve('vector_stores', $vectorStoreId); /** @var Response}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreResponse::from($response->data(), $response->meta()); } /** * Modify a vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores/modify * * @param array $parameters */ public function modify(string $vectorStoreId, array $parameters): VectorStoreResponse { $payload = Payload::modify('vector_stores', $vectorStoreId, $parameters); /** @var Response}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreResponse::from($response->data(), $response->meta()); } /** * Delete a vector store. * * https://platform.openai.com/docs/api-reference/vector-stores/delete */ public function delete(string $vectorStoreId): VectorStoreDeleteResponse { $payload = Payload::delete('vector_stores', $vectorStoreId); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return VectorStoreDeleteResponse::from($response->data(), $response->meta()); } /** * Manage the files related to the vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores-files */ public function files(): VectorStoresFilesContract { return new VectorStoresFiles($this->transporter); } /** * Manage the file batches related to the vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches */ public function batches(): VectorStoresFileBatchesContract { return new VectorStoresFileBatches($this->transporter); } /** * Search a vector store for relevant chunks based on a query and file attributes filter. * * @see https://platform.openai.com/docs/api-reference/vector-stores/search * * @param array $parameters */ public function search(string $vectorStoreId, array $parameters = []): VectorStoreSearchResponse { $payload = Payload::create("vector_stores/{$vectorStoreId}/search", $parameters); /** @var Response, data: array, content: array}>, has_more: bool, next_page: ?string}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreSearchResponse::from($response->data(), $response->meta()); } } src/Resources/Concerns/Transportable.php000064400000000367152665621660014435 0ustar00 $parameters */ private function ensureNotStreamed(array $parameters, string $fallbackFunction = 'createStreamed'): void { if (! isset($parameters['stream'])) { return; } if ($parameters['stream'] !== true) { return; } throw new InvalidArgumentException("Stream option is not supported. Please use the $fallbackFunction() method instead."); } /** * Set the stream parameter to true. * * @param array $parameters * * @return array */ private function setStreamParameter(array $parameters): array { $parameters['stream'] = true; return $parameters; } } src/Resources/Realtime.php000064400000003306152665621660011601 0ustar00 $parameters */ public function token(array $parameters = []): SessionResponse { $payload = Payload::create('realtime/sessions', $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return SessionResponse::from($response->data()); } /** * Create an ephemeral API token for real time transcription sessions. * * @see https://platform.openai.com/docs/api-reference/realtime-sessions/create-transcription * * @param array $parameters */ public function transcribeToken(array $parameters = []): TranscriptionSessionResponse { $payload = Payload::create('realtime/transcription_sessions', $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return TranscriptionSessionResponse::from($response->data()); } } src/Resources/Models.php000064400000004162152665621660011263 0ustar00}> $response */ $response = $this->transporter->requestObject($payload); return ListResponse::from($response->data(), $response->meta()); } /** * Retrieves a model instance, providing basic information about the model such as the owner and permissioning. * * @see https://platform.openai.com/docs/api-reference/models/retrieve */ public function retrieve(string $model): RetrieveResponse { $payload = Payload::retrieve('models', $model); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * Delete a fine-tuned model. You must have the Owner role in your organization. * * @see https://platform.openai.com/docs/api-reference/fine-tunes/delete-model */ public function delete(string $model): DeleteResponse { $payload = Payload::delete('models', $model); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return DeleteResponse::from($response->data(), $response->meta()); } } src/Resources/ThreadsRunsSteps.php000064400000006632152665621660013325 0ustar00}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunStepResponse::from($response->data(), $response->meta()); } /** * Returns a list of run steps belonging to a run. * * @see https://platform.openai.com/docs/api-reference/runs/listRunSteps * * @param array $parameters */ public function list(string $threadId, string $runId, array $parameters = []): ThreadRunStepListResponse { $payload = Payload::list('threads/' . $threadId . '/runs/' . $runId . '/steps', $parameters); /** @var Response}}|array{id: string, type: 'file_search', file_search: array}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}, last_error: ?array{code: string, message: string}, expires_at: ?int, cancelled_at: ?int, failed_at: ?int, completed_at: ?int, metadata?: array, usage: ?array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return ThreadRunStepListResponse::from($response->data(), $response->meta()); } } src/Resources/Audio.php000064400000007644152665621660011111 0ustar00 $parameters */ public function speech(array $parameters): string { $this->ensureNotStreamed($parameters, 'speechStreamed'); $payload = Payload::create('audio/speech', $parameters); return $this->transporter->requestContent($payload); } /** * Generates streamed audio from the input text. * * @see https://platform.openai.com/docs/api-reference/audio/createSpeech * * @param array $parameters */ public function speechStreamed(array $parameters): SpeechStreamResponse { $payload = Payload::create('audio/speech', $parameters); $response = $this->transporter->requestStream($payload); return new SpeechStreamResponse($response); } /** * Transcribes audio into the input language. * * @see https://platform.openai.com/docs/api-reference/audio/createTranscription * * @param array $parameters */ public function transcribe(array $parameters): TranscriptionResponse { $this->ensureNotStreamed($parameters, 'transcribeStreamed'); $payload = Payload::upload('audio/transcriptions', $parameters); /** @var Response, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, words: array, text: string}> $response */ $response = $this->transporter->requestObject($payload); return TranscriptionResponse::from($response->data(), $response->meta()); } /** * Transcribes audio input the streamed events. * * @see https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-stream * * @param array $parameters * * @return StreamResponse */ public function transcribeStreamed(array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::upload('audio/transcriptions', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(TranscriptionStreamResponse::class, $response); } /** * Translates audio into English. * * @see https://platform.openai.com/docs/api-reference/audio/createTranslation * * @param array $parameters */ public function translate(array $parameters): TranslationResponse { $payload = Payload::upload('audio/translations', $parameters); /** @var Response, temperature: float, avg_logprob: float, compression_ratio: float, no_speech_prob: float, transient?: bool}>, text: string}> $response */ $response = $this->transporter->requestObject($payload); return TranslationResponse::from($response->data(), $response->meta()); } } src/Resources/ThreadsMessages.php000064400000014523152665621660013124 0ustar00 $parameters */ public function create(string $threadId, array $parameters): ThreadMessageResponse { $payload = Payload::create("threads/$threadId/messages", $parameters); /** @var Response}}>, assistant_id: ?string, run_id: ?string, attachments?: array}>, metadata: array}> $response */ $response = $this->transporter->requestObject($payload); return ThreadMessageResponse::from($response->data(), $response->meta()); } /** * Retrieve a message. * * @see https://platform.openai.com/docs/api-reference/messages/getMessage */ public function retrieve(string $threadId, string $messageId): ThreadMessageResponse { $payload = Payload::retrieve("threads/$threadId/messages", $messageId); /** @var Response}}>, assistant_id: ?string, run_id: ?string, attachments?: array}>, metadata: array}> $response */ $response = $this->transporter->requestObject($payload); return ThreadMessageResponse::from($response->data(), $response->meta()); } /** * Modifies a message. * * @see https://platform.openai.com/docs/api-reference/messages/modifyMessage * * @param array $parameters */ public function modify(string $threadId, string $messageId, array $parameters): ThreadMessageResponse { $payload = Payload::modify("threads/$threadId/messages", $messageId, $parameters); /** @var Response}}>, assistant_id: ?string, run_id: ?string, attachments?: array}>, metadata: array}> $response */ $response = $this->transporter->requestObject($payload); return ThreadMessageResponse::from($response->data(), $response->meta()); } /** * Deletes a message. * * @see https://platform.openai.com/docs/api-reference/messages/deleteMessage */ public function delete(string $threadId, string $messageId): ThreadMessageDeleteResponse { $payload = Payload::delete("threads/$threadId/messages", $messageId); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return ThreadMessageDeleteResponse::from($response->data(), $response->meta()); } /** * Returns a list of messages for a given thread. * * @see https://platform.openai.com/docs/api-reference/messages/listMessages * * @param array $parameters */ public function list(string $threadId, array $parameters = []): ThreadMessageListResponse { $payload = Payload::list("threads/$threadId/messages", $parameters); /** @var Response}}>, assistant_id: ?string, run_id: ?string, attachments?: array}>, metadata: array}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return ThreadMessageListResponse::from($response->data(), $response->meta()); } } src/Resources/Responses.php000064400000010521152665621660012015 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $this->ensureNotStreamed($parameters); $payload = Payload::create('responses', $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } /** * When you create a Response with stream set to true, * the server will emit server-sent events to the client as the Response is generated. * * @see https://platform.openai.com/docs/api-reference/responses-streaming * * @param array $parameters * * @return StreamResponse */ public function createStreamed(array $parameters): StreamResponse { $parameters = $this->setStreamParameter($parameters); $payload = Payload::create('responses', $parameters); $response = $this->transporter->requestStream($payload); return new StreamResponse(CreateStreamedResponse::class, $response); } /** * Retrieves a model response with the given ID. * * @see https://platform.openai.com/docs/api-reference/responses/get */ public function retrieve(string $id): RetrieveResponse { $payload = Payload::retrieve('responses', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * Cancels a model response with the given ID. Must be marked as 'background' to be cancellable. * * @see https://platform.openai.com/docs/api-reference/responses/cancel */ public function cancel(string $id): RetrieveResponse { $payload = Payload::cancel('responses', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * Deletes a model response with the given ID. * * @see https://platform.openai.com/docs/api-reference/responses/delete */ public function delete(string $id): DeleteResponse { $payload = Payload::delete('responses', $id); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return DeleteResponse::from($response->data(), $response->meta()); } /** * Lists input items for a response with the given ID. * * @see https://platform.openai.com/docs/api-reference/responses/input-items * * @param array $parameters */ public function list(string $id, array $parameters = []): ListInputItems { $payload = Payload::list('responses/' . $id . '/input_items', $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return ListInputItems::from($response->data(), $response->meta()); } } src/Resources/Images.php000064400000005224152665621660011245 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $payload = Payload::create('images/generations', $parameters); /** @var Response, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } /** * Creates an edited or extended image given an original image and a prompt. * * @see https://platform.openai.com/docs/api-reference/images/create-edit * * @param array $parameters */ public function edit(array $parameters): EditResponse { $payload = Payload::upload('images/edits', $parameters); /** @var Response, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> $response */ $response = $this->transporter->requestObject($payload); return EditResponse::from($response->data(), $response->meta()); } /** * Creates a variation of a given image. * * @see https://platform.openai.com/docs/api-reference/images/create-variation * * @param array $parameters */ public function variation(array $parameters): VariationResponse { $payload = Payload::upload('images/variations', $parameters); /** @var Response, usage?: array{total_tokens: int, input_tokens: int, output_tokens: int, input_tokens_details: array{text_tokens: int, image_tokens: int}}}> $response */ $response = $this->transporter->requestObject($payload); return VariationResponse::from($response->data(), $response->meta()); } } src/Resources/VectorStoresFiles.php000064400000011447152665621660013471 0ustar00 $parameters */ public function create(string $vectorStoreId, array $parameters): VectorStoreFileResponse { $payload = Payload::create("vector_stores/$vectorStoreId/files", $parameters); /** @var Response, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileResponse::from($response->data(), $response->meta()); } /** * Returns a list of files within a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles * * @param array $parameters */ public function list(string $vectorStoreId, array $parameters = []): VectorStoreFileListResponse { $payload = Payload::list("vector_stores/$vectorStoreId/files", $parameters); /** @var Response, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileListResponse::from($response->data(), $response->meta()); } /** * Retrieves a file within a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores-files/getFile */ public function retrieve(string $vectorStoreId, string $fileId): VectorStoreFileResponse { $payload = Payload::retrieve("vector_stores/$vectorStoreId/files", $fileId); /** @var Response, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileResponse::from($response->data(), $response->meta()); } /** * Update attributes on a vector store file. * * @see https://platform.openai.com/docs/api-reference/vector-stores-files/updateAttributes * * @param array $parameters */ public function updateAttributes(string $vectorStoreId, string $fileId, array $parameters): VectorStoreFileResponse { $payload = Payload::modify("vector_stores/$vectorStoreId/files", $fileId, $parameters); /** @var Response, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileResponse::from($response->data(), $response->meta()); } /** * Delete a file within a vector store. * * https://platform.openai.com/docs/api-reference/vector-stores/delete */ public function delete(string $vectorStoreId, string $fileId): VectorStoreFileDeleteResponse { $payload = Payload::delete("vector_stores/$vectorStoreId/files", $fileId); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileDeleteResponse::from($response->data(), $response->meta()); } } src/Resources/Files.php000064400000006346152665621660011110 0ustar00|string|null}>}> $response */ $response = $this->transporter->requestObject($payload); return ListResponse::from($response->data(), $response->meta()); } /** * Returns information about a specific file. * * @see https://platform.openai.com/docs/api-reference/files/retrieve */ public function retrieve(string $file): RetrieveResponse { $payload = Payload::retrieve('files', $file); /** @var Response|string|null}> $response */ $response = $this->transporter->requestObject($payload); return RetrieveResponse::from($response->data(), $response->meta()); } /** * Returns the contents of the specified file. * * @see https://platform.openai.com/docs/api-reference/files/retrieve-content */ public function download(string $file): string { $payload = Payload::retrieveContent('files', $file); return $this->transporter->requestContent($payload); } /** * Upload a file that contains document(s) to be used across various endpoints/features. * * @see https://platform.openai.com/docs/api-reference/files/upload * * @param array $parameters */ public function upload(array $parameters): CreateResponse { $payload = Payload::upload('files', $parameters); /** @var Response|string|null}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } /** * Delete a file. * * @see https://platform.openai.com/docs/api-reference/files/delete */ public function delete(string $file): DeleteResponse { $payload = Payload::delete('files', $file); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return DeleteResponse::from($response->data(), $response->meta()); } } src/Resources/Edits.php000064400000002324152665621660011106 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $payload = Payload::create('edits', $parameters); /** @var Response, usage: array{prompt_tokens: int, completion_tokens: int, total_tokens: int}}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } } src/Resources/Moderations.php000064400000002111152665621660012314 0ustar00 $parameters */ public function create(array $parameters): CreateResponse { $payload = Payload::create('moderations', $parameters); /** @var Response, category_scores: array, flagged: bool,category_applied_input_types?: array>}>}> $response */ $response = $this->transporter->requestObject($payload); return CreateResponse::from($response->data(), $response->meta()); } } src/Resources/VectorStoresFileBatches.php000064400000007523152665621660014600 0ustar00 $parameters */ public function create(string $vectorStoreId, array $parameters): VectorStoreFileBatchResponse { $payload = Payload::create("vector_stores/$vectorStoreId/file_batches", $parameters); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileBatchResponse::from($response->data(), $response->meta()); } /** * Retrieves a file batch within a vector store. * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/getBatch */ public function retrieve(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse { $payload = Payload::retrieve("vector_stores/$vectorStoreId/file_batches", $fileBatchId); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileBatchResponse::from($response->data(), $response->meta()); } /** * Lists the files within a file batch within a vector store * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles * * @param array $parameters */ public function listFiles(string $vectorStoreId, string $fileBatchId, array $parameters = []): VectorStoreFileListResponse { $payload = Payload::list("vector_stores/$vectorStoreId/file_batches/$fileBatchId/files", $parameters); /** @var Response, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileListResponse::from($response->data(), $response->meta()); } /** * Cancel a vector store file batch * * @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/cancelBatch */ public function cancel(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse { $payload = Payload::cancel("vector_stores/$vectorStoreId/file_batches", $fileBatchId); /** @var Response $response */ $response = $this->transporter->requestObject($payload); return VectorStoreFileBatchResponse::from($response->data(), $response->meta()); } } composer.json000064400000004221152665621660007304 0ustar00{ "version": "0.15.0", "name": "openai-php/client", "description": "OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API", "keywords": ["php", "openai", "sdk", "codex", "GPT-3", "DALL-E", "api", "client", "natural", "language", "processing"], "license": "MIT", "authors": [ { "name": "Nuno Maduro", "email": "enunomaduro@gmail.com" }, { "name": "Sandro Gehri" } ], "require": { "php": "^8.2.0", "php-http/discovery": "^1.20.0", "php-http/multipart-stream-builder": "^1.4.2", "psr/http-client": "^1.0.3", "psr/http-client-implementation": "^1.0.1", "psr/http-factory-implementation": "*", "psr/http-message": "^1.1.0|^2.0.0" }, "require-dev": { "guzzlehttp/guzzle": "^7.9.3", "guzzlehttp/psr7": "^2.7.1", "laravel/pint": "^1.24.0", "mockery/mockery": "^1.6.12", "nunomaduro/collision": "^8.8.0", "pestphp/pest": "^3.8.2|^4.0.0", "pestphp/pest-plugin-arch": "^3.1.1|^4.0.0", "pestphp/pest-plugin-type-coverage": "^3.5.1|^4.0.0", "phpstan/phpstan": "^1.12.25", "symfony/var-dumper": "^7.2.6" }, "autoload": { "psr-4": { "OpenAI\\": "src/" }, "files": [ "src/OpenAI.php" ] }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "minimum-stability": "dev", "prefer-stable": true, "config": { "sort-packages": true, "preferred-install": "dist", "allow-plugins": { "pestphp/pest-plugin": true, "php-http/discovery": false } }, "scripts": { "lint": "pint -v --parallel", "test:lint": "pint --test -v --parallel", "test:types": "phpstan analyse --ansi", "test:type-coverage": "pest --type-coverage --min=100", "test:unit": "pest --colors=always", "test": [ "@test:lint", "@test:types", "@test:type-coverage", "@test:unit" ] } } LICENSE.md000064400000002111152665621660006162 0ustar00The MIT License (MIT) Copyright (c) Nuno Maduro 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.