Skip to content

docs: Refresh the README - #192

Merged
aydinfatih merged 1 commit into
mainfrom
docs/readme-refresh
Oct 12, 2026
Merged

aydinfatih merged 1 commit into
mainfrom
docs/readme-refresh

Conversation

@aydinfatih

Copy link
Copy Markdown
Member

A full pass over the README: outdated and wrong examples are fixed, and the features added in recent PRs are documented.

Outdated models

Most examples used models that no longer exist in the API (gemini-2.0-flash, gemini-2.0-flash-thinking-exp, text-embedding-004), so they failed when copied. Examples now use gemini-2.5-flash and gemini-embedding-001, and the Usage section points to the models list.

New sections

  • Media resolution (per request and per part)
  • Image generation with imageSize
  • JSON Schema for structured output and function parameters
  • Multimodal function responses
  • URL context
  • Server-side tool invocations (requires a model that supports it, e.g. Gemini 3)
  • Response metadata (responseId, usage metadata, finishMessage, modelStatus)
  • File search: upload with custom metadata, importFile(), getOperation()
  • Troubleshooting: error handling and empty responses
  • Testing: faking chats and asserting function calls

Fixes

  • The helper example never sent a request before calling text().
  • The function calling example attached a made-up thoughtSignature to the function response; the chat session keeps the real one automatically.
  • File search used wrong resource names (files/... as a store name, .../fileSearchDocuments/... for documents), the Table of Contents listed a non-existent "Update File Search Store" section, and the store example imported a non-existent Gemini\Enums\Schema.
  • Thinking: Gemini 2.5 uses thinkingBudget and Gemini 3 uses thinkingLevel.
  • Image generation described Imagen and assumed the first part is the image.
  • Cached content TTL was described as an extension, but it is counted from now.
  • Testing examples mixed $client and $fake, used $response for $result, and used the deprecated geminiPro().
  • Speech: the output is raw PCM; added how to convert it.
  • Smaller fixes: missing imports, a missing semicolon, outdated documentation links and wording.

Verification

  • Every PHP block in the README passes php -l, and all internal links resolve.
  • The Testing examples were run as a Pest test against ClientFake.
  • The other examples were run against the API: text, image input, media resolution, chat streaming, JSON Schema, function calling, multimodal function responses, URL context, server-side tool invocations, thinking, response metadata, error handling, files, file search (create, upload with metadata, import, operations, documents, grounding), embeddings, models and speech.
  • Image generation could not be run, because image models have no free-tier quota.

While running the examples, gemini-2.5-flash with a per-part media resolution returned usage metadata without totalTokenCount, which crashed the client; that is fixed separately in #191.

- Use models that are currently available: gemini-2.0-flash,
  gemini-2.0-flash-thinking-exp and text-embedding-004 no longer exist
- Document the new features: media resolution, image size, JSON
  Schema, multimodal function responses, URL context, server-side tool
  invocations, response metadata, file search import and operations,
  custom metadata, and faking chats
- Add error handling and empty response sections to Troubleshooting
- Fix wrong examples: file search store and document names, the
  function calling thought signature, the helper example that never
  sent a request, thinking configuration for Gemini 2.5 and 3, cached
  content TTL wording, and variable names in the Testing section
@aydinfatih
aydinfatih merged commit 086b002 into main Oct 12, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant