hyperf-llm / chat
There is no license information available for the latest version (v1.0.3) of this package.
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-10-21 08:28:38 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);