May 11th, 2026

Laravel AI v0.6.8

Laravel AI v0.6.8
Sponsored by
Table of Contents

@taylorotwell tagged v0.6.8 of laravel/ai, a wide release that adds sub-agent tooling, Gemini context cache support, failover during streaming, OpenRouter audio, and a substantial test coverage push across every major provider.


Sub-Agents as Tools

@JVillator0 merged PR #348, which lets any agent be registered as a tool for another agent. A parent agent can now delegate to a fully configured child agent the same way it calls any other tool, including with its own system prompt, provider, and conversation history.

This composes naturally with existing tool registration. If an agent class implements the tool contract, it shows up in the parent's tool list with no extra wiring required.


Gemini Context Cache via cachedContent

@dumbbellcode added PR #556, passing a cachedContent parameter through agent provider options to the Gemini API. Projects with large, stable system prompts or repeated document context can pre-cache that content on Google's side and reference the cache name on each request, reducing both latency and token costs.

1Agent::make()
2 ->provider('gemini')
3 ->providerOptions([
4 'cachedContent' => 'projects/my-project/locations/us-central1/cachedContents/abc123',
5 ]);

Failover During Stream Iteration

@kachelle merged PR #279, extending the existing failover mechanism to cover in-progress stream iteration. Previously, a provider failure mid-stream would surface as an unhandled exception even when a fallback provider was configured. Now the failover chain activates at the point of iteration, so the stream restarts from the next provider transparently.


OpenRouter TTS and STT

@ondrejehrlich added PR #559, wiring text-to-speech and speech-to-text through the OpenRouter gateway. The same tts() and stt() driver surface used by other providers now works with OpenRouter-hosted audio models.


Provider Options in Embeddings

@dumbbellcode also merged PR #555, surfacing providerOptions() on embedding requests. Any provider-specific parameter that lives outside the standard embedding schema can now be passed through without a custom driver.

1Embeddings::make()
2 ->provider('voyage')
3 ->providerOptions(['input_type' => 'query'])
4 ->embed('search query text');

Anthropic pause_turn Continuations

@CodeWrap merged PR #493, handling the pause_turn stop reason that Anthropic returns when a server-tool invocation needs a continuation turn. Without this fix, those responses were treated as complete, silently dropping any pending server-tool work.


BroadcastAgent stream_failed Event

@sumaiazaman merged PR #536, emitting a stream_failed broadcast event when a BroadcastAgent job fails. Clients listening on the broadcast channel can now react to job-level failures the same way they react to stream-level ones.


PHPDoc Cleanup

Several PHPDoc fixes landed in this release. @mosabbirrakib corrected a parameter name in GeneratesEmbeddings (PR #549), removed a stale @param and unused Request import from the Vercel protocol trait (PR #551), fixed a nonexistent ImageAttachment type reference in image-related docblocks (PR #550), and marked size and quality as nullable across image gateways (PR #552).


Test Coverage

A coordinated effort from @mosabbirrakib and @mdalikadar closed most of the remaining gaps in error-handling and rate-limit test coverage.

Area PR
VoyageAI reranking error handling #527
VoyageAI embeddings error handling #526
OpenAI image generation error handling #528
AzureOpenAI image generation error handling #537
Gemini, AzureOpenAI, OpenRouter image generation error handling #545
OpenAI and Gemini embeddings error handling #546
ElevenLabs rate limit and overloaded errors #542
Cohere reranking rate limit and overloaded errors #540
Jina reranking rate limit and overloaded errors #541
Gemini image generation safety blocks #547

@pushpak1300 also removed the stale update-changelog.yml workflow in PR #525.


Projects using Gemini with large shared contexts, OpenRouter audio, or sub-agent orchestration patterns have the most direct reason to upgrade. The failover-during-streaming fix is relevant to any deployment that runs a failover chain with streaming enabled.

If you enjoyed this article, please consider supporting our work for as low as $5 / month.

Sponsor
Marian Pop

Written by

Marian Pop

Writing and maintaining @LaravelMagazine. Host of "The Laravel Magazine Podcast". Pronouns: vi/vim.

Comments

Stay Updated

Subscribe to our newsletter

Get latest news, tutorials, community articles and podcast episodes delivered to your inbox.

Weekly articles
We send a new issue of the newsletter every week on Friday.
No spam
We'll never share your email address and you can opt out at any time.