* add a fallback for none exist demo data sources.
This commit is contained in:
@@ -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
|
||||
(
|
||||
|
||||
@@ -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
|
||||
(
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user