* add a fallback for none exist demo data sources.

This commit is contained in:
Chenjianyu
2023-07-20 14:21:16 +08:00
parent 052c119a16
commit 399bc08717
3 changed files with 4 additions and 0 deletions
+1
View File
@@ -379,6 +379,7 @@ $lang->ai->dataType->realStarted = $lang->ai->dataType->datetime;
$lang->ai->dataType->finishedDate = $lang->ai->dataType->datetime;
$lang->ai->demoData = new stdclass();
$lang->ai->demoData->notExist = 'The demo data does not exist for now.';
$lang->ai->demoData->story = array(
'story' => array
(
+1
View File
@@ -380,6 +380,7 @@ $lang->ai->dataType->realStarted = $lang->ai->dataType->datetime;
$lang->ai->dataType->finishedDate = $lang->ai->dataType->datetime;
$lang->ai->demoData = new stdclass();
$lang->ai->demoData->notExist = '暂无演示数据。';
$lang->ai->demoData->story = array(
'story' => array
(
+2
View File
@@ -575,6 +575,8 @@ class aiModel extends model
*/
public function generateDemoDataPrompt($module, $source)
{
if(empty($this->lang->ai->demoData->$module)) return $this->lang->ai->demoData->notExist;
$sources = explode(',', $source);
$sources = array_filter($sources);