hyperf-llm / chat
该包最新版本(v1.0.3)没有可用的许可信息。
hyperf版本,支持市面上主流的chat引擎
v1.0.3
2023-12-21 06:30 UTC
Requires
- php: >=8.0
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ^6|^7.5
- hyperf/config: ^3.0
- hyperf/constants: ^3.0
- hyperf/di: ^3.0
- hyperf/framework: ~3.0.0
- hyperf/http-server: ~3.0.0
- hyperf/websocket-client: ^3.0
- orhanerday/open-ai: ^4.7
- psr/simple-cache: ^1.0|^2.0|^3.0
- symfony/yaml: ^6.3|^5
Requires (Dev)
- swoole/ide-helper: ^4.5
This package is auto-updated.
Last update: 2024-09-21 08:20:02 UTC
README
安装说明
composer require hyperf-llm/chat
发布
php bin/hyperf.php vendor:publish hyperf-llm/chat
ChatGPT使用指南
llm配置项'default'设置为'ChatGpt',
$chatBean = new ChatBean();
$chatBean->setPrompt('介绍一下hyperf');
$chatBean->setModel('gpt-3.5-turbo');
$llm = LLMFactory::create();
$llm ->send($chatBean);
星火使用指南
llm配置项'default'设置为'Spark',
$chatBean = new SparkBean();
$chatBean->setPrompt('介绍一下hyperf');
$llm = LLMFactory::create();
$llm ->send($chatBean);
文心一言
llm配置项'default'设置为'WenXin',
$chatBean = new WenXinBean();
$chatBean->setPrompt('介绍一下hyperf');
$llm = LLMFactory::create();
return $llm ->send($chatBean);