diff --git a/ChangeLog.md b/ChangeLog.md index 9545542..1ee9338 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +2024-12-11 Version: 2.0.1 +- Update API RunHotTopicChat: add param messages. + + 2024-12-05 Version: 2.0.0 - Delete API RunCommentGeneration. - Update API RunHotTopicChat: update response param. diff --git a/src/Models/RunHotTopicChatRequest.php b/src/Models/RunHotTopicChatRequest.php index b7d01d4..f182d02 100644 --- a/src/Models/RunHotTopicChatRequest.php +++ b/src/Models/RunHotTopicChatRequest.php @@ -4,6 +4,7 @@ namespace AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models; +use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunHotTopicChatRequest\messages; use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunHotTopicChatRequest\stepForBroadcastContentConfig; use AlibabaCloud\Tea\Model; @@ -38,6 +39,11 @@ class RunHotTopicChatRequest extends Model */ public $imageCount; + /** + * @var messages[] + */ + public $messages; + /** * @example xx * @@ -81,6 +87,7 @@ class RunHotTopicChatRequest extends Model 'hotTopicVersion' => 'hotTopicVersion', 'hotTopics' => 'hotTopics', 'imageCount' => 'imageCount', + 'messages' => 'messages', 'modelCustomPromptTemplate' => 'modelCustomPromptTemplate', 'modelId' => 'modelId', 'originalSessionId' => 'originalSessionId', @@ -111,6 +118,15 @@ public function toMap() if (null !== $this->imageCount) { $res['imageCount'] = $this->imageCount; } + if (null !== $this->messages) { + $res['messages'] = []; + if (null !== $this->messages && \is_array($this->messages)) { + $n = 0; + foreach ($this->messages as $item) { + $res['messages'][$n++] = null !== $item ? $item->toMap() : $item; + } + } + } if (null !== $this->modelCustomPromptTemplate) { $res['modelCustomPromptTemplate'] = $this->modelCustomPromptTemplate; } @@ -160,6 +176,15 @@ public static function fromMap($map = []) if (isset($map['imageCount'])) { $model->imageCount = $map['imageCount']; } + if (isset($map['messages'])) { + if (!empty($map['messages'])) { + $model->messages = []; + $n = 0; + foreach ($map['messages'] as $item) { + $model->messages[$n++] = null !== $item ? messages::fromMap($item) : $item; + } + } + } if (isset($map['modelCustomPromptTemplate'])) { $model->modelCustomPromptTemplate = $map['modelCustomPromptTemplate']; } diff --git a/src/Models/RunHotTopicChatRequest/messages.php b/src/Models/RunHotTopicChatRequest/messages.php new file mode 100644 index 0000000..b4770b5 --- /dev/null +++ b/src/Models/RunHotTopicChatRequest/messages.php @@ -0,0 +1,77 @@ + 'content', + 'createTime' => 'createTime', + 'role' => 'role', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->content) { + $res['content'] = $this->content; + } + if (null !== $this->createTime) { + $res['createTime'] = $this->createTime; + } + if (null !== $this->role) { + $res['role'] = $this->role; + } + + return $res; + } + + /** + * @param array $map + * + * @return messages + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['content'])) { + $model->content = $map['content']; + } + if (isset($map['createTime'])) { + $model->createTime = $map['createTime']; + } + if (isset($map['role'])) { + $model->role = $map['role']; + } + + return $model; + } +} diff --git a/src/Models/RunHotTopicChatShrinkRequest.php b/src/Models/RunHotTopicChatShrinkRequest.php index 11beacd..9fb5705 100644 --- a/src/Models/RunHotTopicChatShrinkRequest.php +++ b/src/Models/RunHotTopicChatShrinkRequest.php @@ -37,6 +37,11 @@ class RunHotTopicChatShrinkRequest extends Model */ public $imageCount; + /** + * @var string + */ + public $messagesShrink; + /** * @example xx * @@ -80,6 +85,7 @@ class RunHotTopicChatShrinkRequest extends Model 'hotTopicVersion' => 'hotTopicVersion', 'hotTopicsShrink' => 'hotTopics', 'imageCount' => 'imageCount', + 'messagesShrink' => 'messages', 'modelCustomPromptTemplate' => 'modelCustomPromptTemplate', 'modelId' => 'modelId', 'originalSessionId' => 'originalSessionId', @@ -110,6 +116,9 @@ public function toMap() if (null !== $this->imageCount) { $res['imageCount'] = $this->imageCount; } + if (null !== $this->messagesShrink) { + $res['messages'] = $this->messagesShrink; + } if (null !== $this->modelCustomPromptTemplate) { $res['modelCustomPromptTemplate'] = $this->modelCustomPromptTemplate; } @@ -155,6 +164,9 @@ public static function fromMap($map = []) if (isset($map['imageCount'])) { $model->imageCount = $map['imageCount']; } + if (isset($map['messages'])) { + $model->messagesShrink = $map['messages']; + } if (isset($map['modelCustomPromptTemplate'])) { $model->modelCustomPromptTemplate = $map['modelCustomPromptTemplate']; } diff --git a/src/QuanMiaoLightApp.php b/src/QuanMiaoLightApp.php index 238ce12..4ddb407 100644 --- a/src/QuanMiaoLightApp.php +++ b/src/QuanMiaoLightApp.php @@ -207,6 +207,9 @@ public function runHotTopicChatWithOptions($workspaceId, $tmpReq, $headers, $run if (!Utils::isUnset($tmpReq->hotTopics)) { $request->hotTopicsShrink = OpenApiUtilClient::arrayToStringWithSpecifiedStyle($tmpReq->hotTopics, 'hotTopics', 'json'); } + if (!Utils::isUnset($tmpReq->messages)) { + $request->messagesShrink = OpenApiUtilClient::arrayToStringWithSpecifiedStyle($tmpReq->messages, 'messages', 'json'); + } if (!Utils::isUnset($tmpReq->stepForBroadcastContentConfig)) { $request->stepForBroadcastContentConfigShrink = OpenApiUtilClient::arrayToStringWithSpecifiedStyle($tmpReq->stepForBroadcastContentConfig, 'stepForBroadcastContentConfig', 'json'); } @@ -226,6 +229,9 @@ public function runHotTopicChatWithOptions($workspaceId, $tmpReq, $headers, $run if (!Utils::isUnset($request->imageCount)) { $body['imageCount'] = $request->imageCount; } + if (!Utils::isUnset($request->messagesShrink)) { + $body['messages'] = $request->messagesShrink; + } if (!Utils::isUnset($request->modelCustomPromptTemplate)) { $body['modelCustomPromptTemplate'] = $request->modelCustomPromptTemplate; }