File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -96,3 +96,23 @@ final readonly class McpController
96
96
}
97
97
}
98
98
```
99
+
100
+ ### Exposing Tools
101
+
102
+ Under the hood the SDK uses [ LLM Chain] ( https://github.com/php-llm/llm-chain ) 's ` ToolBox ` to register, analyze and
103
+ execute tools. In combination with its [ Symfony Bundle] ( https://github.com/php-llm/llm-chain-bundle ) you can expose
104
+ tools with ` #[AsTool] ` attribute.
105
+
106
+ ``` php
107
+ use PhpLlm\LlmChain\ToolBox\Attribute\AsTool;
108
+
109
+ #[AsTool('company_name', 'Provides the name of your company')]
110
+ final class CompanyName
111
+ {
112
+ public function __invoke(): string
113
+ {
114
+ return 'ACME Corp.'
115
+ }
116
+ }
117
+ ```
118
+ See [ LLM Chain Documentation] ( https://github.com/php-llm/llm-chain?tab=readme-ov-file#tools ) for more information.
You can’t perform that action at this time.
0 commit comments