init ai sdk

This commit is contained in:
2026-05-10 11:08:07 +03:30
parent c5b4729518
commit 5f210c6c73
6 changed files with 350 additions and 0 deletions

37
stubs/tool.stub Normal file
View File

@@ -0,0 +1,37 @@
<?php
namespace {{ namespace }};
use Illuminate\Contracts\JsonSchema\JsonSchema;
use Laravel\Ai\Contracts\Tool;
use Laravel\Ai\Tools\Request;
use Stringable;
class {{ class }} implements Tool
{
/**
* Get the description of the tool's purpose.
*/
public function description(): Stringable|string
{
return 'A description of the tool.';
}
/**
* Execute the tool.
*/
public function handle(Request $request): Stringable|string
{
//
}
/**
* Get the tool's schema definition.
*/
public function schema(JsonSchema $schema): array
{
return [
'value' => $schema->string()->required(),
];
}
}