lenorix/ai
最新稳定版本:v0.1.15
Composer 安装命令:
composer require lenorix/ai
包简介
PHP SDK for AI APIs
关键字:
README 文档
README
TypeScript has Vercel AI SDK, Python has LangChain, and PHP has Lenorix AI SDK.
Support us
We are crafting open-source software for everyone, releasing it under the Unlicense to let it in the public domain. If you find our work useful, consider supporting us.
Implementations
| Service | Chat | Streaming | Tools | Vision | Caching | Structured Output | MCP Client | |
|---|---|---|---|---|---|---|---|---|
| OpenAI | ✓ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ |
| DeepSeek | ✓ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Anthropic | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Groq | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| Mistral | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| xAI | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
Installation
You can install the package via composer:
composer require lenorix/ai
Usage
use Lenorix\Ai\Provider\DeepSeek; use Lenorix\Ai\AiText; use Lenorix\Ai\Chat\ToolFromLambda; AiText::generate( provider: new DeepSeek('deepseek-chat', 'sk-********************************'), tools: [ // This is only an example, you can create your tool extending from CoreTool base class. new ToolFromLambda( fn ($city = 'madrid') => $city . ' is sunny', 'weather', 'get weather updated' ), ], system: 'help users to know the weather with updated information', prompt: 'tell me the weather', messages: [ ['role' => 'user', 'content' => 'hello'], ['role' => 'assistant', 'content' => 'hi!'] ], maxSteps: 50 );
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 172
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: Unlicense
- 更新时间: 2025-05-21