更新question

This commit is contained in:
yaooo 2023-10-20 17:23:13 +08:00
parent a000ab203c
commit d89974dd51
6 changed files with 41 additions and 9 deletions

View File

@ -114,7 +114,7 @@ class XunFeiController extends BaseApiController
foreach($data_field as $k=>$v) { foreach($data_field as $k=>$v) {
$demand .= $k . '' . $v . ''; $demand .= $k . '' . $v . '';
} }
$question = "分析以下{$type_name}信息【{$demand}】请问有那些商机?"; $question = "根据以下{$type_name}信息【{$demand}】请问有那些商机?";
$chat=new ChatClient($this->app_id,$this->api_key,$this->api_secret); $chat=new ChatClient($this->app_id,$this->api_key,$this->api_secret);
$client = new Client($chat->assembleAuthUrl('wss://spark-api.xf-yun.com/v2.1/chat')); $client = new Client($chat->assembleAuthUrl('wss://spark-api.xf-yun.com/v2.1/chat'));
// 连接到 WebSocket 服务器 // 连接到 WebSocket 服务器

View File

@ -34,7 +34,7 @@ class AiAianalyse
foreach($data_field as $k=>$v) { foreach($data_field as $k=>$v) {
$demand .= $k . '' . $v . ''; $demand .= $k . '' . $v . '';
} }
$question = "分析以下{$type_name}信息【{$demand}】请问有那些商机?需要购买哪些商品?"; $question = "根据以下{$type_name}信息【{$demand}】请问有那些商机?需要购买哪些商品?";
try { try {
$chat=new ChatClient($this->app_id,$this->api_key,$this->api_secret); $chat=new ChatClient($this->app_id,$this->api_key,$this->api_secret);
$client = new Client($chat->assembleAuthUrl('wss://spark-api.xf-yun.com/v2.1/chat')); $client = new Client($chat->assembleAuthUrl('wss://spark-api.xf-yun.com/v2.1/chat'));

20
composer.lock generated
View File

@ -5301,11 +5301,22 @@
{ {
"name": "textalk/websocket", "name": "textalk/websocket",
"version": "1.6.3", "version": "1.6.3",
"source": {
"type": "git",
"url": "https://github.com/Textalk/websocket-php.git",
"reference": "67de79745b1a357caf812bfc44e0abf481cee012"
},
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://mirrors.cloud.tencent.com/repository/composer/textalk/websocket/1.6.3/textalk-websocket-1.6.3.zip", "url": "https://api.github.com/repos/Textalk/websocket-php/zipball/67de79745b1a357caf812bfc44e0abf481cee012",
"reference": "67de79745b1a357caf812bfc44e0abf481cee012", "reference": "67de79745b1a357caf812bfc44e0abf481cee012",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^7.4 | ^8.0", "php": "^7.4 | ^8.0",
@ -5325,6 +5336,7 @@
"WebSocket\\": "lib" "WebSocket\\": "lib"
} }
}, },
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"ISC" "ISC"
], ],
@ -5337,6 +5349,10 @@
} }
], ],
"description": "WebSocket client and server", "description": "WebSocket client and server",
"support": {
"issues": "https://github.com/Textalk/websocket-php/issues",
"source": "https://github.com/Textalk/websocket-php/tree/1.6.3"
},
"time": "2022-11-07T18:59:33+00:00" "time": "2022-11-07T18:59:33+00:00"
}, },
{ {

View File

@ -5610,11 +5610,22 @@
"name": "textalk/websocket", "name": "textalk/websocket",
"version": "1.6.3", "version": "1.6.3",
"version_normalized": "1.6.3.0", "version_normalized": "1.6.3.0",
"source": {
"type": "git",
"url": "https://github.com/Textalk/websocket-php.git",
"reference": "67de79745b1a357caf812bfc44e0abf481cee012"
},
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://mirrors.cloud.tencent.com/repository/composer/textalk/websocket/1.6.3/textalk-websocket-1.6.3.zip", "url": "https://api.github.com/repos/Textalk/websocket-php/zipball/67de79745b1a357caf812bfc44e0abf481cee012",
"reference": "67de79745b1a357caf812bfc44e0abf481cee012", "reference": "67de79745b1a357caf812bfc44e0abf481cee012",
"shasum": "" "shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"php": "^7.4 | ^8.0", "php": "^7.4 | ^8.0",
@ -5636,6 +5647,7 @@
"WebSocket\\": "lib" "WebSocket\\": "lib"
} }
}, },
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"ISC" "ISC"
], ],
@ -5648,6 +5660,10 @@
} }
], ],
"description": "WebSocket client and server", "description": "WebSocket client and server",
"support": {
"issues": "https://github.com/Textalk/websocket-php/issues",
"source": "https://github.com/Textalk/websocket-php/tree/1.6.3"
},
"install-path": "../textalk/websocket" "install-path": "../textalk/websocket"
}, },
{ {

View File

@ -3,7 +3,7 @@
'name' => 'topthink/think', 'name' => 'topthink/think',
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => 'a33f154b3124fdc0dfd6899f4340ae6e48e88e3a', 'reference' => 'a000ab203c7a08f4790746e40d2de9aa33cfc61d',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@ -775,7 +775,7 @@
'topthink/think' => array( 'topthink/think' => array(
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'reference' => 'a33f154b3124fdc0dfd6899f4340ae6e48e88e3a', 'reference' => 'a000ab203c7a08f4790746e40d2de9aa33cfc61d',
'type' => 'project', 'type' => 'project',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2023-10-17 09:37:44 // This file is automatically generated at:2023-10-20 16:31:01
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\app\\Service', 0 => 'think\\app\\Service',