[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-laravel-ai-sdk-development":3,"mdc--34avig-key":34,"related-org-laravel-ai-sdk-development":3163,"related-repo-laravel-ai-sdk-development":3294},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"ai-sdk-development","build AI agents with Laravel AI SDK","TRIGGER when working with ai-sdk which is Laravel official first-party AI SDK. Activate when building, editing AI agents, chatbots, text generation, image generation, audio\u002FTTS, transcription\u002FSTT, embeddings, RAG, vector stores, reranking, structured output, streaming, conversation memory, tools, queueing, broadcasting, and provider failover across OpenAI, Anthropic, Gemini, Azure, Groq, xAI, DeepSeek, Mistral, Ollama, ElevenLabs, Cohere, Jina, and VoyageAI. Invoke when the user references ai-sdk, the `Laravel\\Ai\\` namespace, or this project's AI features — not for other AI packages used directly.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"laravel","Laravel","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Flaravel.png",[12,16,17,20],{"name":13,"slug":14,"type":15},"PHP","php","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Agents","agents",{"name":21,"slug":22,"type":15},"AI SDK","ai-sdk",1040,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Fai","2026-07-13T06:22:24.770526","MIT",290,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"The Laravel AI SDK provides a unified, expressive API for interacting with AI providers such as OpenAI, Anthropic, Gemini, and more.","https:\u002F\u002Fgithub.com\u002Flaravel\u002Fai\u002Ftree\u002FHEAD\u002Fresources\u002Fboost\u002Fskills\u002Fai-sdk-development","---\nname: ai-sdk-development\ndescription: TRIGGER when working with ai-sdk which is Laravel official first-party AI SDK. Activate when building, editing AI agents, chatbots, text generation, image generation, audio\u002FTTS, transcription\u002FSTT, embeddings, RAG, vector stores, reranking, structured output, streaming, conversation memory, tools, queueing, broadcasting, and provider failover across OpenAI, Anthropic, Gemini, Azure, Groq, xAI, DeepSeek, Mistral, Ollama, ElevenLabs, Cohere, Jina, and VoyageAI. Invoke when the user references ai-sdk, the `Laravel\\Ai\\` namespace, or this project's AI features — not for other AI packages used directly.\nlicense: MIT\nmetadata:\n  author: laravel\n---\n\n# Developing with the Laravel AI SDK\n\nThe Laravel AI SDK (`laravel\u002Fai`) is the official AI package for Laravel, providing a unified API for agents, images, audio, transcription, embeddings, reranking, vector stores, and file management across multiple AI providers.\n\n## Searching the Documentation\n\nThis package is new. Always search the documentation before implementing any feature. Never guess at APIs — the documentation is the single source of truth.\n\n- Use broad, simple queries that match the documentation section headings below.\n- Do not add package names to queries — package information is shared automatically. Use `test agent fake`, not `laravel ai test agent fake`.\n- Run multiple queries at once — the most relevant results are returned first.\n\n### Documentation Sections\n\nUse these section headings as query terms for accurate results:\n\n- Introduction, Installation, Configuration, Provider Support\n- Agents: Prompting, Conversation Context, Structured Output, Attachments, Streaming, Broadcasting, Queueing, Tools, Provider Tools, Middleware, Anonymous Agents, Agent Configuration\n- Images\n- Audio (TTS)\n- Transcription (STT)\n- Embeddings: Querying Embeddings, Caching Embeddings\n- Reranking\n- Files\n- Vector Stores: Adding Files to Stores\n- Failover\n- Testing: Agents, Images, Audio, Transcriptions, Embeddings, Reranking, Files, Vector Stores\n- Events\n\n## Decision Workflow\n\nDetermine the right entry point before writing code:\n\nText generation or chat? → Agent class with `Promptable` trait\nChat with conversation history? → Agent + `Conversational` interface (manual) or `RemembersConversations` trait (automatic)\nStructured JSON output? → Agent + `HasStructuredOutput` interface\nImage generation? → `Image::of()->generate()`\nAudio synthesis? → `Audio::of()->generate()`\nTranscription? → `Transcription::fromPath()->generate()`\nEmbeddings? → `Embeddings::for()->generate()`\nReranking? → `Reranking::of()->rerank()`\nFile storage? → `Document::fromPath()->put()`\nVector stores? → `Stores::create()`\n\n## Basic Usage Examples\n\n### Agents\n\n```php\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Enums\\Lab;\nuse Laravel\\Ai\\Promptable;\n\nclass SalesCoach implements Agent\n{\n    use Promptable;\n\n    public function instructions(): string\n    {\n        return 'You are a sales coach.';\n    }\n}\n\n\u002F\u002F Prompting\n$response = (new SalesCoach)->prompt('Analyze this transcript...');\necho $response->text;\n\n\u002F\u002F Container resolution with dependency injection\n$agent = SalesCoach::make(user: $user);\n\n\u002F\u002F Override provider, model, or timeout per-prompt\n$response = (new SalesCoach)->prompt(\n    'Analyze this transcript...',\n    provider: Lab::Anthropic,\n    model: 'claude-haiku-4-5-20251001',\n    timeout: 120,\n);\n\n\u002F\u002F Streaming (returns SSE response from a route)\nreturn (new SalesCoach)->stream('Analyze this transcript...');\n\n\u002F\u002F Queueing\n(new SalesCoach)->queue('Analyze this transcript...')\n    ->then(fn ($response) => \u002F* ... *\u002F);\n\n\u002F\u002F Anonymous agents\nuse function Laravel\\Ai\\{agent};\n\n$response = agent(instructions: 'You are a helpful assistant.')->prompt('Hello');\n```\n\n### Conversation Context\n\nManual conversation history via the `Conversational` interface:\n\n```php\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\Conversational;\nuse Laravel\\Ai\\Messages\\Message;\nuse Laravel\\Ai\\Promptable;\n\nclass SalesCoach implements Agent, Conversational\n{\n    use Promptable;\n\n    public function __construct(public User $user) {}\n\n    public function instructions(): string { return 'You are a sales coach.'; }\n\n    public function messages(): iterable\n    {\n        return History::where('user_id', $this->user->id)\n            ->latest()->limit(50)->get()->reverse()\n            ->map(fn ($m) => new Message($m->role, $m->content))\n            ->all();\n    }\n}\n```\n\nAutomatic conversation persistence via the `RemembersConversations` trait:\n\n```php\nuse Laravel\\Ai\\Concerns\\RemembersConversations;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\Conversational;\nuse Laravel\\Ai\\Promptable;\n\nclass SalesCoach implements Agent, Conversational\n{\n    use Promptable, RemembersConversations;\n\n    public function instructions(): string { return 'You are a sales coach.'; }\n}\n\n\u002F\u002F Start a new conversation\n$response = (new SalesCoach)->forUser($user)->prompt('Hello!');\n$conversationId = $response->conversationId;\n\n\u002F\u002F Continue an existing conversation\n$response = (new SalesCoach)->continue($conversationId, as: $user)->prompt('Tell me more.');\n```\n\n### Structured Output\n\n```php\nuse Illuminate\\Contracts\\JsonSchema\\JsonSchema;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\HasStructuredOutput;\nuse Laravel\\Ai\\Promptable;\n\nclass Reviewer implements Agent, HasStructuredOutput\n{\n    use Promptable;\n\n    public function instructions(): string { return 'Review and score content.'; }\n\n    public function schema(JsonSchema $schema): array\n    {\n        return [\n            'feedback' => $schema->string()->required(),\n            'score' => $schema->integer()->min(1)->max(10)->required(),\n        ];\n    }\n}\n\n$response = (new Reviewer)->prompt('Review this...');\necho $response['score']; \u002F\u002F Access like an array\n```\n\n### Images\n\n```php\nuse Laravel\\Ai\\Image;\n\n$image = Image::of('A sunset over mountains')\n    ->landscape()\n    ->quality('high')\n    ->generate();\n\n$path = $image->store(); \u002F\u002F Store to default disk\n```\n\n### Audio\n\n```php\nuse Laravel\\Ai\\Audio;\n\n$audio = Audio::of('Hello from Laravel.')\n    ->female()\n    ->instructions('Speak warmly')\n    ->generate();\n\n$path = $audio->store();\n```\n\n### Transcription\n\n```php\nuse Laravel\\Ai\\Transcription;\n\n$transcript = Transcription::fromStorage('audio.mp3')\n    ->diarize()\n    ->generate();\n\necho (string) $transcript;\n```\n\n### Embeddings\n\n```php\nuse Laravel\\Ai\\Embeddings;\nuse Illuminate\\Support\\Str;\n\n$response = Embeddings::for(['Text one', 'Text two'])\n    ->dimensions(1536)\n    ->cache()\n    ->generate();\n\n\u002F\u002F Single string via Stringable\n$embedding = Str::of('Napa Valley has great wine.')->toEmbeddings();\n```\n\n### Reranking\n\n```php\nuse Laravel\\Ai\\Reranking;\n\n$response = Reranking::of(['Django is Python.', 'Laravel is PHP.', 'React is JS.'])\n    ->limit(5)\n    ->rerank('PHP frameworks');\n\n$response->first()->document; \u002F\u002F \"Laravel is PHP.\"\n```\n\n### Files and Vector Stores\n\n```php\nuse Laravel\\Ai\\Files\\Document;\nuse Laravel\\Ai\\Stores;\n\n\u002F\u002F Store a file with the provider\n$file = Document::fromPath('\u002Fpath\u002Fto\u002Fdoc.pdf')->put();\n\n\u002F\u002F Create a vector store and add files\n$store = Stores::create('Knowledge Base');\n$store->add($file->id);\n$store->add(Document::fromStorage('manual.pdf')); \u002F\u002F Store + add in one step\n```\n\n## Agent Configuration\n\n### PHP Attributes\n\n```php\nuse Laravel\\Ai\\Attributes\\{Provider, Model, MaxSteps, MaxTokens, Temperature, Timeout};\nuse Laravel\\Ai\\Enums\\Lab;\n\n#[Provider(Lab::Anthropic)]\n#[Model('claude-haiku-4-5-20251001')]\n#[MaxSteps(10)]\n#[MaxTokens(4096)]\n#[Temperature(0.7)]\n#[Timeout(120)]\nclass MyAgent implements Agent\n{\n    use Promptable;\n    \u002F\u002F ...\n}\n```\n\nThe `#[UseCheapestModel]` and `#[UseSmartestModel]` attributes are also available for automatic model selection.\n\nThe `#[WithoutBroadcasting]` attribute stops the given stream event types from broadcasting (e.g. data-heavy `ToolResult` payloads that exceed the WebSocket frame limit). The events are still streamed and persisted; they just never hit the channel:\n\n```php\nuse Laravel\\Ai\\Attributes\\WithoutBroadcasting;\nuse Laravel\\Ai\\Streaming\\Events\\{ToolCall, ToolResult};\n\n#[WithoutBroadcasting(ToolResult::class, ToolCall::class)]\nclass SearchAgent implements Agent, HasTools\n{\n    use Promptable;\n    \u002F\u002F ...\n}\n```\n\n### Tools\n\nImplement the `HasTools` interface and scaffold tools with `php artisan make:tool`:\n\n```php\nuse Laravel\\Ai\\Contracts\\HasTools;\n\nclass MyAgent implements Agent, HasTools\n{\n    use Promptable;\n\n    public function tools(): iterable\n    {\n        return [new MyCustomTool];\n    }\n}\n```\n\n### Provider Tools\n\n```php\nuse Laravel\\Ai\\Providers\\Tools\\{WebSearch, WebFetch, FileSearch};\n\npublic function tools(): iterable\n{\n    return [\n        (new WebSearch)->max(5)->allow(['laravel.com']),\n        new WebFetch,\n        new FileSearch(stores: ['store_id']),\n    ];\n}\n```\n\n### Conversation Memory\n\n```php\nuse Laravel\\Ai\\Concerns\\RemembersConversations;\nuse Laravel\\Ai\\Contracts\\Conversational;\n\nclass ChatBot implements Agent, Conversational\n{\n    use Promptable, RemembersConversations;\n    \u002F\u002F ...\n}\n\n$response = (new ChatBot)->forUser($user)->prompt('Hello!');\n$response = (new ChatBot)->continue($conversationId, as: $user)->prompt('More...');\n```\n\n### Failover\n\n```php\n$response = (new MyAgent)->prompt('Hello', provider: [Lab::OpenAI, Lab::Anthropic]);\n```\n\n## Testing and Faking\n\nEach capability supports `fake()` with assertions:\n\n```php\nuse App\\Ai\\Agents\\SalesCoach;\nuse Laravel\\Ai\\{Image, Audio, Transcription, Embeddings, Reranking, Files, Stores};\n\n\u002F\u002F Agents\nSalesCoach::fake(['Response 1', 'Response 2']);\nSalesCoach::assertPrompted('query');\nSalesCoach::assertNotPrompted('query');\nSalesCoach::assertNeverPrompted();\nSalesCoach::fake()->preventStrayPrompts();\n\n\u002F\u002F Images\nImage::fake();\nImage::assertGenerated(fn ($prompt) => $prompt->contains('sunset'));\nImage::assertNothingGenerated();\n\n\u002F\u002F Audio\nAudio::fake();\nAudio::assertGenerated(fn ($prompt) => $prompt->contains('Hello'));\n\n\u002F\u002F Transcription\nTranscription::fake(['Transcribed text.']);\nTranscription::assertGenerated(fn ($prompt) => $prompt->isDiarized());\n\n\u002F\u002F Embeddings\nEmbeddings::fake();\nEmbeddings::assertGenerated(fn ($prompt) => $prompt->contains('Laravel'));\n\n\u002F\u002F Reranking\nReranking::fake();\nReranking::assertReranked(fn ($prompt) => $prompt->contains('PHP'));\n\n\u002F\u002F Files\nFiles::fake();\nFiles::assertStored(fn ($file) => $file->mimeType() === 'text\u002Fplain');\n\n\u002F\u002F Stores\nStores::fake();\nStores::assertCreated('Knowledge Base');\n$store = Stores::get('id');\n$store->assertAdded('file_id');\n```\n\n## Key Patterns\n\n- Namespace: `Laravel\\Ai\\`\n- Package: `composer require laravel\u002Fai`\n- Agent pattern: Implement the `Agent` interface and use the `Promptable` trait\n- Optional interfaces: `HasTools`, `HasMiddleware`, `HasStructuredOutput`, `Conversational`\n- Entry-point classes: `Image`, `Audio`, `Transcription`, `Embeddings`, `Reranking`, `Stores`\n- Provider enum: `Laravel\\Ai\\Enums\\Lab` (prefer over plain strings)\n- Artisan commands: `php artisan make:agent`, `php artisan make:tool`\n- Global helper: `agent()` for anonymous agents\n\n## OpenAI-Compatible Provider\n\nPoint the SDK at any OpenAI Chat Completions endpoint (LM Studio, vLLM, Together, etc.) with the config-driven `openai-compatible` driver. Define named instances in `config\u002Fai.php`, no code required:\n\n```php\n'my-llm' => [\n    'driver' => 'openai-compatible',\n    'url' => env('MY_LLM_URL'),        \u002F\u002F required\n    'key' => env('MY_LLM_API_KEY'),    \u002F\u002F optional Bearer token\n],\n```\n\nReference it by config key (or `Lab::OpenAiCompatible`). A model is required via `models.text.default` or per-call `model:`:\n\n```php\nagent()->prompt('Hello', provider: 'my-llm', model: 'some-model');\n```\n\nIt uses OpenAI-standard shapes and supports text, streaming, tools, structured output, and image attachments. For extra request-body fields, implement `HasProviderOptions` — the returned array is merged into the body.\n\n## Common Pitfalls\n\n### Wrong Namespace\n\nThe namespace is `Laravel\\Ai`, not `Illuminate\\Ai` or `Laravel\\AI`.\n\n```php\n\u002F\u002F Correct\nuse Laravel\\Ai\\Image;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Promptable;\n\n\u002F\u002F Wrong — these do not exist\nuse Illuminate\\Ai\\Image;\nuse Laravel\\AI\\Agent;\n```\n\n### Unsupported Provider Capability\n\nCalling a capability not supported by a provider throws a `LogicException`. Refer to the provider support table below.\n\n## Provider Support\n\n| Feature    | Providers                                                       |\n| ---------- | --------------------------------------------------------------- |\n| Text       | OpenAI, Anthropic, Gemini, Azure, Groq, xAI, DeepSeek, Mistral, Ollama, OpenRouter, OpenAI-compatible |\n| Images     | OpenAI, Gemini, xAI                                            |\n| TTS        | OpenAI, ElevenLabs                                              |\n| STT        | OpenAI, ElevenLabs, Mistral                                     |\n| Embeddings | OpenAI, Gemini, Azure, Cohere, Mistral, Jina, VoyageAI         |\n| Reranking  | Cohere, Jina                                                    |\n| Files      | OpenAI, Anthropic, Gemini                                       |\n\nUse the `Laravel\\Ai\\Enums\\Lab` enum to reference providers in code instead of plain strings:\n\n```php\nuse Laravel\\Ai\\Enums\\Lab;\n\nLab::Anthropic;\nLab::OpenAI;\nLab::Gemini;\nLab::OpenAiCompatible; \u002F\u002F configurable OpenAI Chat Completions endpoint\n\u002F\u002F ...\n```\n",{"data":35,"body":37},{"name":4,"description":6,"license":26,"metadata":36},{"author":8},{"type":38,"children":39},"root",[40,49,64,71,76,112,119,124,187,193,198,289,295,299,664,670,682,846,858,998,1004,1176,1181,1250,1256,1324,1330,1390,1396,1480,1485,1546,1552,1637,1643,1649,1763,1784,1804,1878,1884,1905,1993,1999,2083,2089,2176,2181,2195,2201,2214,2533,2539,2699,2705,2726,2783,2811,2825,2838,2844,2850,2877,2944,2950,2963,2969,3084,3096,3157],{"type":41,"tag":42,"props":43,"children":45},"element","h1",{"id":44},"developing-with-the-laravel-ai-sdk",[46],{"type":47,"value":48},"text","Developing with the Laravel AI SDK",{"type":41,"tag":50,"props":51,"children":52},"p",{},[53,55,62],{"type":47,"value":54},"The Laravel AI SDK (",{"type":41,"tag":56,"props":57,"children":59},"code",{"className":58},[],[60],{"type":47,"value":61},"laravel\u002Fai",{"type":47,"value":63},") is the official AI package for Laravel, providing a unified API for agents, images, audio, transcription, embeddings, reranking, vector stores, and file management across multiple AI providers.",{"type":41,"tag":65,"props":66,"children":68},"h2",{"id":67},"searching-the-documentation",[69],{"type":47,"value":70},"Searching the Documentation",{"type":41,"tag":50,"props":72,"children":73},{},[74],{"type":47,"value":75},"This package is new. Always search the documentation before implementing any feature. Never guess at APIs — the documentation is the single source of truth.",{"type":41,"tag":77,"props":78,"children":79},"ul",{},[80,86,107],{"type":41,"tag":81,"props":82,"children":83},"li",{},[84],{"type":47,"value":85},"Use broad, simple queries that match the documentation section headings below.",{"type":41,"tag":81,"props":87,"children":88},{},[89,91,97,99,105],{"type":47,"value":90},"Do not add package names to queries — package information is shared automatically. Use ",{"type":41,"tag":56,"props":92,"children":94},{"className":93},[],[95],{"type":47,"value":96},"test agent fake",{"type":47,"value":98},", not ",{"type":41,"tag":56,"props":100,"children":102},{"className":101},[],[103],{"type":47,"value":104},"laravel ai test agent fake",{"type":47,"value":106},".",{"type":41,"tag":81,"props":108,"children":109},{},[110],{"type":47,"value":111},"Run multiple queries at once — the most relevant results are returned first.",{"type":41,"tag":113,"props":114,"children":116},"h3",{"id":115},"documentation-sections",[117],{"type":47,"value":118},"Documentation Sections",{"type":41,"tag":50,"props":120,"children":121},{},[122],{"type":47,"value":123},"Use these section headings as query terms for accurate results:",{"type":41,"tag":77,"props":125,"children":126},{},[127,132,137,142,147,152,157,162,167,172,177,182],{"type":41,"tag":81,"props":128,"children":129},{},[130],{"type":47,"value":131},"Introduction, Installation, Configuration, Provider Support",{"type":41,"tag":81,"props":133,"children":134},{},[135],{"type":47,"value":136},"Agents: Prompting, Conversation Context, Structured Output, Attachments, Streaming, Broadcasting, Queueing, Tools, Provider Tools, Middleware, Anonymous Agents, Agent Configuration",{"type":41,"tag":81,"props":138,"children":139},{},[140],{"type":47,"value":141},"Images",{"type":41,"tag":81,"props":143,"children":144},{},[145],{"type":47,"value":146},"Audio (TTS)",{"type":41,"tag":81,"props":148,"children":149},{},[150],{"type":47,"value":151},"Transcription (STT)",{"type":41,"tag":81,"props":153,"children":154},{},[155],{"type":47,"value":156},"Embeddings: Querying Embeddings, Caching Embeddings",{"type":41,"tag":81,"props":158,"children":159},{},[160],{"type":47,"value":161},"Reranking",{"type":41,"tag":81,"props":163,"children":164},{},[165],{"type":47,"value":166},"Files",{"type":41,"tag":81,"props":168,"children":169},{},[170],{"type":47,"value":171},"Vector Stores: Adding Files to Stores",{"type":41,"tag":81,"props":173,"children":174},{},[175],{"type":47,"value":176},"Failover",{"type":41,"tag":81,"props":178,"children":179},{},[180],{"type":47,"value":181},"Testing: Agents, Images, Audio, Transcriptions, Embeddings, Reranking, Files, Vector Stores",{"type":41,"tag":81,"props":183,"children":184},{},[185],{"type":47,"value":186},"Events",{"type":41,"tag":65,"props":188,"children":190},{"id":189},"decision-workflow",[191],{"type":47,"value":192},"Decision Workflow",{"type":41,"tag":50,"props":194,"children":195},{},[196],{"type":47,"value":197},"Determine the right entry point before writing code:",{"type":41,"tag":50,"props":199,"children":200},{},[201,203,209,211,217,219,225,227,233,235,241,243,249,251,257,259,265,267,273,275,281,283],{"type":47,"value":202},"Text generation or chat? → Agent class with ",{"type":41,"tag":56,"props":204,"children":206},{"className":205},[],[207],{"type":47,"value":208},"Promptable",{"type":47,"value":210}," trait\nChat with conversation history? → Agent + ",{"type":41,"tag":56,"props":212,"children":214},{"className":213},[],[215],{"type":47,"value":216},"Conversational",{"type":47,"value":218}," interface (manual) or ",{"type":41,"tag":56,"props":220,"children":222},{"className":221},[],[223],{"type":47,"value":224},"RemembersConversations",{"type":47,"value":226}," trait (automatic)\nStructured JSON output? → Agent + ",{"type":41,"tag":56,"props":228,"children":230},{"className":229},[],[231],{"type":47,"value":232},"HasStructuredOutput",{"type":47,"value":234}," interface\nImage generation? → ",{"type":41,"tag":56,"props":236,"children":238},{"className":237},[],[239],{"type":47,"value":240},"Image::of()->generate()",{"type":47,"value":242},"\nAudio synthesis? → ",{"type":41,"tag":56,"props":244,"children":246},{"className":245},[],[247],{"type":47,"value":248},"Audio::of()->generate()",{"type":47,"value":250},"\nTranscription? → ",{"type":41,"tag":56,"props":252,"children":254},{"className":253},[],[255],{"type":47,"value":256},"Transcription::fromPath()->generate()",{"type":47,"value":258},"\nEmbeddings? → ",{"type":41,"tag":56,"props":260,"children":262},{"className":261},[],[263],{"type":47,"value":264},"Embeddings::for()->generate()",{"type":47,"value":266},"\nReranking? → ",{"type":41,"tag":56,"props":268,"children":270},{"className":269},[],[271],{"type":47,"value":272},"Reranking::of()->rerank()",{"type":47,"value":274},"\nFile storage? → ",{"type":41,"tag":56,"props":276,"children":278},{"className":277},[],[279],{"type":47,"value":280},"Document::fromPath()->put()",{"type":47,"value":282},"\nVector stores? → ",{"type":41,"tag":56,"props":284,"children":286},{"className":285},[],[287],{"type":47,"value":288},"Stores::create()",{"type":41,"tag":65,"props":290,"children":292},{"id":291},"basic-usage-examples",[293],{"type":47,"value":294},"Basic Usage Examples",{"type":41,"tag":113,"props":296,"children":297},{"id":19},[298],{"type":47,"value":18},{"type":41,"tag":300,"props":301,"children":305},"pre",{"className":302,"code":303,"language":14,"meta":304,"style":304},"language-php shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","use Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Enums\\Lab;\nuse Laravel\\Ai\\Promptable;\n\nclass SalesCoach implements Agent\n{\n    use Promptable;\n\n    public function instructions(): string\n    {\n        return 'You are a sales coach.';\n    }\n}\n\n\u002F\u002F Prompting\n$response = (new SalesCoach)->prompt('Analyze this transcript...');\necho $response->text;\n\n\u002F\u002F Container resolution with dependency injection\n$agent = SalesCoach::make(user: $user);\n\n\u002F\u002F Override provider, model, or timeout per-prompt\n$response = (new SalesCoach)->prompt(\n    'Analyze this transcript...',\n    provider: Lab::Anthropic,\n    model: 'claude-haiku-4-5-20251001',\n    timeout: 120,\n);\n\n\u002F\u002F Streaming (returns SSE response from a route)\nreturn (new SalesCoach)->stream('Analyze this transcript...');\n\n\u002F\u002F Queueing\n(new SalesCoach)->queue('Analyze this transcript...')\n    ->then(fn ($response) => \u002F* ... *\u002F);\n\n\u002F\u002F Anonymous agents\nuse function Laravel\\Ai\\{agent};\n\n$response = agent(instructions: 'You are a helpful assistant.')->prompt('Hello');\n","",[306],{"type":41,"tag":56,"props":307,"children":308},{"__ignoreMap":304},[309,320,329,338,348,357,366,375,383,392,401,410,419,428,436,445,454,463,471,480,489,497,506,515,524,533,542,551,560,568,577,586,594,603,612,621,629,638,647,655],{"type":41,"tag":310,"props":311,"children":314},"span",{"class":312,"line":313},"line",1,[315],{"type":41,"tag":310,"props":316,"children":317},{},[318],{"type":47,"value":319},"use Laravel\\Ai\\Contracts\\Agent;\n",{"type":41,"tag":310,"props":321,"children":323},{"class":312,"line":322},2,[324],{"type":41,"tag":310,"props":325,"children":326},{},[327],{"type":47,"value":328},"use Laravel\\Ai\\Enums\\Lab;\n",{"type":41,"tag":310,"props":330,"children":332},{"class":312,"line":331},3,[333],{"type":41,"tag":310,"props":334,"children":335},{},[336],{"type":47,"value":337},"use Laravel\\Ai\\Promptable;\n",{"type":41,"tag":310,"props":339,"children":341},{"class":312,"line":340},4,[342],{"type":41,"tag":310,"props":343,"children":345},{"emptyLinePlaceholder":344},true,[346],{"type":47,"value":347},"\n",{"type":41,"tag":310,"props":349,"children":351},{"class":312,"line":350},5,[352],{"type":41,"tag":310,"props":353,"children":354},{},[355],{"type":47,"value":356},"class SalesCoach implements Agent\n",{"type":41,"tag":310,"props":358,"children":360},{"class":312,"line":359},6,[361],{"type":41,"tag":310,"props":362,"children":363},{},[364],{"type":47,"value":365},"{\n",{"type":41,"tag":310,"props":367,"children":369},{"class":312,"line":368},7,[370],{"type":41,"tag":310,"props":371,"children":372},{},[373],{"type":47,"value":374},"    use Promptable;\n",{"type":41,"tag":310,"props":376,"children":378},{"class":312,"line":377},8,[379],{"type":41,"tag":310,"props":380,"children":381},{"emptyLinePlaceholder":344},[382],{"type":47,"value":347},{"type":41,"tag":310,"props":384,"children":386},{"class":312,"line":385},9,[387],{"type":41,"tag":310,"props":388,"children":389},{},[390],{"type":47,"value":391},"    public function instructions(): string\n",{"type":41,"tag":310,"props":393,"children":395},{"class":312,"line":394},10,[396],{"type":41,"tag":310,"props":397,"children":398},{},[399],{"type":47,"value":400},"    {\n",{"type":41,"tag":310,"props":402,"children":404},{"class":312,"line":403},11,[405],{"type":41,"tag":310,"props":406,"children":407},{},[408],{"type":47,"value":409},"        return 'You are a sales coach.';\n",{"type":41,"tag":310,"props":411,"children":413},{"class":312,"line":412},12,[414],{"type":41,"tag":310,"props":415,"children":416},{},[417],{"type":47,"value":418},"    }\n",{"type":41,"tag":310,"props":420,"children":422},{"class":312,"line":421},13,[423],{"type":41,"tag":310,"props":424,"children":425},{},[426],{"type":47,"value":427},"}\n",{"type":41,"tag":310,"props":429,"children":431},{"class":312,"line":430},14,[432],{"type":41,"tag":310,"props":433,"children":434},{"emptyLinePlaceholder":344},[435],{"type":47,"value":347},{"type":41,"tag":310,"props":437,"children":439},{"class":312,"line":438},15,[440],{"type":41,"tag":310,"props":441,"children":442},{},[443],{"type":47,"value":444},"\u002F\u002F Prompting\n",{"type":41,"tag":310,"props":446,"children":448},{"class":312,"line":447},16,[449],{"type":41,"tag":310,"props":450,"children":451},{},[452],{"type":47,"value":453},"$response = (new SalesCoach)->prompt('Analyze this transcript...');\n",{"type":41,"tag":310,"props":455,"children":457},{"class":312,"line":456},17,[458],{"type":41,"tag":310,"props":459,"children":460},{},[461],{"type":47,"value":462},"echo $response->text;\n",{"type":41,"tag":310,"props":464,"children":466},{"class":312,"line":465},18,[467],{"type":41,"tag":310,"props":468,"children":469},{"emptyLinePlaceholder":344},[470],{"type":47,"value":347},{"type":41,"tag":310,"props":472,"children":474},{"class":312,"line":473},19,[475],{"type":41,"tag":310,"props":476,"children":477},{},[478],{"type":47,"value":479},"\u002F\u002F Container resolution with dependency injection\n",{"type":41,"tag":310,"props":481,"children":483},{"class":312,"line":482},20,[484],{"type":41,"tag":310,"props":485,"children":486},{},[487],{"type":47,"value":488},"$agent = SalesCoach::make(user: $user);\n",{"type":41,"tag":310,"props":490,"children":492},{"class":312,"line":491},21,[493],{"type":41,"tag":310,"props":494,"children":495},{"emptyLinePlaceholder":344},[496],{"type":47,"value":347},{"type":41,"tag":310,"props":498,"children":500},{"class":312,"line":499},22,[501],{"type":41,"tag":310,"props":502,"children":503},{},[504],{"type":47,"value":505},"\u002F\u002F Override provider, model, or timeout per-prompt\n",{"type":41,"tag":310,"props":507,"children":509},{"class":312,"line":508},23,[510],{"type":41,"tag":310,"props":511,"children":512},{},[513],{"type":47,"value":514},"$response = (new SalesCoach)->prompt(\n",{"type":41,"tag":310,"props":516,"children":518},{"class":312,"line":517},24,[519],{"type":41,"tag":310,"props":520,"children":521},{},[522],{"type":47,"value":523},"    'Analyze this transcript...',\n",{"type":41,"tag":310,"props":525,"children":527},{"class":312,"line":526},25,[528],{"type":41,"tag":310,"props":529,"children":530},{},[531],{"type":47,"value":532},"    provider: Lab::Anthropic,\n",{"type":41,"tag":310,"props":534,"children":536},{"class":312,"line":535},26,[537],{"type":41,"tag":310,"props":538,"children":539},{},[540],{"type":47,"value":541},"    model: 'claude-haiku-4-5-20251001',\n",{"type":41,"tag":310,"props":543,"children":545},{"class":312,"line":544},27,[546],{"type":41,"tag":310,"props":547,"children":548},{},[549],{"type":47,"value":550},"    timeout: 120,\n",{"type":41,"tag":310,"props":552,"children":554},{"class":312,"line":553},28,[555],{"type":41,"tag":310,"props":556,"children":557},{},[558],{"type":47,"value":559},");\n",{"type":41,"tag":310,"props":561,"children":563},{"class":312,"line":562},29,[564],{"type":41,"tag":310,"props":565,"children":566},{"emptyLinePlaceholder":344},[567],{"type":47,"value":347},{"type":41,"tag":310,"props":569,"children":571},{"class":312,"line":570},30,[572],{"type":41,"tag":310,"props":573,"children":574},{},[575],{"type":47,"value":576},"\u002F\u002F Streaming (returns SSE response from a route)\n",{"type":41,"tag":310,"props":578,"children":580},{"class":312,"line":579},31,[581],{"type":41,"tag":310,"props":582,"children":583},{},[584],{"type":47,"value":585},"return (new SalesCoach)->stream('Analyze this transcript...');\n",{"type":41,"tag":310,"props":587,"children":589},{"class":312,"line":588},32,[590],{"type":41,"tag":310,"props":591,"children":592},{"emptyLinePlaceholder":344},[593],{"type":47,"value":347},{"type":41,"tag":310,"props":595,"children":597},{"class":312,"line":596},33,[598],{"type":41,"tag":310,"props":599,"children":600},{},[601],{"type":47,"value":602},"\u002F\u002F Queueing\n",{"type":41,"tag":310,"props":604,"children":606},{"class":312,"line":605},34,[607],{"type":41,"tag":310,"props":608,"children":609},{},[610],{"type":47,"value":611},"(new SalesCoach)->queue('Analyze this transcript...')\n",{"type":41,"tag":310,"props":613,"children":615},{"class":312,"line":614},35,[616],{"type":41,"tag":310,"props":617,"children":618},{},[619],{"type":47,"value":620},"    ->then(fn ($response) => \u002F* ... *\u002F);\n",{"type":41,"tag":310,"props":622,"children":624},{"class":312,"line":623},36,[625],{"type":41,"tag":310,"props":626,"children":627},{"emptyLinePlaceholder":344},[628],{"type":47,"value":347},{"type":41,"tag":310,"props":630,"children":632},{"class":312,"line":631},37,[633],{"type":41,"tag":310,"props":634,"children":635},{},[636],{"type":47,"value":637},"\u002F\u002F Anonymous agents\n",{"type":41,"tag":310,"props":639,"children":641},{"class":312,"line":640},38,[642],{"type":41,"tag":310,"props":643,"children":644},{},[645],{"type":47,"value":646},"use function Laravel\\Ai\\{agent};\n",{"type":41,"tag":310,"props":648,"children":650},{"class":312,"line":649},39,[651],{"type":41,"tag":310,"props":652,"children":653},{"emptyLinePlaceholder":344},[654],{"type":47,"value":347},{"type":41,"tag":310,"props":656,"children":658},{"class":312,"line":657},40,[659],{"type":41,"tag":310,"props":660,"children":661},{},[662],{"type":47,"value":663},"$response = agent(instructions: 'You are a helpful assistant.')->prompt('Hello');\n",{"type":41,"tag":113,"props":665,"children":667},{"id":666},"conversation-context",[668],{"type":47,"value":669},"Conversation Context",{"type":41,"tag":50,"props":671,"children":672},{},[673,675,680],{"type":47,"value":674},"Manual conversation history via the ",{"type":41,"tag":56,"props":676,"children":678},{"className":677},[],[679],{"type":47,"value":216},{"type":47,"value":681}," interface:",{"type":41,"tag":300,"props":683,"children":685},{"className":302,"code":684,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\Conversational;\nuse Laravel\\Ai\\Messages\\Message;\nuse Laravel\\Ai\\Promptable;\n\nclass SalesCoach implements Agent, Conversational\n{\n    use Promptable;\n\n    public function __construct(public User $user) {}\n\n    public function instructions(): string { return 'You are a sales coach.'; }\n\n    public function messages(): iterable\n    {\n        return History::where('user_id', $this->user->id)\n            ->latest()->limit(50)->get()->reverse()\n            ->map(fn ($m) => new Message($m->role, $m->content))\n            ->all();\n    }\n}\n",[686],{"type":41,"tag":56,"props":687,"children":688},{"__ignoreMap":304},[689,696,704,712,719,726,734,741,748,755,763,770,778,785,793,800,808,816,824,832,839],{"type":41,"tag":310,"props":690,"children":691},{"class":312,"line":313},[692],{"type":41,"tag":310,"props":693,"children":694},{},[695],{"type":47,"value":319},{"type":41,"tag":310,"props":697,"children":698},{"class":312,"line":322},[699],{"type":41,"tag":310,"props":700,"children":701},{},[702],{"type":47,"value":703},"use Laravel\\Ai\\Contracts\\Conversational;\n",{"type":41,"tag":310,"props":705,"children":706},{"class":312,"line":331},[707],{"type":41,"tag":310,"props":708,"children":709},{},[710],{"type":47,"value":711},"use Laravel\\Ai\\Messages\\Message;\n",{"type":41,"tag":310,"props":713,"children":714},{"class":312,"line":340},[715],{"type":41,"tag":310,"props":716,"children":717},{},[718],{"type":47,"value":337},{"type":41,"tag":310,"props":720,"children":721},{"class":312,"line":350},[722],{"type":41,"tag":310,"props":723,"children":724},{"emptyLinePlaceholder":344},[725],{"type":47,"value":347},{"type":41,"tag":310,"props":727,"children":728},{"class":312,"line":359},[729],{"type":41,"tag":310,"props":730,"children":731},{},[732],{"type":47,"value":733},"class SalesCoach implements Agent, Conversational\n",{"type":41,"tag":310,"props":735,"children":736},{"class":312,"line":368},[737],{"type":41,"tag":310,"props":738,"children":739},{},[740],{"type":47,"value":365},{"type":41,"tag":310,"props":742,"children":743},{"class":312,"line":377},[744],{"type":41,"tag":310,"props":745,"children":746},{},[747],{"type":47,"value":374},{"type":41,"tag":310,"props":749,"children":750},{"class":312,"line":385},[751],{"type":41,"tag":310,"props":752,"children":753},{"emptyLinePlaceholder":344},[754],{"type":47,"value":347},{"type":41,"tag":310,"props":756,"children":757},{"class":312,"line":394},[758],{"type":41,"tag":310,"props":759,"children":760},{},[761],{"type":47,"value":762},"    public function __construct(public User $user) {}\n",{"type":41,"tag":310,"props":764,"children":765},{"class":312,"line":403},[766],{"type":41,"tag":310,"props":767,"children":768},{"emptyLinePlaceholder":344},[769],{"type":47,"value":347},{"type":41,"tag":310,"props":771,"children":772},{"class":312,"line":412},[773],{"type":41,"tag":310,"props":774,"children":775},{},[776],{"type":47,"value":777},"    public function instructions(): string { return 'You are a sales coach.'; }\n",{"type":41,"tag":310,"props":779,"children":780},{"class":312,"line":421},[781],{"type":41,"tag":310,"props":782,"children":783},{"emptyLinePlaceholder":344},[784],{"type":47,"value":347},{"type":41,"tag":310,"props":786,"children":787},{"class":312,"line":430},[788],{"type":41,"tag":310,"props":789,"children":790},{},[791],{"type":47,"value":792},"    public function messages(): iterable\n",{"type":41,"tag":310,"props":794,"children":795},{"class":312,"line":438},[796],{"type":41,"tag":310,"props":797,"children":798},{},[799],{"type":47,"value":400},{"type":41,"tag":310,"props":801,"children":802},{"class":312,"line":447},[803],{"type":41,"tag":310,"props":804,"children":805},{},[806],{"type":47,"value":807},"        return History::where('user_id', $this->user->id)\n",{"type":41,"tag":310,"props":809,"children":810},{"class":312,"line":456},[811],{"type":41,"tag":310,"props":812,"children":813},{},[814],{"type":47,"value":815},"            ->latest()->limit(50)->get()->reverse()\n",{"type":41,"tag":310,"props":817,"children":818},{"class":312,"line":465},[819],{"type":41,"tag":310,"props":820,"children":821},{},[822],{"type":47,"value":823},"            ->map(fn ($m) => new Message($m->role, $m->content))\n",{"type":41,"tag":310,"props":825,"children":826},{"class":312,"line":473},[827],{"type":41,"tag":310,"props":828,"children":829},{},[830],{"type":47,"value":831},"            ->all();\n",{"type":41,"tag":310,"props":833,"children":834},{"class":312,"line":482},[835],{"type":41,"tag":310,"props":836,"children":837},{},[838],{"type":47,"value":418},{"type":41,"tag":310,"props":840,"children":841},{"class":312,"line":491},[842],{"type":41,"tag":310,"props":843,"children":844},{},[845],{"type":47,"value":427},{"type":41,"tag":50,"props":847,"children":848},{},[849,851,856],{"type":47,"value":850},"Automatic conversation persistence via the ",{"type":41,"tag":56,"props":852,"children":854},{"className":853},[],[855],{"type":47,"value":224},{"type":47,"value":857}," trait:",{"type":41,"tag":300,"props":859,"children":861},{"className":302,"code":860,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Concerns\\RemembersConversations;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\Conversational;\nuse Laravel\\Ai\\Promptable;\n\nclass SalesCoach implements Agent, Conversational\n{\n    use Promptable, RemembersConversations;\n\n    public function instructions(): string { return 'You are a sales coach.'; }\n}\n\n\u002F\u002F Start a new conversation\n$response = (new SalesCoach)->forUser($user)->prompt('Hello!');\n$conversationId = $response->conversationId;\n\n\u002F\u002F Continue an existing conversation\n$response = (new SalesCoach)->continue($conversationId, as: $user)->prompt('Tell me more.');\n",[862],{"type":41,"tag":56,"props":863,"children":864},{"__ignoreMap":304},[865,873,880,887,894,901,908,915,923,930,937,944,951,959,967,975,982,990],{"type":41,"tag":310,"props":866,"children":867},{"class":312,"line":313},[868],{"type":41,"tag":310,"props":869,"children":870},{},[871],{"type":47,"value":872},"use Laravel\\Ai\\Concerns\\RemembersConversations;\n",{"type":41,"tag":310,"props":874,"children":875},{"class":312,"line":322},[876],{"type":41,"tag":310,"props":877,"children":878},{},[879],{"type":47,"value":319},{"type":41,"tag":310,"props":881,"children":882},{"class":312,"line":331},[883],{"type":41,"tag":310,"props":884,"children":885},{},[886],{"type":47,"value":703},{"type":41,"tag":310,"props":888,"children":889},{"class":312,"line":340},[890],{"type":41,"tag":310,"props":891,"children":892},{},[893],{"type":47,"value":337},{"type":41,"tag":310,"props":895,"children":896},{"class":312,"line":350},[897],{"type":41,"tag":310,"props":898,"children":899},{"emptyLinePlaceholder":344},[900],{"type":47,"value":347},{"type":41,"tag":310,"props":902,"children":903},{"class":312,"line":359},[904],{"type":41,"tag":310,"props":905,"children":906},{},[907],{"type":47,"value":733},{"type":41,"tag":310,"props":909,"children":910},{"class":312,"line":368},[911],{"type":41,"tag":310,"props":912,"children":913},{},[914],{"type":47,"value":365},{"type":41,"tag":310,"props":916,"children":917},{"class":312,"line":377},[918],{"type":41,"tag":310,"props":919,"children":920},{},[921],{"type":47,"value":922},"    use Promptable, RemembersConversations;\n",{"type":41,"tag":310,"props":924,"children":925},{"class":312,"line":385},[926],{"type":41,"tag":310,"props":927,"children":928},{"emptyLinePlaceholder":344},[929],{"type":47,"value":347},{"type":41,"tag":310,"props":931,"children":932},{"class":312,"line":394},[933],{"type":41,"tag":310,"props":934,"children":935},{},[936],{"type":47,"value":777},{"type":41,"tag":310,"props":938,"children":939},{"class":312,"line":403},[940],{"type":41,"tag":310,"props":941,"children":942},{},[943],{"type":47,"value":427},{"type":41,"tag":310,"props":945,"children":946},{"class":312,"line":412},[947],{"type":41,"tag":310,"props":948,"children":949},{"emptyLinePlaceholder":344},[950],{"type":47,"value":347},{"type":41,"tag":310,"props":952,"children":953},{"class":312,"line":421},[954],{"type":41,"tag":310,"props":955,"children":956},{},[957],{"type":47,"value":958},"\u002F\u002F Start a new conversation\n",{"type":41,"tag":310,"props":960,"children":961},{"class":312,"line":430},[962],{"type":41,"tag":310,"props":963,"children":964},{},[965],{"type":47,"value":966},"$response = (new SalesCoach)->forUser($user)->prompt('Hello!');\n",{"type":41,"tag":310,"props":968,"children":969},{"class":312,"line":438},[970],{"type":41,"tag":310,"props":971,"children":972},{},[973],{"type":47,"value":974},"$conversationId = $response->conversationId;\n",{"type":41,"tag":310,"props":976,"children":977},{"class":312,"line":447},[978],{"type":41,"tag":310,"props":979,"children":980},{"emptyLinePlaceholder":344},[981],{"type":47,"value":347},{"type":41,"tag":310,"props":983,"children":984},{"class":312,"line":456},[985],{"type":41,"tag":310,"props":986,"children":987},{},[988],{"type":47,"value":989},"\u002F\u002F Continue an existing conversation\n",{"type":41,"tag":310,"props":991,"children":992},{"class":312,"line":465},[993],{"type":41,"tag":310,"props":994,"children":995},{},[996],{"type":47,"value":997},"$response = (new SalesCoach)->continue($conversationId, as: $user)->prompt('Tell me more.');\n",{"type":41,"tag":113,"props":999,"children":1001},{"id":1000},"structured-output",[1002],{"type":47,"value":1003},"Structured Output",{"type":41,"tag":300,"props":1005,"children":1007},{"className":302,"code":1006,"language":14,"meta":304,"style":304},"use Illuminate\\Contracts\\JsonSchema\\JsonSchema;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Contracts\\HasStructuredOutput;\nuse Laravel\\Ai\\Promptable;\n\nclass Reviewer implements Agent, HasStructuredOutput\n{\n    use Promptable;\n\n    public function instructions(): string { return 'Review and score content.'; }\n\n    public function schema(JsonSchema $schema): array\n    {\n        return [\n            'feedback' => $schema->string()->required(),\n            'score' => $schema->integer()->min(1)->max(10)->required(),\n        ];\n    }\n}\n\n$response = (new Reviewer)->prompt('Review this...');\necho $response['score']; \u002F\u002F Access like an array\n",[1008],{"type":41,"tag":56,"props":1009,"children":1010},{"__ignoreMap":304},[1011,1019,1026,1034,1041,1048,1056,1063,1070,1077,1085,1092,1100,1107,1115,1123,1131,1139,1146,1153,1160,1168],{"type":41,"tag":310,"props":1012,"children":1013},{"class":312,"line":313},[1014],{"type":41,"tag":310,"props":1015,"children":1016},{},[1017],{"type":47,"value":1018},"use Illuminate\\Contracts\\JsonSchema\\JsonSchema;\n",{"type":41,"tag":310,"props":1020,"children":1021},{"class":312,"line":322},[1022],{"type":41,"tag":310,"props":1023,"children":1024},{},[1025],{"type":47,"value":319},{"type":41,"tag":310,"props":1027,"children":1028},{"class":312,"line":331},[1029],{"type":41,"tag":310,"props":1030,"children":1031},{},[1032],{"type":47,"value":1033},"use Laravel\\Ai\\Contracts\\HasStructuredOutput;\n",{"type":41,"tag":310,"props":1035,"children":1036},{"class":312,"line":340},[1037],{"type":41,"tag":310,"props":1038,"children":1039},{},[1040],{"type":47,"value":337},{"type":41,"tag":310,"props":1042,"children":1043},{"class":312,"line":350},[1044],{"type":41,"tag":310,"props":1045,"children":1046},{"emptyLinePlaceholder":344},[1047],{"type":47,"value":347},{"type":41,"tag":310,"props":1049,"children":1050},{"class":312,"line":359},[1051],{"type":41,"tag":310,"props":1052,"children":1053},{},[1054],{"type":47,"value":1055},"class Reviewer implements Agent, HasStructuredOutput\n",{"type":41,"tag":310,"props":1057,"children":1058},{"class":312,"line":368},[1059],{"type":41,"tag":310,"props":1060,"children":1061},{},[1062],{"type":47,"value":365},{"type":41,"tag":310,"props":1064,"children":1065},{"class":312,"line":377},[1066],{"type":41,"tag":310,"props":1067,"children":1068},{},[1069],{"type":47,"value":374},{"type":41,"tag":310,"props":1071,"children":1072},{"class":312,"line":385},[1073],{"type":41,"tag":310,"props":1074,"children":1075},{"emptyLinePlaceholder":344},[1076],{"type":47,"value":347},{"type":41,"tag":310,"props":1078,"children":1079},{"class":312,"line":394},[1080],{"type":41,"tag":310,"props":1081,"children":1082},{},[1083],{"type":47,"value":1084},"    public function instructions(): string { return 'Review and score content.'; }\n",{"type":41,"tag":310,"props":1086,"children":1087},{"class":312,"line":403},[1088],{"type":41,"tag":310,"props":1089,"children":1090},{"emptyLinePlaceholder":344},[1091],{"type":47,"value":347},{"type":41,"tag":310,"props":1093,"children":1094},{"class":312,"line":412},[1095],{"type":41,"tag":310,"props":1096,"children":1097},{},[1098],{"type":47,"value":1099},"    public function schema(JsonSchema $schema): array\n",{"type":41,"tag":310,"props":1101,"children":1102},{"class":312,"line":421},[1103],{"type":41,"tag":310,"props":1104,"children":1105},{},[1106],{"type":47,"value":400},{"type":41,"tag":310,"props":1108,"children":1109},{"class":312,"line":430},[1110],{"type":41,"tag":310,"props":1111,"children":1112},{},[1113],{"type":47,"value":1114},"        return [\n",{"type":41,"tag":310,"props":1116,"children":1117},{"class":312,"line":438},[1118],{"type":41,"tag":310,"props":1119,"children":1120},{},[1121],{"type":47,"value":1122},"            'feedback' => $schema->string()->required(),\n",{"type":41,"tag":310,"props":1124,"children":1125},{"class":312,"line":447},[1126],{"type":41,"tag":310,"props":1127,"children":1128},{},[1129],{"type":47,"value":1130},"            'score' => $schema->integer()->min(1)->max(10)->required(),\n",{"type":41,"tag":310,"props":1132,"children":1133},{"class":312,"line":456},[1134],{"type":41,"tag":310,"props":1135,"children":1136},{},[1137],{"type":47,"value":1138},"        ];\n",{"type":41,"tag":310,"props":1140,"children":1141},{"class":312,"line":465},[1142],{"type":41,"tag":310,"props":1143,"children":1144},{},[1145],{"type":47,"value":418},{"type":41,"tag":310,"props":1147,"children":1148},{"class":312,"line":473},[1149],{"type":41,"tag":310,"props":1150,"children":1151},{},[1152],{"type":47,"value":427},{"type":41,"tag":310,"props":1154,"children":1155},{"class":312,"line":482},[1156],{"type":41,"tag":310,"props":1157,"children":1158},{"emptyLinePlaceholder":344},[1159],{"type":47,"value":347},{"type":41,"tag":310,"props":1161,"children":1162},{"class":312,"line":491},[1163],{"type":41,"tag":310,"props":1164,"children":1165},{},[1166],{"type":47,"value":1167},"$response = (new Reviewer)->prompt('Review this...');\n",{"type":41,"tag":310,"props":1169,"children":1170},{"class":312,"line":499},[1171],{"type":41,"tag":310,"props":1172,"children":1173},{},[1174],{"type":47,"value":1175},"echo $response['score']; \u002F\u002F Access like an array\n",{"type":41,"tag":113,"props":1177,"children":1179},{"id":1178},"images",[1180],{"type":47,"value":141},{"type":41,"tag":300,"props":1182,"children":1184},{"className":302,"code":1183,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Image;\n\n$image = Image::of('A sunset over mountains')\n    ->landscape()\n    ->quality('high')\n    ->generate();\n\n$path = $image->store(); \u002F\u002F Store to default disk\n",[1185],{"type":41,"tag":56,"props":1186,"children":1187},{"__ignoreMap":304},[1188,1196,1203,1211,1219,1227,1235,1242],{"type":41,"tag":310,"props":1189,"children":1190},{"class":312,"line":313},[1191],{"type":41,"tag":310,"props":1192,"children":1193},{},[1194],{"type":47,"value":1195},"use Laravel\\Ai\\Image;\n",{"type":41,"tag":310,"props":1197,"children":1198},{"class":312,"line":322},[1199],{"type":41,"tag":310,"props":1200,"children":1201},{"emptyLinePlaceholder":344},[1202],{"type":47,"value":347},{"type":41,"tag":310,"props":1204,"children":1205},{"class":312,"line":331},[1206],{"type":41,"tag":310,"props":1207,"children":1208},{},[1209],{"type":47,"value":1210},"$image = Image::of('A sunset over mountains')\n",{"type":41,"tag":310,"props":1212,"children":1213},{"class":312,"line":340},[1214],{"type":41,"tag":310,"props":1215,"children":1216},{},[1217],{"type":47,"value":1218},"    ->landscape()\n",{"type":41,"tag":310,"props":1220,"children":1221},{"class":312,"line":350},[1222],{"type":41,"tag":310,"props":1223,"children":1224},{},[1225],{"type":47,"value":1226},"    ->quality('high')\n",{"type":41,"tag":310,"props":1228,"children":1229},{"class":312,"line":359},[1230],{"type":41,"tag":310,"props":1231,"children":1232},{},[1233],{"type":47,"value":1234},"    ->generate();\n",{"type":41,"tag":310,"props":1236,"children":1237},{"class":312,"line":368},[1238],{"type":41,"tag":310,"props":1239,"children":1240},{"emptyLinePlaceholder":344},[1241],{"type":47,"value":347},{"type":41,"tag":310,"props":1243,"children":1244},{"class":312,"line":377},[1245],{"type":41,"tag":310,"props":1246,"children":1247},{},[1248],{"type":47,"value":1249},"$path = $image->store(); \u002F\u002F Store to default disk\n",{"type":41,"tag":113,"props":1251,"children":1253},{"id":1252},"audio",[1254],{"type":47,"value":1255},"Audio",{"type":41,"tag":300,"props":1257,"children":1259},{"className":302,"code":1258,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Audio;\n\n$audio = Audio::of('Hello from Laravel.')\n    ->female()\n    ->instructions('Speak warmly')\n    ->generate();\n\n$path = $audio->store();\n",[1260],{"type":41,"tag":56,"props":1261,"children":1262},{"__ignoreMap":304},[1263,1271,1278,1286,1294,1302,1309,1316],{"type":41,"tag":310,"props":1264,"children":1265},{"class":312,"line":313},[1266],{"type":41,"tag":310,"props":1267,"children":1268},{},[1269],{"type":47,"value":1270},"use Laravel\\Ai\\Audio;\n",{"type":41,"tag":310,"props":1272,"children":1273},{"class":312,"line":322},[1274],{"type":41,"tag":310,"props":1275,"children":1276},{"emptyLinePlaceholder":344},[1277],{"type":47,"value":347},{"type":41,"tag":310,"props":1279,"children":1280},{"class":312,"line":331},[1281],{"type":41,"tag":310,"props":1282,"children":1283},{},[1284],{"type":47,"value":1285},"$audio = Audio::of('Hello from Laravel.')\n",{"type":41,"tag":310,"props":1287,"children":1288},{"class":312,"line":340},[1289],{"type":41,"tag":310,"props":1290,"children":1291},{},[1292],{"type":47,"value":1293},"    ->female()\n",{"type":41,"tag":310,"props":1295,"children":1296},{"class":312,"line":350},[1297],{"type":41,"tag":310,"props":1298,"children":1299},{},[1300],{"type":47,"value":1301},"    ->instructions('Speak warmly')\n",{"type":41,"tag":310,"props":1303,"children":1304},{"class":312,"line":359},[1305],{"type":41,"tag":310,"props":1306,"children":1307},{},[1308],{"type":47,"value":1234},{"type":41,"tag":310,"props":1310,"children":1311},{"class":312,"line":368},[1312],{"type":41,"tag":310,"props":1313,"children":1314},{"emptyLinePlaceholder":344},[1315],{"type":47,"value":347},{"type":41,"tag":310,"props":1317,"children":1318},{"class":312,"line":377},[1319],{"type":41,"tag":310,"props":1320,"children":1321},{},[1322],{"type":47,"value":1323},"$path = $audio->store();\n",{"type":41,"tag":113,"props":1325,"children":1327},{"id":1326},"transcription",[1328],{"type":47,"value":1329},"Transcription",{"type":41,"tag":300,"props":1331,"children":1333},{"className":302,"code":1332,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Transcription;\n\n$transcript = Transcription::fromStorage('audio.mp3')\n    ->diarize()\n    ->generate();\n\necho (string) $transcript;\n",[1334],{"type":41,"tag":56,"props":1335,"children":1336},{"__ignoreMap":304},[1337,1345,1352,1360,1368,1375,1382],{"type":41,"tag":310,"props":1338,"children":1339},{"class":312,"line":313},[1340],{"type":41,"tag":310,"props":1341,"children":1342},{},[1343],{"type":47,"value":1344},"use Laravel\\Ai\\Transcription;\n",{"type":41,"tag":310,"props":1346,"children":1347},{"class":312,"line":322},[1348],{"type":41,"tag":310,"props":1349,"children":1350},{"emptyLinePlaceholder":344},[1351],{"type":47,"value":347},{"type":41,"tag":310,"props":1353,"children":1354},{"class":312,"line":331},[1355],{"type":41,"tag":310,"props":1356,"children":1357},{},[1358],{"type":47,"value":1359},"$transcript = Transcription::fromStorage('audio.mp3')\n",{"type":41,"tag":310,"props":1361,"children":1362},{"class":312,"line":340},[1363],{"type":41,"tag":310,"props":1364,"children":1365},{},[1366],{"type":47,"value":1367},"    ->diarize()\n",{"type":41,"tag":310,"props":1369,"children":1370},{"class":312,"line":350},[1371],{"type":41,"tag":310,"props":1372,"children":1373},{},[1374],{"type":47,"value":1234},{"type":41,"tag":310,"props":1376,"children":1377},{"class":312,"line":359},[1378],{"type":41,"tag":310,"props":1379,"children":1380},{"emptyLinePlaceholder":344},[1381],{"type":47,"value":347},{"type":41,"tag":310,"props":1383,"children":1384},{"class":312,"line":368},[1385],{"type":41,"tag":310,"props":1386,"children":1387},{},[1388],{"type":47,"value":1389},"echo (string) $transcript;\n",{"type":41,"tag":113,"props":1391,"children":1393},{"id":1392},"embeddings",[1394],{"type":47,"value":1395},"Embeddings",{"type":41,"tag":300,"props":1397,"children":1399},{"className":302,"code":1398,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Embeddings;\nuse Illuminate\\Support\\Str;\n\n$response = Embeddings::for(['Text one', 'Text two'])\n    ->dimensions(1536)\n    ->cache()\n    ->generate();\n\n\u002F\u002F Single string via Stringable\n$embedding = Str::of('Napa Valley has great wine.')->toEmbeddings();\n",[1400],{"type":41,"tag":56,"props":1401,"children":1402},{"__ignoreMap":304},[1403,1411,1419,1426,1434,1442,1450,1457,1464,1472],{"type":41,"tag":310,"props":1404,"children":1405},{"class":312,"line":313},[1406],{"type":41,"tag":310,"props":1407,"children":1408},{},[1409],{"type":47,"value":1410},"use Laravel\\Ai\\Embeddings;\n",{"type":41,"tag":310,"props":1412,"children":1413},{"class":312,"line":322},[1414],{"type":41,"tag":310,"props":1415,"children":1416},{},[1417],{"type":47,"value":1418},"use Illuminate\\Support\\Str;\n",{"type":41,"tag":310,"props":1420,"children":1421},{"class":312,"line":331},[1422],{"type":41,"tag":310,"props":1423,"children":1424},{"emptyLinePlaceholder":344},[1425],{"type":47,"value":347},{"type":41,"tag":310,"props":1427,"children":1428},{"class":312,"line":340},[1429],{"type":41,"tag":310,"props":1430,"children":1431},{},[1432],{"type":47,"value":1433},"$response = Embeddings::for(['Text one', 'Text two'])\n",{"type":41,"tag":310,"props":1435,"children":1436},{"class":312,"line":350},[1437],{"type":41,"tag":310,"props":1438,"children":1439},{},[1440],{"type":47,"value":1441},"    ->dimensions(1536)\n",{"type":41,"tag":310,"props":1443,"children":1444},{"class":312,"line":359},[1445],{"type":41,"tag":310,"props":1446,"children":1447},{},[1448],{"type":47,"value":1449},"    ->cache()\n",{"type":41,"tag":310,"props":1451,"children":1452},{"class":312,"line":368},[1453],{"type":41,"tag":310,"props":1454,"children":1455},{},[1456],{"type":47,"value":1234},{"type":41,"tag":310,"props":1458,"children":1459},{"class":312,"line":377},[1460],{"type":41,"tag":310,"props":1461,"children":1462},{"emptyLinePlaceholder":344},[1463],{"type":47,"value":347},{"type":41,"tag":310,"props":1465,"children":1466},{"class":312,"line":385},[1467],{"type":41,"tag":310,"props":1468,"children":1469},{},[1470],{"type":47,"value":1471},"\u002F\u002F Single string via Stringable\n",{"type":41,"tag":310,"props":1473,"children":1474},{"class":312,"line":394},[1475],{"type":41,"tag":310,"props":1476,"children":1477},{},[1478],{"type":47,"value":1479},"$embedding = Str::of('Napa Valley has great wine.')->toEmbeddings();\n",{"type":41,"tag":113,"props":1481,"children":1483},{"id":1482},"reranking",[1484],{"type":47,"value":161},{"type":41,"tag":300,"props":1486,"children":1488},{"className":302,"code":1487,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Reranking;\n\n$response = Reranking::of(['Django is Python.', 'Laravel is PHP.', 'React is JS.'])\n    ->limit(5)\n    ->rerank('PHP frameworks');\n\n$response->first()->document; \u002F\u002F \"Laravel is PHP.\"\n",[1489],{"type":41,"tag":56,"props":1490,"children":1491},{"__ignoreMap":304},[1492,1500,1507,1515,1523,1531,1538],{"type":41,"tag":310,"props":1493,"children":1494},{"class":312,"line":313},[1495],{"type":41,"tag":310,"props":1496,"children":1497},{},[1498],{"type":47,"value":1499},"use Laravel\\Ai\\Reranking;\n",{"type":41,"tag":310,"props":1501,"children":1502},{"class":312,"line":322},[1503],{"type":41,"tag":310,"props":1504,"children":1505},{"emptyLinePlaceholder":344},[1506],{"type":47,"value":347},{"type":41,"tag":310,"props":1508,"children":1509},{"class":312,"line":331},[1510],{"type":41,"tag":310,"props":1511,"children":1512},{},[1513],{"type":47,"value":1514},"$response = Reranking::of(['Django is Python.', 'Laravel is PHP.', 'React is JS.'])\n",{"type":41,"tag":310,"props":1516,"children":1517},{"class":312,"line":340},[1518],{"type":41,"tag":310,"props":1519,"children":1520},{},[1521],{"type":47,"value":1522},"    ->limit(5)\n",{"type":41,"tag":310,"props":1524,"children":1525},{"class":312,"line":350},[1526],{"type":41,"tag":310,"props":1527,"children":1528},{},[1529],{"type":47,"value":1530},"    ->rerank('PHP frameworks');\n",{"type":41,"tag":310,"props":1532,"children":1533},{"class":312,"line":359},[1534],{"type":41,"tag":310,"props":1535,"children":1536},{"emptyLinePlaceholder":344},[1537],{"type":47,"value":347},{"type":41,"tag":310,"props":1539,"children":1540},{"class":312,"line":368},[1541],{"type":41,"tag":310,"props":1542,"children":1543},{},[1544],{"type":47,"value":1545},"$response->first()->document; \u002F\u002F \"Laravel is PHP.\"\n",{"type":41,"tag":113,"props":1547,"children":1549},{"id":1548},"files-and-vector-stores",[1550],{"type":47,"value":1551},"Files and Vector Stores",{"type":41,"tag":300,"props":1553,"children":1555},{"className":302,"code":1554,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Files\\Document;\nuse Laravel\\Ai\\Stores;\n\n\u002F\u002F Store a file with the provider\n$file = Document::fromPath('\u002Fpath\u002Fto\u002Fdoc.pdf')->put();\n\n\u002F\u002F Create a vector store and add files\n$store = Stores::create('Knowledge Base');\n$store->add($file->id);\n$store->add(Document::fromStorage('manual.pdf')); \u002F\u002F Store + add in one step\n",[1556],{"type":41,"tag":56,"props":1557,"children":1558},{"__ignoreMap":304},[1559,1567,1575,1582,1590,1598,1605,1613,1621,1629],{"type":41,"tag":310,"props":1560,"children":1561},{"class":312,"line":313},[1562],{"type":41,"tag":310,"props":1563,"children":1564},{},[1565],{"type":47,"value":1566},"use Laravel\\Ai\\Files\\Document;\n",{"type":41,"tag":310,"props":1568,"children":1569},{"class":312,"line":322},[1570],{"type":41,"tag":310,"props":1571,"children":1572},{},[1573],{"type":47,"value":1574},"use Laravel\\Ai\\Stores;\n",{"type":41,"tag":310,"props":1576,"children":1577},{"class":312,"line":331},[1578],{"type":41,"tag":310,"props":1579,"children":1580},{"emptyLinePlaceholder":344},[1581],{"type":47,"value":347},{"type":41,"tag":310,"props":1583,"children":1584},{"class":312,"line":340},[1585],{"type":41,"tag":310,"props":1586,"children":1587},{},[1588],{"type":47,"value":1589},"\u002F\u002F Store a file with the provider\n",{"type":41,"tag":310,"props":1591,"children":1592},{"class":312,"line":350},[1593],{"type":41,"tag":310,"props":1594,"children":1595},{},[1596],{"type":47,"value":1597},"$file = Document::fromPath('\u002Fpath\u002Fto\u002Fdoc.pdf')->put();\n",{"type":41,"tag":310,"props":1599,"children":1600},{"class":312,"line":359},[1601],{"type":41,"tag":310,"props":1602,"children":1603},{"emptyLinePlaceholder":344},[1604],{"type":47,"value":347},{"type":41,"tag":310,"props":1606,"children":1607},{"class":312,"line":368},[1608],{"type":41,"tag":310,"props":1609,"children":1610},{},[1611],{"type":47,"value":1612},"\u002F\u002F Create a vector store and add files\n",{"type":41,"tag":310,"props":1614,"children":1615},{"class":312,"line":377},[1616],{"type":41,"tag":310,"props":1617,"children":1618},{},[1619],{"type":47,"value":1620},"$store = Stores::create('Knowledge Base');\n",{"type":41,"tag":310,"props":1622,"children":1623},{"class":312,"line":385},[1624],{"type":41,"tag":310,"props":1625,"children":1626},{},[1627],{"type":47,"value":1628},"$store->add($file->id);\n",{"type":41,"tag":310,"props":1630,"children":1631},{"class":312,"line":394},[1632],{"type":41,"tag":310,"props":1633,"children":1634},{},[1635],{"type":47,"value":1636},"$store->add(Document::fromStorage('manual.pdf')); \u002F\u002F Store + add in one step\n",{"type":41,"tag":65,"props":1638,"children":1640},{"id":1639},"agent-configuration",[1641],{"type":47,"value":1642},"Agent Configuration",{"type":41,"tag":113,"props":1644,"children":1646},{"id":1645},"php-attributes",[1647],{"type":47,"value":1648},"PHP Attributes",{"type":41,"tag":300,"props":1650,"children":1652},{"className":302,"code":1651,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Attributes\\{Provider, Model, MaxSteps, MaxTokens, Temperature, Timeout};\nuse Laravel\\Ai\\Enums\\Lab;\n\n#[Provider(Lab::Anthropic)]\n#[Model('claude-haiku-4-5-20251001')]\n#[MaxSteps(10)]\n#[MaxTokens(4096)]\n#[Temperature(0.7)]\n#[Timeout(120)]\nclass MyAgent implements Agent\n{\n    use Promptable;\n    \u002F\u002F ...\n}\n",[1653],{"type":41,"tag":56,"props":1654,"children":1655},{"__ignoreMap":304},[1656,1664,1671,1678,1686,1694,1702,1710,1718,1726,1734,1741,1748,1756],{"type":41,"tag":310,"props":1657,"children":1658},{"class":312,"line":313},[1659],{"type":41,"tag":310,"props":1660,"children":1661},{},[1662],{"type":47,"value":1663},"use Laravel\\Ai\\Attributes\\{Provider, Model, MaxSteps, MaxTokens, Temperature, Timeout};\n",{"type":41,"tag":310,"props":1665,"children":1666},{"class":312,"line":322},[1667],{"type":41,"tag":310,"props":1668,"children":1669},{},[1670],{"type":47,"value":328},{"type":41,"tag":310,"props":1672,"children":1673},{"class":312,"line":331},[1674],{"type":41,"tag":310,"props":1675,"children":1676},{"emptyLinePlaceholder":344},[1677],{"type":47,"value":347},{"type":41,"tag":310,"props":1679,"children":1680},{"class":312,"line":340},[1681],{"type":41,"tag":310,"props":1682,"children":1683},{},[1684],{"type":47,"value":1685},"#[Provider(Lab::Anthropic)]\n",{"type":41,"tag":310,"props":1687,"children":1688},{"class":312,"line":350},[1689],{"type":41,"tag":310,"props":1690,"children":1691},{},[1692],{"type":47,"value":1693},"#[Model('claude-haiku-4-5-20251001')]\n",{"type":41,"tag":310,"props":1695,"children":1696},{"class":312,"line":359},[1697],{"type":41,"tag":310,"props":1698,"children":1699},{},[1700],{"type":47,"value":1701},"#[MaxSteps(10)]\n",{"type":41,"tag":310,"props":1703,"children":1704},{"class":312,"line":368},[1705],{"type":41,"tag":310,"props":1706,"children":1707},{},[1708],{"type":47,"value":1709},"#[MaxTokens(4096)]\n",{"type":41,"tag":310,"props":1711,"children":1712},{"class":312,"line":377},[1713],{"type":41,"tag":310,"props":1714,"children":1715},{},[1716],{"type":47,"value":1717},"#[Temperature(0.7)]\n",{"type":41,"tag":310,"props":1719,"children":1720},{"class":312,"line":385},[1721],{"type":41,"tag":310,"props":1722,"children":1723},{},[1724],{"type":47,"value":1725},"#[Timeout(120)]\n",{"type":41,"tag":310,"props":1727,"children":1728},{"class":312,"line":394},[1729],{"type":41,"tag":310,"props":1730,"children":1731},{},[1732],{"type":47,"value":1733},"class MyAgent implements Agent\n",{"type":41,"tag":310,"props":1735,"children":1736},{"class":312,"line":403},[1737],{"type":41,"tag":310,"props":1738,"children":1739},{},[1740],{"type":47,"value":365},{"type":41,"tag":310,"props":1742,"children":1743},{"class":312,"line":412},[1744],{"type":41,"tag":310,"props":1745,"children":1746},{},[1747],{"type":47,"value":374},{"type":41,"tag":310,"props":1749,"children":1750},{"class":312,"line":421},[1751],{"type":41,"tag":310,"props":1752,"children":1753},{},[1754],{"type":47,"value":1755},"    \u002F\u002F ...\n",{"type":41,"tag":310,"props":1757,"children":1758},{"class":312,"line":430},[1759],{"type":41,"tag":310,"props":1760,"children":1761},{},[1762],{"type":47,"value":427},{"type":41,"tag":50,"props":1764,"children":1765},{},[1766,1768,1774,1776,1782],{"type":47,"value":1767},"The ",{"type":41,"tag":56,"props":1769,"children":1771},{"className":1770},[],[1772],{"type":47,"value":1773},"#[UseCheapestModel]",{"type":47,"value":1775}," and ",{"type":41,"tag":56,"props":1777,"children":1779},{"className":1778},[],[1780],{"type":47,"value":1781},"#[UseSmartestModel]",{"type":47,"value":1783}," attributes are also available for automatic model selection.",{"type":41,"tag":50,"props":1785,"children":1786},{},[1787,1788,1794,1796,1802],{"type":47,"value":1767},{"type":41,"tag":56,"props":1789,"children":1791},{"className":1790},[],[1792],{"type":47,"value":1793},"#[WithoutBroadcasting]",{"type":47,"value":1795}," attribute stops the given stream event types from broadcasting (e.g. data-heavy ",{"type":41,"tag":56,"props":1797,"children":1799},{"className":1798},[],[1800],{"type":47,"value":1801},"ToolResult",{"type":47,"value":1803}," payloads that exceed the WebSocket frame limit). The events are still streamed and persisted; they just never hit the channel:",{"type":41,"tag":300,"props":1805,"children":1807},{"className":302,"code":1806,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Attributes\\WithoutBroadcasting;\nuse Laravel\\Ai\\Streaming\\Events\\{ToolCall, ToolResult};\n\n#[WithoutBroadcasting(ToolResult::class, ToolCall::class)]\nclass SearchAgent implements Agent, HasTools\n{\n    use Promptable;\n    \u002F\u002F ...\n}\n",[1808],{"type":41,"tag":56,"props":1809,"children":1810},{"__ignoreMap":304},[1811,1819,1827,1834,1842,1850,1857,1864,1871],{"type":41,"tag":310,"props":1812,"children":1813},{"class":312,"line":313},[1814],{"type":41,"tag":310,"props":1815,"children":1816},{},[1817],{"type":47,"value":1818},"use Laravel\\Ai\\Attributes\\WithoutBroadcasting;\n",{"type":41,"tag":310,"props":1820,"children":1821},{"class":312,"line":322},[1822],{"type":41,"tag":310,"props":1823,"children":1824},{},[1825],{"type":47,"value":1826},"use Laravel\\Ai\\Streaming\\Events\\{ToolCall, ToolResult};\n",{"type":41,"tag":310,"props":1828,"children":1829},{"class":312,"line":331},[1830],{"type":41,"tag":310,"props":1831,"children":1832},{"emptyLinePlaceholder":344},[1833],{"type":47,"value":347},{"type":41,"tag":310,"props":1835,"children":1836},{"class":312,"line":340},[1837],{"type":41,"tag":310,"props":1838,"children":1839},{},[1840],{"type":47,"value":1841},"#[WithoutBroadcasting(ToolResult::class, ToolCall::class)]\n",{"type":41,"tag":310,"props":1843,"children":1844},{"class":312,"line":350},[1845],{"type":41,"tag":310,"props":1846,"children":1847},{},[1848],{"type":47,"value":1849},"class SearchAgent implements Agent, HasTools\n",{"type":41,"tag":310,"props":1851,"children":1852},{"class":312,"line":359},[1853],{"type":41,"tag":310,"props":1854,"children":1855},{},[1856],{"type":47,"value":365},{"type":41,"tag":310,"props":1858,"children":1859},{"class":312,"line":368},[1860],{"type":41,"tag":310,"props":1861,"children":1862},{},[1863],{"type":47,"value":374},{"type":41,"tag":310,"props":1865,"children":1866},{"class":312,"line":377},[1867],{"type":41,"tag":310,"props":1868,"children":1869},{},[1870],{"type":47,"value":1755},{"type":41,"tag":310,"props":1872,"children":1873},{"class":312,"line":385},[1874],{"type":41,"tag":310,"props":1875,"children":1876},{},[1877],{"type":47,"value":427},{"type":41,"tag":113,"props":1879,"children":1881},{"id":1880},"tools",[1882],{"type":47,"value":1883},"Tools",{"type":41,"tag":50,"props":1885,"children":1886},{},[1887,1889,1895,1897,1903],{"type":47,"value":1888},"Implement the ",{"type":41,"tag":56,"props":1890,"children":1892},{"className":1891},[],[1893],{"type":47,"value":1894},"HasTools",{"type":47,"value":1896}," interface and scaffold tools with ",{"type":41,"tag":56,"props":1898,"children":1900},{"className":1899},[],[1901],{"type":47,"value":1902},"php artisan make:tool",{"type":47,"value":1904},":",{"type":41,"tag":300,"props":1906,"children":1908},{"className":302,"code":1907,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Contracts\\HasTools;\n\nclass MyAgent implements Agent, HasTools\n{\n    use Promptable;\n\n    public function tools(): iterable\n    {\n        return [new MyCustomTool];\n    }\n}\n",[1909],{"type":41,"tag":56,"props":1910,"children":1911},{"__ignoreMap":304},[1912,1920,1927,1935,1942,1949,1956,1964,1971,1979,1986],{"type":41,"tag":310,"props":1913,"children":1914},{"class":312,"line":313},[1915],{"type":41,"tag":310,"props":1916,"children":1917},{},[1918],{"type":47,"value":1919},"use Laravel\\Ai\\Contracts\\HasTools;\n",{"type":41,"tag":310,"props":1921,"children":1922},{"class":312,"line":322},[1923],{"type":41,"tag":310,"props":1924,"children":1925},{"emptyLinePlaceholder":344},[1926],{"type":47,"value":347},{"type":41,"tag":310,"props":1928,"children":1929},{"class":312,"line":331},[1930],{"type":41,"tag":310,"props":1931,"children":1932},{},[1933],{"type":47,"value":1934},"class MyAgent implements Agent, HasTools\n",{"type":41,"tag":310,"props":1936,"children":1937},{"class":312,"line":340},[1938],{"type":41,"tag":310,"props":1939,"children":1940},{},[1941],{"type":47,"value":365},{"type":41,"tag":310,"props":1943,"children":1944},{"class":312,"line":350},[1945],{"type":41,"tag":310,"props":1946,"children":1947},{},[1948],{"type":47,"value":374},{"type":41,"tag":310,"props":1950,"children":1951},{"class":312,"line":359},[1952],{"type":41,"tag":310,"props":1953,"children":1954},{"emptyLinePlaceholder":344},[1955],{"type":47,"value":347},{"type":41,"tag":310,"props":1957,"children":1958},{"class":312,"line":368},[1959],{"type":41,"tag":310,"props":1960,"children":1961},{},[1962],{"type":47,"value":1963},"    public function tools(): iterable\n",{"type":41,"tag":310,"props":1965,"children":1966},{"class":312,"line":377},[1967],{"type":41,"tag":310,"props":1968,"children":1969},{},[1970],{"type":47,"value":400},{"type":41,"tag":310,"props":1972,"children":1973},{"class":312,"line":385},[1974],{"type":41,"tag":310,"props":1975,"children":1976},{},[1977],{"type":47,"value":1978},"        return [new MyCustomTool];\n",{"type":41,"tag":310,"props":1980,"children":1981},{"class":312,"line":394},[1982],{"type":41,"tag":310,"props":1983,"children":1984},{},[1985],{"type":47,"value":418},{"type":41,"tag":310,"props":1987,"children":1988},{"class":312,"line":403},[1989],{"type":41,"tag":310,"props":1990,"children":1991},{},[1992],{"type":47,"value":427},{"type":41,"tag":113,"props":1994,"children":1996},{"id":1995},"provider-tools",[1997],{"type":47,"value":1998},"Provider Tools",{"type":41,"tag":300,"props":2000,"children":2002},{"className":302,"code":2001,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Providers\\Tools\\{WebSearch, WebFetch, FileSearch};\n\npublic function tools(): iterable\n{\n    return [\n        (new WebSearch)->max(5)->allow(['laravel.com']),\n        new WebFetch,\n        new FileSearch(stores: ['store_id']),\n    ];\n}\n",[2003],{"type":41,"tag":56,"props":2004,"children":2005},{"__ignoreMap":304},[2006,2014,2021,2029,2036,2044,2052,2060,2068,2076],{"type":41,"tag":310,"props":2007,"children":2008},{"class":312,"line":313},[2009],{"type":41,"tag":310,"props":2010,"children":2011},{},[2012],{"type":47,"value":2013},"use Laravel\\Ai\\Providers\\Tools\\{WebSearch, WebFetch, FileSearch};\n",{"type":41,"tag":310,"props":2015,"children":2016},{"class":312,"line":322},[2017],{"type":41,"tag":310,"props":2018,"children":2019},{"emptyLinePlaceholder":344},[2020],{"type":47,"value":347},{"type":41,"tag":310,"props":2022,"children":2023},{"class":312,"line":331},[2024],{"type":41,"tag":310,"props":2025,"children":2026},{},[2027],{"type":47,"value":2028},"public function tools(): iterable\n",{"type":41,"tag":310,"props":2030,"children":2031},{"class":312,"line":340},[2032],{"type":41,"tag":310,"props":2033,"children":2034},{},[2035],{"type":47,"value":365},{"type":41,"tag":310,"props":2037,"children":2038},{"class":312,"line":350},[2039],{"type":41,"tag":310,"props":2040,"children":2041},{},[2042],{"type":47,"value":2043},"    return [\n",{"type":41,"tag":310,"props":2045,"children":2046},{"class":312,"line":359},[2047],{"type":41,"tag":310,"props":2048,"children":2049},{},[2050],{"type":47,"value":2051},"        (new WebSearch)->max(5)->allow(['laravel.com']),\n",{"type":41,"tag":310,"props":2053,"children":2054},{"class":312,"line":368},[2055],{"type":41,"tag":310,"props":2056,"children":2057},{},[2058],{"type":47,"value":2059},"        new WebFetch,\n",{"type":41,"tag":310,"props":2061,"children":2062},{"class":312,"line":377},[2063],{"type":41,"tag":310,"props":2064,"children":2065},{},[2066],{"type":47,"value":2067},"        new FileSearch(stores: ['store_id']),\n",{"type":41,"tag":310,"props":2069,"children":2070},{"class":312,"line":385},[2071],{"type":41,"tag":310,"props":2072,"children":2073},{},[2074],{"type":47,"value":2075},"    ];\n",{"type":41,"tag":310,"props":2077,"children":2078},{"class":312,"line":394},[2079],{"type":41,"tag":310,"props":2080,"children":2081},{},[2082],{"type":47,"value":427},{"type":41,"tag":113,"props":2084,"children":2086},{"id":2085},"conversation-memory",[2087],{"type":47,"value":2088},"Conversation Memory",{"type":41,"tag":300,"props":2090,"children":2092},{"className":302,"code":2091,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Concerns\\RemembersConversations;\nuse Laravel\\Ai\\Contracts\\Conversational;\n\nclass ChatBot implements Agent, Conversational\n{\n    use Promptable, RemembersConversations;\n    \u002F\u002F ...\n}\n\n$response = (new ChatBot)->forUser($user)->prompt('Hello!');\n$response = (new ChatBot)->continue($conversationId, as: $user)->prompt('More...');\n",[2093],{"type":41,"tag":56,"props":2094,"children":2095},{"__ignoreMap":304},[2096,2103,2110,2117,2125,2132,2139,2146,2153,2160,2168],{"type":41,"tag":310,"props":2097,"children":2098},{"class":312,"line":313},[2099],{"type":41,"tag":310,"props":2100,"children":2101},{},[2102],{"type":47,"value":872},{"type":41,"tag":310,"props":2104,"children":2105},{"class":312,"line":322},[2106],{"type":41,"tag":310,"props":2107,"children":2108},{},[2109],{"type":47,"value":703},{"type":41,"tag":310,"props":2111,"children":2112},{"class":312,"line":331},[2113],{"type":41,"tag":310,"props":2114,"children":2115},{"emptyLinePlaceholder":344},[2116],{"type":47,"value":347},{"type":41,"tag":310,"props":2118,"children":2119},{"class":312,"line":340},[2120],{"type":41,"tag":310,"props":2121,"children":2122},{},[2123],{"type":47,"value":2124},"class ChatBot implements Agent, Conversational\n",{"type":41,"tag":310,"props":2126,"children":2127},{"class":312,"line":350},[2128],{"type":41,"tag":310,"props":2129,"children":2130},{},[2131],{"type":47,"value":365},{"type":41,"tag":310,"props":2133,"children":2134},{"class":312,"line":359},[2135],{"type":41,"tag":310,"props":2136,"children":2137},{},[2138],{"type":47,"value":922},{"type":41,"tag":310,"props":2140,"children":2141},{"class":312,"line":368},[2142],{"type":41,"tag":310,"props":2143,"children":2144},{},[2145],{"type":47,"value":1755},{"type":41,"tag":310,"props":2147,"children":2148},{"class":312,"line":377},[2149],{"type":41,"tag":310,"props":2150,"children":2151},{},[2152],{"type":47,"value":427},{"type":41,"tag":310,"props":2154,"children":2155},{"class":312,"line":385},[2156],{"type":41,"tag":310,"props":2157,"children":2158},{"emptyLinePlaceholder":344},[2159],{"type":47,"value":347},{"type":41,"tag":310,"props":2161,"children":2162},{"class":312,"line":394},[2163],{"type":41,"tag":310,"props":2164,"children":2165},{},[2166],{"type":47,"value":2167},"$response = (new ChatBot)->forUser($user)->prompt('Hello!');\n",{"type":41,"tag":310,"props":2169,"children":2170},{"class":312,"line":403},[2171],{"type":41,"tag":310,"props":2172,"children":2173},{},[2174],{"type":47,"value":2175},"$response = (new ChatBot)->continue($conversationId, as: $user)->prompt('More...');\n",{"type":41,"tag":113,"props":2177,"children":2179},{"id":2178},"failover",[2180],{"type":47,"value":176},{"type":41,"tag":300,"props":2182,"children":2184},{"className":302,"code":2183,"language":14,"meta":304,"style":304},"$response = (new MyAgent)->prompt('Hello', provider: [Lab::OpenAI, Lab::Anthropic]);\n",[2185],{"type":41,"tag":56,"props":2186,"children":2187},{"__ignoreMap":304},[2188],{"type":41,"tag":310,"props":2189,"children":2190},{"class":312,"line":313},[2191],{"type":41,"tag":310,"props":2192,"children":2193},{},[2194],{"type":47,"value":2183},{"type":41,"tag":65,"props":2196,"children":2198},{"id":2197},"testing-and-faking",[2199],{"type":47,"value":2200},"Testing and Faking",{"type":41,"tag":50,"props":2202,"children":2203},{},[2204,2206,2212],{"type":47,"value":2205},"Each capability supports ",{"type":41,"tag":56,"props":2207,"children":2209},{"className":2208},[],[2210],{"type":47,"value":2211},"fake()",{"type":47,"value":2213}," with assertions:",{"type":41,"tag":300,"props":2215,"children":2217},{"className":302,"code":2216,"language":14,"meta":304,"style":304},"use App\\Ai\\Agents\\SalesCoach;\nuse Laravel\\Ai\\{Image, Audio, Transcription, Embeddings, Reranking, Files, Stores};\n\n\u002F\u002F Agents\nSalesCoach::fake(['Response 1', 'Response 2']);\nSalesCoach::assertPrompted('query');\nSalesCoach::assertNotPrompted('query');\nSalesCoach::assertNeverPrompted();\nSalesCoach::fake()->preventStrayPrompts();\n\n\u002F\u002F Images\nImage::fake();\nImage::assertGenerated(fn ($prompt) => $prompt->contains('sunset'));\nImage::assertNothingGenerated();\n\n\u002F\u002F Audio\nAudio::fake();\nAudio::assertGenerated(fn ($prompt) => $prompt->contains('Hello'));\n\n\u002F\u002F Transcription\nTranscription::fake(['Transcribed text.']);\nTranscription::assertGenerated(fn ($prompt) => $prompt->isDiarized());\n\n\u002F\u002F Embeddings\nEmbeddings::fake();\nEmbeddings::assertGenerated(fn ($prompt) => $prompt->contains('Laravel'));\n\n\u002F\u002F Reranking\nReranking::fake();\nReranking::assertReranked(fn ($prompt) => $prompt->contains('PHP'));\n\n\u002F\u002F Files\nFiles::fake();\nFiles::assertStored(fn ($file) => $file->mimeType() === 'text\u002Fplain');\n\n\u002F\u002F Stores\nStores::fake();\nStores::assertCreated('Knowledge Base');\n$store = Stores::get('id');\n$store->assertAdded('file_id');\n",[2218],{"type":41,"tag":56,"props":2219,"children":2220},{"__ignoreMap":304},[2221,2229,2237,2244,2252,2260,2268,2276,2284,2292,2299,2307,2315,2323,2331,2338,2346,2354,2362,2369,2377,2385,2393,2400,2408,2416,2424,2431,2439,2447,2455,2462,2470,2478,2486,2493,2501,2509,2517,2525],{"type":41,"tag":310,"props":2222,"children":2223},{"class":312,"line":313},[2224],{"type":41,"tag":310,"props":2225,"children":2226},{},[2227],{"type":47,"value":2228},"use App\\Ai\\Agents\\SalesCoach;\n",{"type":41,"tag":310,"props":2230,"children":2231},{"class":312,"line":322},[2232],{"type":41,"tag":310,"props":2233,"children":2234},{},[2235],{"type":47,"value":2236},"use Laravel\\Ai\\{Image, Audio, Transcription, Embeddings, Reranking, Files, Stores};\n",{"type":41,"tag":310,"props":2238,"children":2239},{"class":312,"line":331},[2240],{"type":41,"tag":310,"props":2241,"children":2242},{"emptyLinePlaceholder":344},[2243],{"type":47,"value":347},{"type":41,"tag":310,"props":2245,"children":2246},{"class":312,"line":340},[2247],{"type":41,"tag":310,"props":2248,"children":2249},{},[2250],{"type":47,"value":2251},"\u002F\u002F Agents\n",{"type":41,"tag":310,"props":2253,"children":2254},{"class":312,"line":350},[2255],{"type":41,"tag":310,"props":2256,"children":2257},{},[2258],{"type":47,"value":2259},"SalesCoach::fake(['Response 1', 'Response 2']);\n",{"type":41,"tag":310,"props":2261,"children":2262},{"class":312,"line":359},[2263],{"type":41,"tag":310,"props":2264,"children":2265},{},[2266],{"type":47,"value":2267},"SalesCoach::assertPrompted('query');\n",{"type":41,"tag":310,"props":2269,"children":2270},{"class":312,"line":368},[2271],{"type":41,"tag":310,"props":2272,"children":2273},{},[2274],{"type":47,"value":2275},"SalesCoach::assertNotPrompted('query');\n",{"type":41,"tag":310,"props":2277,"children":2278},{"class":312,"line":377},[2279],{"type":41,"tag":310,"props":2280,"children":2281},{},[2282],{"type":47,"value":2283},"SalesCoach::assertNeverPrompted();\n",{"type":41,"tag":310,"props":2285,"children":2286},{"class":312,"line":385},[2287],{"type":41,"tag":310,"props":2288,"children":2289},{},[2290],{"type":47,"value":2291},"SalesCoach::fake()->preventStrayPrompts();\n",{"type":41,"tag":310,"props":2293,"children":2294},{"class":312,"line":394},[2295],{"type":41,"tag":310,"props":2296,"children":2297},{"emptyLinePlaceholder":344},[2298],{"type":47,"value":347},{"type":41,"tag":310,"props":2300,"children":2301},{"class":312,"line":403},[2302],{"type":41,"tag":310,"props":2303,"children":2304},{},[2305],{"type":47,"value":2306},"\u002F\u002F Images\n",{"type":41,"tag":310,"props":2308,"children":2309},{"class":312,"line":412},[2310],{"type":41,"tag":310,"props":2311,"children":2312},{},[2313],{"type":47,"value":2314},"Image::fake();\n",{"type":41,"tag":310,"props":2316,"children":2317},{"class":312,"line":421},[2318],{"type":41,"tag":310,"props":2319,"children":2320},{},[2321],{"type":47,"value":2322},"Image::assertGenerated(fn ($prompt) => $prompt->contains('sunset'));\n",{"type":41,"tag":310,"props":2324,"children":2325},{"class":312,"line":430},[2326],{"type":41,"tag":310,"props":2327,"children":2328},{},[2329],{"type":47,"value":2330},"Image::assertNothingGenerated();\n",{"type":41,"tag":310,"props":2332,"children":2333},{"class":312,"line":438},[2334],{"type":41,"tag":310,"props":2335,"children":2336},{"emptyLinePlaceholder":344},[2337],{"type":47,"value":347},{"type":41,"tag":310,"props":2339,"children":2340},{"class":312,"line":447},[2341],{"type":41,"tag":310,"props":2342,"children":2343},{},[2344],{"type":47,"value":2345},"\u002F\u002F Audio\n",{"type":41,"tag":310,"props":2347,"children":2348},{"class":312,"line":456},[2349],{"type":41,"tag":310,"props":2350,"children":2351},{},[2352],{"type":47,"value":2353},"Audio::fake();\n",{"type":41,"tag":310,"props":2355,"children":2356},{"class":312,"line":465},[2357],{"type":41,"tag":310,"props":2358,"children":2359},{},[2360],{"type":47,"value":2361},"Audio::assertGenerated(fn ($prompt) => $prompt->contains('Hello'));\n",{"type":41,"tag":310,"props":2363,"children":2364},{"class":312,"line":473},[2365],{"type":41,"tag":310,"props":2366,"children":2367},{"emptyLinePlaceholder":344},[2368],{"type":47,"value":347},{"type":41,"tag":310,"props":2370,"children":2371},{"class":312,"line":482},[2372],{"type":41,"tag":310,"props":2373,"children":2374},{},[2375],{"type":47,"value":2376},"\u002F\u002F Transcription\n",{"type":41,"tag":310,"props":2378,"children":2379},{"class":312,"line":491},[2380],{"type":41,"tag":310,"props":2381,"children":2382},{},[2383],{"type":47,"value":2384},"Transcription::fake(['Transcribed text.']);\n",{"type":41,"tag":310,"props":2386,"children":2387},{"class":312,"line":499},[2388],{"type":41,"tag":310,"props":2389,"children":2390},{},[2391],{"type":47,"value":2392},"Transcription::assertGenerated(fn ($prompt) => $prompt->isDiarized());\n",{"type":41,"tag":310,"props":2394,"children":2395},{"class":312,"line":508},[2396],{"type":41,"tag":310,"props":2397,"children":2398},{"emptyLinePlaceholder":344},[2399],{"type":47,"value":347},{"type":41,"tag":310,"props":2401,"children":2402},{"class":312,"line":517},[2403],{"type":41,"tag":310,"props":2404,"children":2405},{},[2406],{"type":47,"value":2407},"\u002F\u002F Embeddings\n",{"type":41,"tag":310,"props":2409,"children":2410},{"class":312,"line":526},[2411],{"type":41,"tag":310,"props":2412,"children":2413},{},[2414],{"type":47,"value":2415},"Embeddings::fake();\n",{"type":41,"tag":310,"props":2417,"children":2418},{"class":312,"line":535},[2419],{"type":41,"tag":310,"props":2420,"children":2421},{},[2422],{"type":47,"value":2423},"Embeddings::assertGenerated(fn ($prompt) => $prompt->contains('Laravel'));\n",{"type":41,"tag":310,"props":2425,"children":2426},{"class":312,"line":544},[2427],{"type":41,"tag":310,"props":2428,"children":2429},{"emptyLinePlaceholder":344},[2430],{"type":47,"value":347},{"type":41,"tag":310,"props":2432,"children":2433},{"class":312,"line":553},[2434],{"type":41,"tag":310,"props":2435,"children":2436},{},[2437],{"type":47,"value":2438},"\u002F\u002F Reranking\n",{"type":41,"tag":310,"props":2440,"children":2441},{"class":312,"line":562},[2442],{"type":41,"tag":310,"props":2443,"children":2444},{},[2445],{"type":47,"value":2446},"Reranking::fake();\n",{"type":41,"tag":310,"props":2448,"children":2449},{"class":312,"line":570},[2450],{"type":41,"tag":310,"props":2451,"children":2452},{},[2453],{"type":47,"value":2454},"Reranking::assertReranked(fn ($prompt) => $prompt->contains('PHP'));\n",{"type":41,"tag":310,"props":2456,"children":2457},{"class":312,"line":579},[2458],{"type":41,"tag":310,"props":2459,"children":2460},{"emptyLinePlaceholder":344},[2461],{"type":47,"value":347},{"type":41,"tag":310,"props":2463,"children":2464},{"class":312,"line":588},[2465],{"type":41,"tag":310,"props":2466,"children":2467},{},[2468],{"type":47,"value":2469},"\u002F\u002F Files\n",{"type":41,"tag":310,"props":2471,"children":2472},{"class":312,"line":596},[2473],{"type":41,"tag":310,"props":2474,"children":2475},{},[2476],{"type":47,"value":2477},"Files::fake();\n",{"type":41,"tag":310,"props":2479,"children":2480},{"class":312,"line":605},[2481],{"type":41,"tag":310,"props":2482,"children":2483},{},[2484],{"type":47,"value":2485},"Files::assertStored(fn ($file) => $file->mimeType() === 'text\u002Fplain');\n",{"type":41,"tag":310,"props":2487,"children":2488},{"class":312,"line":614},[2489],{"type":41,"tag":310,"props":2490,"children":2491},{"emptyLinePlaceholder":344},[2492],{"type":47,"value":347},{"type":41,"tag":310,"props":2494,"children":2495},{"class":312,"line":623},[2496],{"type":41,"tag":310,"props":2497,"children":2498},{},[2499],{"type":47,"value":2500},"\u002F\u002F Stores\n",{"type":41,"tag":310,"props":2502,"children":2503},{"class":312,"line":631},[2504],{"type":41,"tag":310,"props":2505,"children":2506},{},[2507],{"type":47,"value":2508},"Stores::fake();\n",{"type":41,"tag":310,"props":2510,"children":2511},{"class":312,"line":640},[2512],{"type":41,"tag":310,"props":2513,"children":2514},{},[2515],{"type":47,"value":2516},"Stores::assertCreated('Knowledge Base');\n",{"type":41,"tag":310,"props":2518,"children":2519},{"class":312,"line":649},[2520],{"type":41,"tag":310,"props":2521,"children":2522},{},[2523],{"type":47,"value":2524},"$store = Stores::get('id');\n",{"type":41,"tag":310,"props":2526,"children":2527},{"class":312,"line":657},[2528],{"type":41,"tag":310,"props":2529,"children":2530},{},[2531],{"type":47,"value":2532},"$store->assertAdded('file_id');\n",{"type":41,"tag":65,"props":2534,"children":2536},{"id":2535},"key-patterns",[2537],{"type":47,"value":2538},"Key Patterns",{"type":41,"tag":77,"props":2540,"children":2541},{},[2542,2553,2564,2584,2614,2656,2669,2686],{"type":41,"tag":81,"props":2543,"children":2544},{},[2545,2547],{"type":47,"value":2546},"Namespace: ",{"type":41,"tag":56,"props":2548,"children":2550},{"className":2549},[],[2551],{"type":47,"value":2552},"Laravel\\Ai\\",{"type":41,"tag":81,"props":2554,"children":2555},{},[2556,2558],{"type":47,"value":2557},"Package: ",{"type":41,"tag":56,"props":2559,"children":2561},{"className":2560},[],[2562],{"type":47,"value":2563},"composer require laravel\u002Fai",{"type":41,"tag":81,"props":2565,"children":2566},{},[2567,2569,2575,2577,2582],{"type":47,"value":2568},"Agent pattern: Implement the ",{"type":41,"tag":56,"props":2570,"children":2572},{"className":2571},[],[2573],{"type":47,"value":2574},"Agent",{"type":47,"value":2576}," interface and use the ",{"type":41,"tag":56,"props":2578,"children":2580},{"className":2579},[],[2581],{"type":47,"value":208},{"type":47,"value":2583}," trait",{"type":41,"tag":81,"props":2585,"children":2586},{},[2587,2589,2594,2596,2602,2603,2608,2609],{"type":47,"value":2588},"Optional interfaces: ",{"type":41,"tag":56,"props":2590,"children":2592},{"className":2591},[],[2593],{"type":47,"value":1894},{"type":47,"value":2595},", ",{"type":41,"tag":56,"props":2597,"children":2599},{"className":2598},[],[2600],{"type":47,"value":2601},"HasMiddleware",{"type":47,"value":2595},{"type":41,"tag":56,"props":2604,"children":2606},{"className":2605},[],[2607],{"type":47,"value":232},{"type":47,"value":2595},{"type":41,"tag":56,"props":2610,"children":2612},{"className":2611},[],[2613],{"type":47,"value":216},{"type":41,"tag":81,"props":2615,"children":2616},{},[2617,2619,2625,2626,2631,2632,2637,2638,2643,2644,2649,2650],{"type":47,"value":2618},"Entry-point classes: ",{"type":41,"tag":56,"props":2620,"children":2622},{"className":2621},[],[2623],{"type":47,"value":2624},"Image",{"type":47,"value":2595},{"type":41,"tag":56,"props":2627,"children":2629},{"className":2628},[],[2630],{"type":47,"value":1255},{"type":47,"value":2595},{"type":41,"tag":56,"props":2633,"children":2635},{"className":2634},[],[2636],{"type":47,"value":1329},{"type":47,"value":2595},{"type":41,"tag":56,"props":2639,"children":2641},{"className":2640},[],[2642],{"type":47,"value":1395},{"type":47,"value":2595},{"type":41,"tag":56,"props":2645,"children":2647},{"className":2646},[],[2648],{"type":47,"value":161},{"type":47,"value":2595},{"type":41,"tag":56,"props":2651,"children":2653},{"className":2652},[],[2654],{"type":47,"value":2655},"Stores",{"type":41,"tag":81,"props":2657,"children":2658},{},[2659,2661,2667],{"type":47,"value":2660},"Provider enum: ",{"type":41,"tag":56,"props":2662,"children":2664},{"className":2663},[],[2665],{"type":47,"value":2666},"Laravel\\Ai\\Enums\\Lab",{"type":47,"value":2668}," (prefer over plain strings)",{"type":41,"tag":81,"props":2670,"children":2671},{},[2672,2674,2680,2681],{"type":47,"value":2673},"Artisan commands: ",{"type":41,"tag":56,"props":2675,"children":2677},{"className":2676},[],[2678],{"type":47,"value":2679},"php artisan make:agent",{"type":47,"value":2595},{"type":41,"tag":56,"props":2682,"children":2684},{"className":2683},[],[2685],{"type":47,"value":1902},{"type":41,"tag":81,"props":2687,"children":2688},{},[2689,2691,2697],{"type":47,"value":2690},"Global helper: ",{"type":41,"tag":56,"props":2692,"children":2694},{"className":2693},[],[2695],{"type":47,"value":2696},"agent()",{"type":47,"value":2698}," for anonymous agents",{"type":41,"tag":65,"props":2700,"children":2702},{"id":2701},"openai-compatible-provider",[2703],{"type":47,"value":2704},"OpenAI-Compatible Provider",{"type":41,"tag":50,"props":2706,"children":2707},{},[2708,2710,2716,2718,2724],{"type":47,"value":2709},"Point the SDK at any OpenAI Chat Completions endpoint (LM Studio, vLLM, Together, etc.) with the config-driven ",{"type":41,"tag":56,"props":2711,"children":2713},{"className":2712},[],[2714],{"type":47,"value":2715},"openai-compatible",{"type":47,"value":2717}," driver. Define named instances in ",{"type":41,"tag":56,"props":2719,"children":2721},{"className":2720},[],[2722],{"type":47,"value":2723},"config\u002Fai.php",{"type":47,"value":2725},", no code required:",{"type":41,"tag":300,"props":2727,"children":2729},{"className":302,"code":2728,"language":14,"meta":304,"style":304},"'my-llm' => [\n    'driver' => 'openai-compatible',\n    'url' => env('MY_LLM_URL'),        \u002F\u002F required\n    'key' => env('MY_LLM_API_KEY'),    \u002F\u002F optional Bearer token\n],\n",[2730],{"type":41,"tag":56,"props":2731,"children":2732},{"__ignoreMap":304},[2733,2741,2749,2762,2775],{"type":41,"tag":310,"props":2734,"children":2735},{"class":312,"line":313},[2736],{"type":41,"tag":310,"props":2737,"children":2738},{},[2739],{"type":47,"value":2740},"'my-llm' => [\n",{"type":41,"tag":310,"props":2742,"children":2743},{"class":312,"line":322},[2744],{"type":41,"tag":310,"props":2745,"children":2746},{},[2747],{"type":47,"value":2748},"    'driver' => 'openai-compatible',\n",{"type":41,"tag":310,"props":2750,"children":2751},{"class":312,"line":331},[2752,2757],{"type":41,"tag":310,"props":2753,"children":2754},{},[2755],{"type":47,"value":2756},"    'url' => env('MY_LLM_URL'),",{"type":41,"tag":310,"props":2758,"children":2759},{},[2760],{"type":47,"value":2761},"        \u002F\u002F required\n",{"type":41,"tag":310,"props":2763,"children":2764},{"class":312,"line":340},[2765,2770],{"type":41,"tag":310,"props":2766,"children":2767},{},[2768],{"type":47,"value":2769},"    'key' => env('MY_LLM_API_KEY'),",{"type":41,"tag":310,"props":2771,"children":2772},{},[2773],{"type":47,"value":2774},"    \u002F\u002F optional Bearer token\n",{"type":41,"tag":310,"props":2776,"children":2777},{"class":312,"line":350},[2778],{"type":41,"tag":310,"props":2779,"children":2780},{},[2781],{"type":47,"value":2782},"],\n",{"type":41,"tag":50,"props":2784,"children":2785},{},[2786,2788,2794,2796,2802,2804,2810],{"type":47,"value":2787},"Reference it by config key (or ",{"type":41,"tag":56,"props":2789,"children":2791},{"className":2790},[],[2792],{"type":47,"value":2793},"Lab::OpenAiCompatible",{"type":47,"value":2795},"). A model is required via ",{"type":41,"tag":56,"props":2797,"children":2799},{"className":2798},[],[2800],{"type":47,"value":2801},"models.text.default",{"type":47,"value":2803}," or per-call ",{"type":41,"tag":56,"props":2805,"children":2807},{"className":2806},[],[2808],{"type":47,"value":2809},"model:",{"type":47,"value":1904},{"type":41,"tag":300,"props":2812,"children":2814},{"className":302,"code":2813,"language":14,"meta":304,"style":304},"agent()->prompt('Hello', provider: 'my-llm', model: 'some-model');\n",[2815],{"type":41,"tag":56,"props":2816,"children":2817},{"__ignoreMap":304},[2818],{"type":41,"tag":310,"props":2819,"children":2820},{"class":312,"line":313},[2821],{"type":41,"tag":310,"props":2822,"children":2823},{},[2824],{"type":47,"value":2813},{"type":41,"tag":50,"props":2826,"children":2827},{},[2828,2830,2836],{"type":47,"value":2829},"It uses OpenAI-standard shapes and supports text, streaming, tools, structured output, and image attachments. For extra request-body fields, implement ",{"type":41,"tag":56,"props":2831,"children":2833},{"className":2832},[],[2834],{"type":47,"value":2835},"HasProviderOptions",{"type":47,"value":2837}," — the returned array is merged into the body.",{"type":41,"tag":65,"props":2839,"children":2841},{"id":2840},"common-pitfalls",[2842],{"type":47,"value":2843},"Common Pitfalls",{"type":41,"tag":113,"props":2845,"children":2847},{"id":2846},"wrong-namespace",[2848],{"type":47,"value":2849},"Wrong Namespace",{"type":41,"tag":50,"props":2851,"children":2852},{},[2853,2855,2861,2862,2868,2870,2876],{"type":47,"value":2854},"The namespace is ",{"type":41,"tag":56,"props":2856,"children":2858},{"className":2857},[],[2859],{"type":47,"value":2860},"Laravel\\Ai",{"type":47,"value":98},{"type":41,"tag":56,"props":2863,"children":2865},{"className":2864},[],[2866],{"type":47,"value":2867},"Illuminate\\Ai",{"type":47,"value":2869}," or ",{"type":41,"tag":56,"props":2871,"children":2873},{"className":2872},[],[2874],{"type":47,"value":2875},"Laravel\\AI",{"type":47,"value":106},{"type":41,"tag":300,"props":2878,"children":2880},{"className":302,"code":2879,"language":14,"meta":304,"style":304},"\u002F\u002F Correct\nuse Laravel\\Ai\\Image;\nuse Laravel\\Ai\\Contracts\\Agent;\nuse Laravel\\Ai\\Promptable;\n\n\u002F\u002F Wrong — these do not exist\nuse Illuminate\\Ai\\Image;\nuse Laravel\\AI\\Agent;\n",[2881],{"type":41,"tag":56,"props":2882,"children":2883},{"__ignoreMap":304},[2884,2892,2899,2906,2913,2920,2928,2936],{"type":41,"tag":310,"props":2885,"children":2886},{"class":312,"line":313},[2887],{"type":41,"tag":310,"props":2888,"children":2889},{},[2890],{"type":47,"value":2891},"\u002F\u002F Correct\n",{"type":41,"tag":310,"props":2893,"children":2894},{"class":312,"line":322},[2895],{"type":41,"tag":310,"props":2896,"children":2897},{},[2898],{"type":47,"value":1195},{"type":41,"tag":310,"props":2900,"children":2901},{"class":312,"line":331},[2902],{"type":41,"tag":310,"props":2903,"children":2904},{},[2905],{"type":47,"value":319},{"type":41,"tag":310,"props":2907,"children":2908},{"class":312,"line":340},[2909],{"type":41,"tag":310,"props":2910,"children":2911},{},[2912],{"type":47,"value":337},{"type":41,"tag":310,"props":2914,"children":2915},{"class":312,"line":350},[2916],{"type":41,"tag":310,"props":2917,"children":2918},{"emptyLinePlaceholder":344},[2919],{"type":47,"value":347},{"type":41,"tag":310,"props":2921,"children":2922},{"class":312,"line":359},[2923],{"type":41,"tag":310,"props":2924,"children":2925},{},[2926],{"type":47,"value":2927},"\u002F\u002F Wrong — these do not exist\n",{"type":41,"tag":310,"props":2929,"children":2930},{"class":312,"line":368},[2931],{"type":41,"tag":310,"props":2932,"children":2933},{},[2934],{"type":47,"value":2935},"use Illuminate\\Ai\\Image;\n",{"type":41,"tag":310,"props":2937,"children":2938},{"class":312,"line":377},[2939],{"type":41,"tag":310,"props":2940,"children":2941},{},[2942],{"type":47,"value":2943},"use Laravel\\AI\\Agent;\n",{"type":41,"tag":113,"props":2945,"children":2947},{"id":2946},"unsupported-provider-capability",[2948],{"type":47,"value":2949},"Unsupported Provider Capability",{"type":41,"tag":50,"props":2951,"children":2952},{},[2953,2955,2961],{"type":47,"value":2954},"Calling a capability not supported by a provider throws a ",{"type":41,"tag":56,"props":2956,"children":2958},{"className":2957},[],[2959],{"type":47,"value":2960},"LogicException",{"type":47,"value":2962},". Refer to the provider support table below.",{"type":41,"tag":65,"props":2964,"children":2966},{"id":2965},"provider-support",[2967],{"type":47,"value":2968},"Provider Support",{"type":41,"tag":2970,"props":2971,"children":2972},"table",{},[2973,2992],{"type":41,"tag":2974,"props":2975,"children":2976},"thead",{},[2977],{"type":41,"tag":2978,"props":2979,"children":2980},"tr",{},[2981,2987],{"type":41,"tag":2982,"props":2983,"children":2984},"th",{},[2985],{"type":47,"value":2986},"Feature",{"type":41,"tag":2982,"props":2988,"children":2989},{},[2990],{"type":47,"value":2991},"Providers",{"type":41,"tag":2993,"props":2994,"children":2995},"tbody",{},[2996,3010,3022,3035,3048,3060,3072],{"type":41,"tag":2978,"props":2997,"children":2998},{},[2999,3005],{"type":41,"tag":3000,"props":3001,"children":3002},"td",{},[3003],{"type":47,"value":3004},"Text",{"type":41,"tag":3000,"props":3006,"children":3007},{},[3008],{"type":47,"value":3009},"OpenAI, Anthropic, Gemini, Azure, Groq, xAI, DeepSeek, Mistral, Ollama, OpenRouter, OpenAI-compatible",{"type":41,"tag":2978,"props":3011,"children":3012},{},[3013,3017],{"type":41,"tag":3000,"props":3014,"children":3015},{},[3016],{"type":47,"value":141},{"type":41,"tag":3000,"props":3018,"children":3019},{},[3020],{"type":47,"value":3021},"OpenAI, Gemini, xAI",{"type":41,"tag":2978,"props":3023,"children":3024},{},[3025,3030],{"type":41,"tag":3000,"props":3026,"children":3027},{},[3028],{"type":47,"value":3029},"TTS",{"type":41,"tag":3000,"props":3031,"children":3032},{},[3033],{"type":47,"value":3034},"OpenAI, ElevenLabs",{"type":41,"tag":2978,"props":3036,"children":3037},{},[3038,3043],{"type":41,"tag":3000,"props":3039,"children":3040},{},[3041],{"type":47,"value":3042},"STT",{"type":41,"tag":3000,"props":3044,"children":3045},{},[3046],{"type":47,"value":3047},"OpenAI, ElevenLabs, Mistral",{"type":41,"tag":2978,"props":3049,"children":3050},{},[3051,3055],{"type":41,"tag":3000,"props":3052,"children":3053},{},[3054],{"type":47,"value":1395},{"type":41,"tag":3000,"props":3056,"children":3057},{},[3058],{"type":47,"value":3059},"OpenAI, Gemini, Azure, Cohere, Mistral, Jina, VoyageAI",{"type":41,"tag":2978,"props":3061,"children":3062},{},[3063,3067],{"type":41,"tag":3000,"props":3064,"children":3065},{},[3066],{"type":47,"value":161},{"type":41,"tag":3000,"props":3068,"children":3069},{},[3070],{"type":47,"value":3071},"Cohere, Jina",{"type":41,"tag":2978,"props":3073,"children":3074},{},[3075,3079],{"type":41,"tag":3000,"props":3076,"children":3077},{},[3078],{"type":47,"value":166},{"type":41,"tag":3000,"props":3080,"children":3081},{},[3082],{"type":47,"value":3083},"OpenAI, Anthropic, Gemini",{"type":41,"tag":50,"props":3085,"children":3086},{},[3087,3089,3094],{"type":47,"value":3088},"Use the ",{"type":41,"tag":56,"props":3090,"children":3092},{"className":3091},[],[3093],{"type":47,"value":2666},{"type":47,"value":3095}," enum to reference providers in code instead of plain strings:",{"type":41,"tag":300,"props":3097,"children":3099},{"className":302,"code":3098,"language":14,"meta":304,"style":304},"use Laravel\\Ai\\Enums\\Lab;\n\nLab::Anthropic;\nLab::OpenAI;\nLab::Gemini;\nLab::OpenAiCompatible; \u002F\u002F configurable OpenAI Chat Completions endpoint\n\u002F\u002F ...\n",[3100],{"type":41,"tag":56,"props":3101,"children":3102},{"__ignoreMap":304},[3103,3110,3117,3125,3133,3141,3149],{"type":41,"tag":310,"props":3104,"children":3105},{"class":312,"line":313},[3106],{"type":41,"tag":310,"props":3107,"children":3108},{},[3109],{"type":47,"value":328},{"type":41,"tag":310,"props":3111,"children":3112},{"class":312,"line":322},[3113],{"type":41,"tag":310,"props":3114,"children":3115},{"emptyLinePlaceholder":344},[3116],{"type":47,"value":347},{"type":41,"tag":310,"props":3118,"children":3119},{"class":312,"line":331},[3120],{"type":41,"tag":310,"props":3121,"children":3122},{},[3123],{"type":47,"value":3124},"Lab::Anthropic;\n",{"type":41,"tag":310,"props":3126,"children":3127},{"class":312,"line":340},[3128],{"type":41,"tag":310,"props":3129,"children":3130},{},[3131],{"type":47,"value":3132},"Lab::OpenAI;\n",{"type":41,"tag":310,"props":3134,"children":3135},{"class":312,"line":350},[3136],{"type":41,"tag":310,"props":3137,"children":3138},{},[3139],{"type":47,"value":3140},"Lab::Gemini;\n",{"type":41,"tag":310,"props":3142,"children":3143},{"class":312,"line":359},[3144],{"type":41,"tag":310,"props":3145,"children":3146},{},[3147],{"type":47,"value":3148},"Lab::OpenAiCompatible; \u002F\u002F configurable OpenAI Chat Completions endpoint\n",{"type":41,"tag":310,"props":3150,"children":3151},{"class":312,"line":368},[3152],{"type":41,"tag":310,"props":3153,"children":3154},{},[3155],{"type":47,"value":3156},"\u002F\u002F ...\n",{"type":41,"tag":3158,"props":3159,"children":3160},"style",{},[3161],{"type":47,"value":3162},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3164,"total":385},[3165,3182,3196,3211,3218,3235,3247,3261,3278],{"slug":3166,"name":3166,"fn":3167,"description":3168,"org":3169,"tags":3170,"stars":3179,"repoUrl":3180,"updatedAt":3181},"socialite-development","integrate OAuth social authentication","Manages OAuth social authentication with Laravel Socialite. Activate when adding social login providers; configuring OAuth redirect\u002Fcallback flows; retrieving authenticated user details; customizing scopes or parameters; setting up community providers; testing with Socialite fakes; or when the user mentions social login, OAuth, Socialite, or third-party authentication.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3171,3174,3175,3178],{"name":3172,"slug":3173,"type":15},"Auth","auth",{"name":9,"slug":8,"type":15},{"name":3176,"slug":3177,"type":15},"OAuth","oauth",{"name":13,"slug":14,"type":15},5745,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Fsocialite","2026-07-13T06:22:10.648812",{"slug":3183,"name":3183,"fn":3184,"description":3185,"org":3186,"tags":3187,"stars":3193,"repoUrl":3194,"updatedAt":3195},"octane-development","develop applications with Laravel Octane","Use this skill when working with Laravel Octane, a long-running PHP worker server (Swoole, FrankenPHP, RoadRunner) where the application boots once and serves many requests instead of rebooting for each request like PHP-FPM. Trigger when installing Octane or starting its server; configuring or detecting the active driver for driver-specific code; using Octane::concurrently(), Octane::table(), the Octane cache, or shared in-memory state across workers; controlling worker memory growth; or testing Octane behavior. Skip plain PHP-FPM applications with no persistent worker.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3188,3189,3192],{"name":9,"slug":8,"type":15},{"name":3190,"slug":3191,"type":15},"Performance","performance",{"name":13,"slug":14,"type":15},4021,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Foctane","2026-07-16T06:02:20.284131",{"slug":3197,"name":3197,"fn":3198,"description":3199,"org":3200,"tags":3201,"stars":3208,"repoUrl":3209,"updatedAt":3210},"fortify-development","implement authentication with Laravel Fortify","ACTIVATE when the user works on authentication in Laravel. This includes login, registration, password reset, email verification, two-factor authentication (2FA\u002FTOTP\u002FQR codes\u002Frecovery codes), passkeys, profile updates, password confirmation, or any auth-related routes and controllers. Activate when the user mentions Fortify, auth, authentication, login, register, signup, forgot password, verify email, 2FA, passkeys, WebAuthn, or references app\u002FActions\u002FFortify\u002F, CreateNewUser, UpdateUserProfileInformation, FortifyServiceProvider, config\u002Ffortify.php, or auth guards. Fortify is the frontend-agnostic authentication backend for Laravel that registers all auth routes and controllers. Also activate when building SPA or headless authentication, customizing login redirects, overriding response contracts like LoginResponse, or configuring login throttling. Do NOT activate for Laravel Passport (OAuth2 API tokens), Socialite (OAuth social login), or non-auth Laravel features.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3202,3205,3206,3207],{"name":3203,"slug":3204,"type":15},"2FA","2fa",{"name":3172,"slug":3173,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},1746,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Ffortify","2026-07-13T06:22:28.612049",{"slug":4,"name":4,"fn":5,"description":6,"org":3212,"tags":3213,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3214,3215,3216,3217],{"name":18,"slug":19,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},{"slug":3219,"name":3219,"fn":3220,"description":3221,"org":3222,"tags":3223,"stars":3232,"repoUrl":3233,"updatedAt":3234},"deploying-laravel-cloud","deploy Laravel applications to Laravel Cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to cloud, create\u002Fmanage environments, databases, caches, domains, instances, background processes, check billing\u002Fusage\u002Fspend, or any Laravel Cloud infrastructure. Triggers on deploy, ship, cloud management, environment setup, database provisioning, billing\u002Fusage queries, and similar cloud operations.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3224,3227,3230,3231],{"name":3225,"slug":3226,"type":15},"CLI","cli",{"name":3228,"slug":3229,"type":15},"Deployment","deployment",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},665,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Fagent-skills","2026-07-13T06:22:18.36234",{"slug":3236,"name":3236,"fn":3237,"description":3238,"org":3239,"tags":3240,"stars":3232,"repoUrl":3233,"updatedAt":3246},"starter-kit-upgrade","upgrade Laravel starter kit projects","Selectively pull upstream improvements from a Laravel starter kit (laravel\u002Fvue-starter-kit, laravel\u002Freact-starter-kit, laravel\u002Fsvelte-starter-kit, laravel\u002Flivewire-starter-kit) into a project bootstrapped from one. Use when the user wants to update, sync, or migrate features from their starter kit. Applies one feature at a time on a dedicated branch; never auto-merges customized files.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3241,3242,3245],{"name":9,"slug":8,"type":15},{"name":3243,"slug":3244,"type":15},"Maintenance","maintenance",{"name":13,"slug":14,"type":15},"2026-07-13T06:22:11.972952",{"slug":3248,"name":3248,"fn":3249,"description":3250,"org":3251,"tags":3252,"stars":3258,"repoUrl":3259,"updatedAt":3260},"pennant-development","manage feature flags with Laravel Pennant","Use when working with Laravel Pennant the official Laravel feature flag package. Trigger whenever the query mentions Pennant by name or involves feature flags or feature toggles in a Laravel project. Tasks include defining feature flags checking whether features are active creating class based features in `app\u002FFeatures` using Blade `@feature` directives scoping flags to users or teams building custom Pennant storage drivers protecting routes with feature flags testing feature flags with Pest or PHPUnit and implementing A B testing or gradual rollouts with feature flags. Do not trigger for generic Laravel configuration authorization policies authentication or non Pennant feature management systems.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3253,3256,3257],{"name":3254,"slug":3255,"type":15},"Feature Flags","feature-flags",{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15},585,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Fpennant","2026-07-13T06:22:26.043758",{"slug":3262,"name":3262,"fn":3263,"description":3264,"org":3265,"tags":3266,"stars":3275,"repoUrl":3276,"updatedAt":3277},"configure-nightwatch","configure Laravel Nightwatch data collection","Configures Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3267,3270,3271,3274],{"name":3268,"slug":3269,"type":15},"Configuration","configuration",{"name":9,"slug":8,"type":15},{"name":3272,"slug":3273,"type":15},"Observability","observability",{"name":13,"slug":14,"type":15},368,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Fnightwatch","2026-07-13T06:22:29.945491",{"slug":3279,"name":3279,"fn":3263,"description":3280,"org":3281,"tags":3282,"stars":3291,"repoUrl":3292,"updatedAt":3293},"nightwatch-configure","Configure Laravel Nightwatch data collection, sampling rates, filtering rules, and redaction policies. Use this when setting up Nightwatch, managing data volume, protecting sensitive data (PII), or optimizing event collection for production workloads.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3283,3284,3285,3288],{"name":3268,"slug":3269,"type":15},{"name":9,"slug":8,"type":15},{"name":3286,"slug":3287,"type":15},"Monitoring","monitoring",{"name":3289,"slug":3290,"type":15},"Privacy","privacy",0,"https:\u002F\u002Fgithub.com\u002Flaravel\u002Fnightwatch-cursor-plugin","2026-07-16T06:02:16.946147",{"items":3295,"total":313},[3296],{"slug":4,"name":4,"fn":5,"description":6,"org":3297,"tags":3298,"stars":23,"repoUrl":24,"updatedAt":25},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3299,3300,3301,3302],{"name":18,"slug":19,"type":15},{"name":21,"slug":22,"type":15},{"name":9,"slug":8,"type":15},{"name":13,"slug":14,"type":15}]