johadtech/deepseek-v3
Composer 安装命令:
composer require johadtech/deepseek-v3
包简介
A Laravel package for integrating DeepSeek V3 API.
README 文档
README
A robust Laravel package for integrating the DeepSeek V3 API.
Installation
Step 1: Install via Composer
Run the following command in your terminal:
composer require johadtech/deepseek-v3
Step 2: Publish the Configuration File
Once installed, publish the package configuration file using:
php artisan vendor:publish --provider="Johadtech\DeepSeekV3\Providers\DeepSeekServiceProvider" --tag="deepseek-config"
Step 3: Set Up Your API Key
Open your .env file and add the following entry:
DEEPSEEK_API_KEY=your_api_key_here
Replace your_api_key_here with your actual DeepSeek API key.
Usage
Basic Chat Completion
To send a simple chat message to DeepSeek:
use Johadtech\DeepSeekV3\Facades\DeepSeek; $response = DeepSeek::chat([ ['role' => 'user', 'content' => 'Hello'] ]); echo $response['content'];
Advanced Chat Completion with Parameters
You can also specify additional parameters for more control:
$response = DeepSeek::chat( messages: [ ['role' => 'user', 'content' => 'Explain quantum computing'] ], params: [ 'model' => 'deepseek-reasoner', 'temperature' => 0.7, 'max_tokens' => 1000 ] );
Handling Errors
Ensure you catch exceptions when making API calls:
try { $response = DeepSeek::chat([['role' => 'user', 'content' => 'Tell me a joke']]); echo $response['content']; } catch (Exception $e) { echo "Error: " . $e->getMessage(); }
Testing
To run tests, use:
composer test
Ensure you have PHPUnit installed in your development environment.
Documentation
For full documentation, visit DeepSeek API Docs.
Contributing
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch (
feature-name). - Commit your changes.
- Submit a pull request.
License
This package is licensed under the MIT License. See the LICENSE file for details.
johadtech/deepseek-v3 适用场景与选型建议
johadtech/deepseek-v3 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 02 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 johadtech/deepseek-v3 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 johadtech/deepseek-v3 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-09