Butochnikov/typesafe-sdk-php on GitHub
- Stars
- 1
- Forks
- 0
- Language
- PHP
- License
- MIT
- Last push
- 17 Sep 2026
Read from GitHub on . Counts change daily.
How it uses Jev
* @param array<string,mixed>|null $extraBody
* @return PromiseInterface
*/
public function systemOne(mixed $state, array $questions, ?string $model = null, ?RetryPolicy $retry = null, float|Timeout|null $timeout = null, ?array $extraHeaders = null, ?array $extraBody = null): PromiseInterface
{
$this->assertOpen(); $normalized = normalizeQuestions($questions); $body = ['state' => $state, 'model' => $model ?? $this->config->model, 'questions' => serializeQuestions($normalized)]; if ($extraBody !== null) $body = array_replace($body, $extraBody);
$request = Transport::prepare($this->config, 'POST', Constants::SYSTEM_ONE_PATH, $body, $timeout, $extraHeaders, SystemOneResponse::class, $this->httpClient);
return $this->track(Transport::sendAsync($this->httpClient, $this->config, $request, $retry ?? $this->retry));
}
public function close(): void
{
if ($this->closed) return; $this->closed = true; foreach ($this->pending as $promise) $promise->cancel(); $this->pending = [];
if ($this->httpClient instanceof CloseableHttpClientInterface) $this->httpClient->close();
if ($this->transport instanceof CloseableTransportInterface) $this->transport->close();
}View in src/AsyncTypeSafeClient.php
