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

This package is auto-updated.

Last update: 2024-04-21 07:24:19 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);