Laravel AI SDK 1.4.1 · Gemini Decision 1 · Developer Tutorial
Laravel AI SDK 1.4.1: Build AI Ticket Triage with Gemini Decision 1
Build a practical support-ticket triage service using Laravel's official AI SDK and Google's Gemini Decision 1. Learn typed classification, probability thresholds, department routing and automated tests without parsing free-form AI responses.
Google's Gemini Decisions API introduces a different approach to AI classification: instead of asking a generative model to write JSON and then parsing it, developers can ask bounded questions and receive typed answers with probabilities.
With Laravel AI SDK 1.4.1 adding Gemini Decisions API support, Laravel developers can now integrate this decision-oriented workflow using familiar PHP APIs.
In this tutorial, we will build:
- Urgency detection using a yes/no decision.
- Support department routing using a fixed set of categories.
- Customer frustration scoring using an ordered scale.
- Confidence-based fallback for uncertain classifications.
- A testable Laravel service using the SDK's fake classification support.
1. What Is Gemini Decision 1?
Gemini Decision 1 is Google's model for evaluating fixed, structured questions about an input. It is designed for application decisions such as content checks, routing, scoring and classification rather than producing long conversational answers.
The Gemini Decisions API supports three main question types:
- Yes/no: determine the probability that a statement is true.
- Choice: select one option from a predefined list.
- Score: evaluate an input against an ordered rubric.
The API returns probabilities and confidence information rather than generated explanatory text. This makes the result useful when ordinary application code needs to make the next decision.
Google's announcement on 11 November 2026 describes support for text, images, audio, video and PDFs, with up to 1,000 independent questions evaluated against shared input in one request. Google also reported zero output-token usage and 150–250 ms end-to-end latency under its stated test conditions.
These latency figures are vendor-reported results, not a guarantee for every application, network or file size.
2. What Changed in Laravel AI SDK 1.4.1?
Laravel's official laravel/ai package provides a unified interface for working with multiple AI providers. It already includes classification APIs for typed questions and answers.
Version 1.4.1 adds support for Google's Gemini Decisions API. The release notes also list improvements involving Anthropic web-search citations, Gemini interactions, structured output and streamed tool calls.
An important implementation detail is that the Gemini provider in v1.4.1 uses gemini-decision-1 as its default classification model. You can therefore call the Laravel classification API with the Gemini provider instead of manually constructing the provider's HTTP request.
Why this matters for Laravel developers
Consider a normal customer-support application. A ticket arrives and your backend needs to answer three questions:
- Is this ticket urgent?
- Which department should receive it?
- How frustrated does the customer appear?
A conventional generative-model approach might ask for a JSON object, parse the response and handle malformed or unexpected output. The Decisions API is designed to return typed decisions directly, and Laravel's classification response exposes those results through PHP objects.
3. Requirements and Installation
The v1.4.1 Composer package requires PHP 8.3 or newer. Its Illuminate dependencies support Laravel 12 and Laravel 13, with the JSON Schema dependency requiring the corresponding 12.62+ or 13.15+ component versions.
Step 1: Install Laravel AI SDK 1.4.1
In an existing compatible Laravel application, install the exact version used in this tutorial:
Step 2: Publish the SDK configuration and migrations
Publish the package configuration and migration files:
Run the database migrations:
The SDK's published migrations create the conversation storage tables used by its conversational agents.
Step 3: Configure your Gemini API key
Create an API key through Google AI Studio and add it to your Laravel environment:
Keep this key on the server. Do not expose it in browser JavaScript, frontend environment variables or public repositories.
4. Understand the Three Classification Types
Laravel AI SDK provides three convenient question classes for classification.
Boolean: yes/no decisions
Use Boolean when the application needs to evaluate a statement such as whether a ticket requires immediate attention.
The result exposes a probability and an isTrue() method. You can supply a threshold instead of accepting the default threshold of 0.5.
Choice: select a category
Use Choice when the answer must be one of a predefined set of options. Examples include billing, technical support, account access or sales.
The response provides the selected choice, probabilities and confidence information.
Score: evaluate an ordered rubric
Use Score when an input needs to be evaluated against ordered levels. For example, a support ticket could be classified as calm, concerned, frustrated or very angry.
The returned score is probability-weighted and can fall between two levels. Use label() to get the most probable label. Do not treat the score as a percentage or an ordinary integer severity value.
5. Build a Laravel AI Ticket Triage Service
We will create one reusable service that accepts a support-ticket model and returns structured classification results.
Assume the application already has a SupportTicket model with subject and body fields. The example keeps classification separate from database updates so that the application can review the result before changing ticket status or triggering business actions.
Step 1: Create the service
Create a file named app/Services/TicketTriageService.php.
Step 2: Understand the classification logic
The service sends the ticket subject and body as one shared input. It asks three independent questions about that same input.
- Urgency: the application marks a ticket urgent only when the yes probability reaches the chosen 0.85 threshold.
- Department: the model chooses from a fixed list. The
othercategory provides a catch-all option, while the confidence threshold sends uncertain results to manual review. - Sentiment: the service returns the most probable label and the probability-weighted score.
The thresholds in this example are starting values for demonstration, not universal production settings. Choose thresholds using labeled examples from your own ticket data.
Important: always include a catch-all option
A choice classifier must select from the options you provide. If none of them fits, it can still assign probability to the available choices. Google's documentation recommends adding an explicit other option, checking confidence or asking a separate scope question.
This is especially important for support systems. A question about an unrelated topic should not automatically become a billing or technical ticket simply because those are the only available choices.
6. Expose the Triage Service Through a Laravel Endpoint
The service can be called from a controller, a queued job or an internal workflow. Here is a simple authenticated endpoint.
Controller
Create app/Http/Controllers/TicketTriageController.php:
Route
Register the endpoint with authentication and the application's ticket-update policy:
The example returns the classification result without automatically issuing a refund, changing account permissions or performing another irreversible action. Add persistence and workflow logic only after your own authorization, confidence and review rules have been applied.
7. Test the Classification Service
One benefit of the Laravel AI SDK is its fake classification support. You can test the questions your application asks without making a live Gemini API request.
The following Pest example assumes the application has a SupportTicket factory:
This verifies that the service submits the expected input and asks the intended questions. It does not prove that Gemini classifies real customer tickets accurately. For that, maintain a labeled evaluation dataset and compare the model's decisions with human-reviewed outcomes.
8. Laravel AI Classification vs Traditional JSON Generation
Both approaches can be useful, but they solve different problems.
| Area | Generative model with JSON prompt | Gemini Decision 1 through Laravel AI SDK |
|---|---|---|
| Output | Generated text or JSON | Typed yes/no, choice or score result |
| Parsing | Usually requires JSON decoding and validation | Laravel exposes typed classification answers |
| Probabilities | May require a separate confidence convention | Returns decision probabilities and confidence information |
| Best use | Explanations, summaries and flexible responses | Fixed categories, yes/no checks and rubric scoring |
| Output tokens | Generated output is normally billed by the provider's pricing model | Gemini Decisions API generates zero output tokens |
| Reasoning text | Can generate a natural-language explanation | Does not return a natural-language explanation as its decision output |
The best architecture is often a combination: use a decision model for a bounded routing or classification task, then use a generative agent when the application needs a detailed explanation or a conversational response.
9. Good Practices for Production Applications
Use narrow questions
Ask one clear question at a time. Avoid combining several unrelated decisions into one vague instruction.
Set thresholds using real data
A threshold of 0.85 is only an example. Evaluate false positives and false negatives on a representative, human-labeled dataset before using probabilities to trigger business workflows.
Handle uncertain results
Route low-confidence classifications to a human review queue. Also handle nullable confidence values where the selected provider or response does not supply one.
Keep business rules in PHP
The model should classify the input. Your Laravel application should decide what actions are permitted. For example, a high urgency score should not automatically authorize a refund or account deletion.
Protect customer data
Send only the fields required for classification. Avoid including passwords, payment credentials, access tokens or unrelated personal information in model input. Review the provider's data handling terms before sending production data.
Log and evaluate results
Store the input reference, selected category, probabilities, model version, review outcome and timestamp where appropriate. This helps identify changes in accuracy and tune thresholds over time.
10. Bad Practices to Avoid
- Do not assume a high score means guaranteed correctness. Probabilities are useful signals, not proof.
- Do not omit an escape category. A fixed choice list can force an unrelated input into an unsuitable category.
- Do not treat a weighted score as a percentage. Interpret it using the rubric and per-level probabilities.
- Do not let the model authorize irreversible operations. Enforce permissions and human approvals in Laravel.
- Do not use a decision model for open-ended writing. It is designed for bounded decisions, not essays or customer-facing explanations.
- Do not assume questions can depend on one another. Questions in one Decisions API request are evaluated independently against shared input.
11. When Should You Use Gemini Decision 1?
| Use case | Decision questions |
|---|---|
| Support ticket routing | Which department? Is it urgent? |
| Content moderation | Does the content violate a defined policy? |
| Lead qualification | Does the lead match the target customer profile? |
| Document processing | Is an invoice present? Which document category applies? |
| Customer feedback analysis | Which product area is mentioned? What is the sentiment level? |
| Model and tool routing | Which predefined route best matches the request? |
The API also supports multimodal input. This creates opportunities for document, image and audio classification workflows, subject to the supported input formats and size limits in Google's documentation.
12. Important Limitations
There are several points to understand before choosing this architecture:
- Laravel's classification API is documented as experimental, so its API may change in future minor releases.
- Gemini Decision 1 returns bounded decisions, not a generated explanation or a conversational answer.
- Questions in a single request are independent. If a second decision genuinely depends on the first result, combine the results in PHP or make another request.
- Google's Decisions API documentation lists limitations including no context caching and no Batch API support. Repeated input in separate requests is counted again.
- Google's API examples use the
v1betaDecisions endpoint. The Laravel SDK handles provider communication, but developers should still follow the current Google API availability and limits.
Treat the integration as a specialized classification capability, not a replacement for every generative AI workflow.
13. Conclusion
Gemini Decision 1 introduces a useful option for backend applications that need structured decisions rather than generated paragraphs. Laravel AI SDK 1.4.1 makes that capability accessible through familiar PHP classification classes.
With Boolean, Choice and Score, a Laravel application can classify support requests, identify urgent cases, route departments and score customer feedback without building a custom JSON-parsing layer for every decision.
The key to a reliable production implementation is not simply choosing a model. It is defining clear categories, evaluating confidence, maintaining human review paths and keeping authorization and business rules inside Laravel.
Start with a small labeled dataset, measure the results and expand the workflow only after the decisions are reliable enough for your use case.
Have you tried the Laravel AI SDK's new Gemini Decisions API support? Share your use case and implementation experience in the comments.
Frequently Asked Questions
1. What is Gemini Decision 1?
Gemini Decision 1 is Google's model for bounded decisions. It evaluates yes/no, multiple-choice and ordered scoring questions over shared input and returns probabilities and confidence information rather than generated explanatory text.
2. Does Laravel AI SDK support Gemini Decision 1?
Yes. Laravel AI SDK v1.4.1 adds support for the Gemini Decisions API. The Gemini provider's default classification model in that version is gemini-decision-1.
3. Which PHP and Laravel versions are required?
The v1.4.1 package requires PHP 8.3 or newer and supports Laravel 12 and 13 through its Illuminate dependencies. The JSON Schema dependency requires the compatible 12.62+ or 13.15+ component versions.
4. What are Boolean, Choice and Score in Laravel AI SDK?
Boolean evaluates a yes/no question, Choice selects one option from a predefined list, and Score evaluates an input against an ordered rubric. Each is useful for a different kind of structured classification.
5. Can Gemini Decision 1 classify multiple questions in one request?
Yes. Google's API supports up to 1,000 independent questions against shared input in one request. Each question is evaluated independently; one question cannot use another question's answer.
6. Does Gemini Decision 1 generate normal text responses?
No. It is designed to return typed decisions, probabilities and confidence information. Use a generative model or agent when you need explanations, summaries or conversational responses.
7. Can I use Gemini Decision 1 for automatic ticket routing?
Yes, it can help classify and route tickets. Include an explicit catch-all option, validate confidence thresholds using labeled data and send uncertain or high-risk cases for human review.
8. Is Gemini Decision 1 free?
Google's launch announcement described a no-cost tier for prototyping and announced paid pricing of $0.10 per one million input tokens with zero output-token charges. Check Google's live pricing and rate limits before estimating production costs.
9. Is Laravel AI SDK classification production-ready?
The SDK documentation currently marks classification as experimental. Test the exact SDK and provider versions you deploy, monitor classification quality and keep a fallback path for uncertain decisions.
10. Should I replace all LLM calls with Gemini Decision 1?
No. Use it for fixed, bounded decisions such as routing, moderation and scoring. Keep generative models for open-ended reasoning, explanations, summaries and natural-language responses.
Sources and Further Reading
- Google: Gemini Decisions API — Fast, calibrated multimodal decisions — 11 November 2026.
- Google AI Studio: Decisions API documentation — live documentation checked 20 November 2026.
- Laravel AI SDK: Official changelog — v1.4.1 changelog dated 13 November 2026.
- Laravel AI SDK: v1.4.1 GitHub release — GitHub release page records publication on 17 November 2026.
- Laravel 13.x: Laravel AI SDK documentation — live documentation checked 20 November 2026.
- Laravel AI SDK v1.4.1: Composer requirements — tagged package metadata.
- Laravel AI SDK v1.4.1: Gemini provider source — default classification model implementation.
- r/GeminiAI: Discussion of the Gemini Decisions API — 18 November 2026.