Likelihood Of Impact: High
The providerOptions() method on embeddings and transcription builders has been
removed in favor of withProviderOptions():
// Before...
Ai::embeddings('...')->providerOptions(['dimensions' => 256]);
// After...
Ai::embeddings('...')->withProviderOptions(['dimensions' => 256]);The withProviderOptions() signature on provider tools has also changed. The
Lab|string $provider argument was dropped in favor of an array or closure:
// Before...
$tool->withProviderOptions('openai', ['key' => 'value']);
// After...
$tool->withProviderOptions(['key' => 'value']);
// Or, to vary options per provider, pass a closure...
$tool->withProviderOptions(fn (Lab|string $provider) => match ($provider) {
Lab::OpenAi => ['key' => 'value'],
default => [],
});Likelihood Of Impact: Low
Laravel\Ai\Contracts\Gateway\TextGateway has been removed. Provider gateways
now implement only StepTextGateway, and the multi-step API lives entirely on
the provider's TextGenerationLoop. Most applications are unaffected.
If you wrote or type-hinted a custom gateway, swap the contract:
// Before...
use Laravel\Ai\Contracts\Gateway\TextGateway;
class MyGateway implements TextGateway { /* generateText, streamText, onToolInvocation */ }
// After...
use Laravel\Ai\Contracts\Gateway\StepTextGateway;
class MyGateway implements StepTextGateway { /* generateTextStep, generateStreamStep */ }The multi-step methods you used to call on the gateway now live on the loop:
// Before...
$provider->textGateway()->generateText(...);
$provider->textGateway()->onToolInvocation(...);
// After...
$provider->textGenerationLoop()->generate(...);
$provider->textGenerationLoop()->onToolInvocation(...);If you implement TextProvider directly instead of extending the base
Provider, add a textGenerationLoop(): TextGenerationLoop method. Anything
extending Provider gets it for free.
Likelihood Of Impact: Low
Agent::fake() responses now flow through the same TextGenerationLoop as real
providers. Existing tests keep passing, but if you assert on exact messages or
streamed events, four behaviors are now more realistic:
- Faking a tool call for a tool the agent has not registered throws
NoSuchToolExceptioninstead of being silently skipped. Register the tool. - After a faked tool call,
$response->messagesincludes the final assistant reply (one extra message).text,toolCalls,toolResults, andstepsare unchanged. - Faking an empty string no longer emits
TextStart/TextEndevents while streaming. - Faked tool calls now emit a
ToolCallevent while streaming. If you count streamed events, expect one extra per tool call.
Likelihood Of Impact: Low
Anthropic structured outputs now use the native output_config.format API by
default instead of the synthetic tool approach. To restore the previous
behavior, disable it in your provider configuration:
'anthropic' => [
'use_native_structured_output' => false,
],