github orhanerday/open-ai 6.3.0

2 hours ago

What's Changed

  • Response Object: Added getLastResponse() returning a Response object with ->status(), ->ok(), ->headers(), ->header($name), ->body(), and ->json() for easy inspection without manual json_decode().
  • Exception Handling: Added setThrowOnError(true) and OpenAiException for throwing on HTTP 4xx/5xx responses with status code, error type, and error code.
  • Automatic Retries: Added setRetries(maxRetries, baseDelayMs) with exponential backoff, jitter, and Retry-After header support for rate limits (429) and transient server errors (5xx on idempotent methods).
  • Static Analysis & Types: Added PHPStan (level 5) and typed PHPDoc shape annotations on core methods while strictly preserving PHP 7.4+ compatibility with zero runtime dependencies.
  • Decisions Usage: Added getDecisionsUsage() reporting endpoint.
  • Pure Tests: Removed mock echo-server tests in favor of pure in-memory unit tests and real API tests.

Full Changelog: 6.2.0...6.3.0

Don't miss a new open-ai release

NewReleases is sending notifications on new releases.