packagist google-gemini-php/client 2.8.0

5 hours ago

Highlights

  • PHP 8.2+ is now required. Projects on PHP 8.1 will keep resolving to 2.7.x.
  • New API features: JSON Schema for structured output and function declarations, multimodal function responses, server-side tool invocations, per-part media resolution, ImageConfig::$imageSize, response metadata (responseId, modelStatus, finishMessage, urlContextMetadata, serviceTier), and importFile() / getOperation() for file search stores.
  • ClientFake now supports startChat(), including multi-turn and streamed chats.
  • The README has been refreshed with current models and examples for all features.

Behavior changes

No public signatures changed, but a few behaviors did:

  • Streamed requests that fail with a 5xx and a JSON error body now throw ErrorException instead of TransporterException, like regular requests (#187).
  • The chat history built by streamSendMessage() keeps thoughts, function calls and tool calls as separate parts and keeps their thoughtSignature. This fixes the next turn being rejected after a streamed function call, but $chat->history[$i]->parts may look different than before (#183).
  • The ValueError messages of text() and parts() now end with the finish or block reason (#189).

What's Changed

Features

Fixes

Maintenance

Full Changelog: 2.7.4...2.8.0

Don't miss a new client release

NewReleases is sending notifications on new releases.