lenorix/ai 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lenorix/ai

最新稳定版本:v0.1.15

Composer 安装命令:

composer require lenorix/ai

包简介

PHP SDK for AI APIs

README 文档

README

Latest Version on Packagist Tests Total Downloads

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 PDF Structured Output MCP Client
OpenAI
DeepSeek
Anthropic
Groq
Mistral
xAI
Google

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unlicense
  • 更新时间: 2025-05-21