From 9e2c5f85e1398358bfa5e8b1ba687974c0ced0c8 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Thu, 26 Sep 2024 11:41:26 +0000 Subject: [PATCH] Support API GenerateBroadcastNews. --- ChangeLog.md | 7 + src/Models/GenerateBroadcastNewsRequest.php | 49 ++++++ src/Models/GenerateBroadcastNewsResponse.php | 71 +++++++++ .../GenerateBroadcastNewsResponseBody.php | 118 +++++++++++++++ .../data.php | 113 ++++++++++++++ .../data/hotTopicSummaries.php | 140 ++++++++++++++++++ .../data/hotTopicSummaries/images.php | 49 ++++++ .../data/usage.php | 77 ++++++++++ src/Models/RunCommentGenerationRequest.php | 87 +++++++++++ src/Models/RunCommentGenerationResponse.php | 71 +++++++++ .../RunCommentGenerationResponseBody.php | 73 +++++++++ .../header.php | 117 +++++++++++++++ .../payload.php | 61 ++++++++ .../payload/output.php | 47 ++++++ .../payload/usage.php | 77 ++++++++++ src/Models/RunVideoAnalysisRequest.php | 24 +++ src/Models/RunVideoAnalysisShrinkRequest.php | 24 +++ src/QuanMiaoLightApp.php | 123 +++++++++++++++ 18 files changed, 1328 insertions(+) create mode 100644 src/Models/GenerateBroadcastNewsRequest.php create mode 100644 src/Models/GenerateBroadcastNewsResponse.php create mode 100644 src/Models/GenerateBroadcastNewsResponseBody.php create mode 100644 src/Models/GenerateBroadcastNewsResponseBody/data.php create mode 100644 src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries.php create mode 100644 src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries/images.php create mode 100644 src/Models/GenerateBroadcastNewsResponseBody/data/usage.php create mode 100644 src/Models/RunCommentGenerationRequest.php create mode 100644 src/Models/RunCommentGenerationResponse.php create mode 100644 src/Models/RunCommentGenerationResponseBody.php create mode 100644 src/Models/RunCommentGenerationResponseBody/header.php create mode 100644 src/Models/RunCommentGenerationResponseBody/payload.php create mode 100644 src/Models/RunCommentGenerationResponseBody/payload/output.php create mode 100644 src/Models/RunCommentGenerationResponseBody/payload/usage.php diff --git a/ChangeLog.md b/ChangeLog.md index cf2029c..8c36b57 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,10 @@ +2024-09-26 Version: 1.4.0 +- Support API GenerateBroadcastNews. +- Support API RunCommentGeneration. +- Update API RunVideoAnalysis: add param snapshotInterval. +- Update API RunVideoAnalysis: add param videoExtraInfo. + + 2024-09-14 Version: 1.3.0 - Support API ListHotTopicSummaries. - Update API RunVideoAnalysis: update response param. diff --git a/src/Models/GenerateBroadcastNewsRequest.php b/src/Models/GenerateBroadcastNewsRequest.php new file mode 100644 index 0000000..339cc9a --- /dev/null +++ b/src/Models/GenerateBroadcastNewsRequest.php @@ -0,0 +1,49 @@ + 'prompt', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->prompt) { + $res['prompt'] = $this->prompt; + } + + return $res; + } + + /** + * @param array $map + * + * @return GenerateBroadcastNewsRequest + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['prompt'])) { + $model->prompt = $map['prompt']; + } + + return $model; + } +} diff --git a/src/Models/GenerateBroadcastNewsResponse.php b/src/Models/GenerateBroadcastNewsResponse.php new file mode 100644 index 0000000..6e19217 --- /dev/null +++ b/src/Models/GenerateBroadcastNewsResponse.php @@ -0,0 +1,71 @@ + 'headers', + 'statusCode' => 'statusCode', + 'body' => 'body', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->headers) { + $res['headers'] = $this->headers; + } + if (null !== $this->statusCode) { + $res['statusCode'] = $this->statusCode; + } + if (null !== $this->body) { + $res['body'] = null !== $this->body ? $this->body->toMap() : null; + } + + return $res; + } + + /** + * @param array $map + * + * @return GenerateBroadcastNewsResponse + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['headers'])) { + $model->headers = $map['headers']; + } + if (isset($map['statusCode'])) { + $model->statusCode = $map['statusCode']; + } + if (isset($map['body'])) { + $model->body = GenerateBroadcastNewsResponseBody::fromMap($map['body']); + } + + return $model; + } +} diff --git a/src/Models/GenerateBroadcastNewsResponseBody.php b/src/Models/GenerateBroadcastNewsResponseBody.php new file mode 100644 index 0000000..ed66a52 --- /dev/null +++ b/src/Models/GenerateBroadcastNewsResponseBody.php @@ -0,0 +1,118 @@ + 'code', + 'data' => 'data', + 'httpStatusCode' => 'httpStatusCode', + 'message' => 'message', + 'requestId' => 'requestId', + 'success' => 'success', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->code) { + $res['code'] = $this->code; + } + if (null !== $this->data) { + $res['data'] = null !== $this->data ? $this->data->toMap() : null; + } + if (null !== $this->httpStatusCode) { + $res['httpStatusCode'] = $this->httpStatusCode; + } + if (null !== $this->message) { + $res['message'] = $this->message; + } + if (null !== $this->requestId) { + $res['requestId'] = $this->requestId; + } + if (null !== $this->success) { + $res['success'] = $this->success; + } + + return $res; + } + + /** + * @param array $map + * + * @return GenerateBroadcastNewsResponseBody + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['code'])) { + $model->code = $map['code']; + } + if (isset($map['data'])) { + $model->data = data::fromMap($map['data']); + } + if (isset($map['httpStatusCode'])) { + $model->httpStatusCode = $map['httpStatusCode']; + } + if (isset($map['message'])) { + $model->message = $map['message']; + } + if (isset($map['requestId'])) { + $model->requestId = $map['requestId']; + } + if (isset($map['success'])) { + $model->success = $map['success']; + } + + return $model; + } +} diff --git a/src/Models/GenerateBroadcastNewsResponseBody/data.php b/src/Models/GenerateBroadcastNewsResponseBody/data.php new file mode 100644 index 0000000..13d7d99 --- /dev/null +++ b/src/Models/GenerateBroadcastNewsResponseBody/data.php @@ -0,0 +1,113 @@ + 'hotTopicSummaries', + 'sessionId' => 'sessionId', + 'taskId' => 'taskId', + 'text' => 'text', + 'usage' => 'usage', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->hotTopicSummaries) { + $res['hotTopicSummaries'] = []; + if (null !== $this->hotTopicSummaries && \is_array($this->hotTopicSummaries)) { + $n = 0; + foreach ($this->hotTopicSummaries as $item) { + $res['hotTopicSummaries'][$n++] = null !== $item ? $item->toMap() : $item; + } + } + } + if (null !== $this->sessionId) { + $res['sessionId'] = $this->sessionId; + } + if (null !== $this->taskId) { + $res['taskId'] = $this->taskId; + } + if (null !== $this->text) { + $res['text'] = $this->text; + } + if (null !== $this->usage) { + $res['usage'] = null !== $this->usage ? $this->usage->toMap() : null; + } + + return $res; + } + + /** + * @param array $map + * + * @return data + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['hotTopicSummaries'])) { + if (!empty($map['hotTopicSummaries'])) { + $model->hotTopicSummaries = []; + $n = 0; + foreach ($map['hotTopicSummaries'] as $item) { + $model->hotTopicSummaries[$n++] = null !== $item ? hotTopicSummaries::fromMap($item) : $item; + } + } + } + if (isset($map['sessionId'])) { + $model->sessionId = $map['sessionId']; + } + if (isset($map['taskId'])) { + $model->taskId = $map['taskId']; + } + if (isset($map['text'])) { + $model->text = $map['text']; + } + if (isset($map['usage'])) { + $model->usage = usage::fromMap($map['usage']); + } + + return $model; + } +} diff --git a/src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries.php b/src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries.php new file mode 100644 index 0000000..4765b63 --- /dev/null +++ b/src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries.php @@ -0,0 +1,140 @@ + 'category', + 'hotTopic' => 'hotTopic', + 'hotTopicVersion' => 'hotTopicVersion', + 'hotValue' => 'hotValue', + 'id' => 'id', + 'images' => 'images', + 'textSummary' => 'textSummary', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->category) { + $res['category'] = $this->category; + } + if (null !== $this->hotTopic) { + $res['hotTopic'] = $this->hotTopic; + } + if (null !== $this->hotTopicVersion) { + $res['hotTopicVersion'] = $this->hotTopicVersion; + } + if (null !== $this->hotValue) { + $res['hotValue'] = $this->hotValue; + } + if (null !== $this->id) { + $res['id'] = $this->id; + } + if (null !== $this->images) { + $res['images'] = []; + if (null !== $this->images && \is_array($this->images)) { + $n = 0; + foreach ($this->images as $item) { + $res['images'][$n++] = null !== $item ? $item->toMap() : $item; + } + } + } + if (null !== $this->textSummary) { + $res['textSummary'] = $this->textSummary; + } + + return $res; + } + + /** + * @param array $map + * + * @return hotTopicSummaries + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['category'])) { + $model->category = $map['category']; + } + if (isset($map['hotTopic'])) { + $model->hotTopic = $map['hotTopic']; + } + if (isset($map['hotTopicVersion'])) { + $model->hotTopicVersion = $map['hotTopicVersion']; + } + if (isset($map['hotValue'])) { + $model->hotValue = $map['hotValue']; + } + if (isset($map['id'])) { + $model->id = $map['id']; + } + if (isset($map['images'])) { + if (!empty($map['images'])) { + $model->images = []; + $n = 0; + foreach ($map['images'] as $item) { + $model->images[$n++] = null !== $item ? images::fromMap($item) : $item; + } + } + } + if (isset($map['textSummary'])) { + $model->textSummary = $map['textSummary']; + } + + return $model; + } +} diff --git a/src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries/images.php b/src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries/images.php new file mode 100644 index 0000000..85a43c3 --- /dev/null +++ b/src/Models/GenerateBroadcastNewsResponseBody/data/hotTopicSummaries/images.php @@ -0,0 +1,49 @@ + 'url', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->url) { + $res['url'] = $this->url; + } + + return $res; + } + + /** + * @param array $map + * + * @return images + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['url'])) { + $model->url = $map['url']; + } + + return $model; + } +} diff --git a/src/Models/GenerateBroadcastNewsResponseBody/data/usage.php b/src/Models/GenerateBroadcastNewsResponseBody/data/usage.php new file mode 100644 index 0000000..01c4b3c --- /dev/null +++ b/src/Models/GenerateBroadcastNewsResponseBody/data/usage.php @@ -0,0 +1,77 @@ + 'inputTokens', + 'outputTokens' => 'outputTokens', + 'totalTokens' => 'totalTokens', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->inputTokens) { + $res['inputTokens'] = $this->inputTokens; + } + if (null !== $this->outputTokens) { + $res['outputTokens'] = $this->outputTokens; + } + if (null !== $this->totalTokens) { + $res['totalTokens'] = $this->totalTokens; + } + + return $res; + } + + /** + * @param array $map + * + * @return usage + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['inputTokens'])) { + $model->inputTokens = $map['inputTokens']; + } + if (isset($map['outputTokens'])) { + $model->outputTokens = $map['outputTokens']; + } + if (isset($map['totalTokens'])) { + $model->totalTokens = $map['totalTokens']; + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationRequest.php b/src/Models/RunCommentGenerationRequest.php new file mode 100644 index 0000000..e9d855b --- /dev/null +++ b/src/Models/RunCommentGenerationRequest.php @@ -0,0 +1,87 @@ + 'length', + 'numComments' => 'numComments', + 'sourceMaterial' => 'sourceMaterial', + 'style' => 'style', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->length) { + $res['length'] = $this->length; + } + if (null !== $this->numComments) { + $res['numComments'] = $this->numComments; + } + if (null !== $this->sourceMaterial) { + $res['sourceMaterial'] = $this->sourceMaterial; + } + if (null !== $this->style) { + $res['style'] = $this->style; + } + + return $res; + } + + /** + * @param array $map + * + * @return RunCommentGenerationRequest + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['length'])) { + $model->length = $map['length']; + } + if (isset($map['numComments'])) { + $model->numComments = $map['numComments']; + } + if (isset($map['sourceMaterial'])) { + $model->sourceMaterial = $map['sourceMaterial']; + } + if (isset($map['style'])) { + $model->style = $map['style']; + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationResponse.php b/src/Models/RunCommentGenerationResponse.php new file mode 100644 index 0000000..daa4ffc --- /dev/null +++ b/src/Models/RunCommentGenerationResponse.php @@ -0,0 +1,71 @@ + 'headers', + 'statusCode' => 'statusCode', + 'body' => 'body', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->headers) { + $res['headers'] = $this->headers; + } + if (null !== $this->statusCode) { + $res['statusCode'] = $this->statusCode; + } + if (null !== $this->body) { + $res['body'] = null !== $this->body ? $this->body->toMap() : null; + } + + return $res; + } + + /** + * @param array $map + * + * @return RunCommentGenerationResponse + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['headers'])) { + $model->headers = $map['headers']; + } + if (isset($map['statusCode'])) { + $model->statusCode = $map['statusCode']; + } + if (isset($map['body'])) { + $model->body = RunCommentGenerationResponseBody::fromMap($map['body']); + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationResponseBody.php b/src/Models/RunCommentGenerationResponseBody.php new file mode 100644 index 0000000..46b3668 --- /dev/null +++ b/src/Models/RunCommentGenerationResponseBody.php @@ -0,0 +1,73 @@ + 'end', + 'header' => 'header', + 'payload' => 'payload', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->end) { + $res['end'] = $this->end; + } + if (null !== $this->header) { + $res['header'] = null !== $this->header ? $this->header->toMap() : null; + } + if (null !== $this->payload) { + $res['payload'] = null !== $this->payload ? $this->payload->toMap() : null; + } + + return $res; + } + + /** + * @param array $map + * + * @return RunCommentGenerationResponseBody + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['end'])) { + $model->end = $map['end']; + } + if (isset($map['header'])) { + $model->header = header::fromMap($map['header']); + } + if (isset($map['payload'])) { + $model->payload = payload::fromMap($map['payload']); + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationResponseBody/header.php b/src/Models/RunCommentGenerationResponseBody/header.php new file mode 100644 index 0000000..abe594b --- /dev/null +++ b/src/Models/RunCommentGenerationResponseBody/header.php @@ -0,0 +1,117 @@ + 'event', + 'eventInfo' => 'eventInfo', + 'requestId' => 'requestId', + 'sessionId' => 'sessionId', + 'taskId' => 'taskId', + 'traceId' => 'traceId', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->event) { + $res['event'] = $this->event; + } + if (null !== $this->eventInfo) { + $res['eventInfo'] = $this->eventInfo; + } + if (null !== $this->requestId) { + $res['requestId'] = $this->requestId; + } + if (null !== $this->sessionId) { + $res['sessionId'] = $this->sessionId; + } + if (null !== $this->taskId) { + $res['taskId'] = $this->taskId; + } + if (null !== $this->traceId) { + $res['traceId'] = $this->traceId; + } + + return $res; + } + + /** + * @param array $map + * + * @return header + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['event'])) { + $model->event = $map['event']; + } + if (isset($map['eventInfo'])) { + $model->eventInfo = $map['eventInfo']; + } + if (isset($map['requestId'])) { + $model->requestId = $map['requestId']; + } + if (isset($map['sessionId'])) { + $model->sessionId = $map['sessionId']; + } + if (isset($map['taskId'])) { + $model->taskId = $map['taskId']; + } + if (isset($map['traceId'])) { + $model->traceId = $map['traceId']; + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationResponseBody/payload.php b/src/Models/RunCommentGenerationResponseBody/payload.php new file mode 100644 index 0000000..cf82ffa --- /dev/null +++ b/src/Models/RunCommentGenerationResponseBody/payload.php @@ -0,0 +1,61 @@ + 'output', + 'usage' => 'usage', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->output) { + $res['output'] = null !== $this->output ? $this->output->toMap() : null; + } + if (null !== $this->usage) { + $res['usage'] = null !== $this->usage ? $this->usage->toMap() : null; + } + + return $res; + } + + /** + * @param array $map + * + * @return payload + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['output'])) { + $model->output = output::fromMap($map['output']); + } + if (isset($map['usage'])) { + $model->usage = usage::fromMap($map['usage']); + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationResponseBody/payload/output.php b/src/Models/RunCommentGenerationResponseBody/payload/output.php new file mode 100644 index 0000000..4c3cafa --- /dev/null +++ b/src/Models/RunCommentGenerationResponseBody/payload/output.php @@ -0,0 +1,47 @@ + 'text', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->text) { + $res['text'] = $this->text; + } + + return $res; + } + + /** + * @param array $map + * + * @return output + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['text'])) { + $model->text = $map['text']; + } + + return $model; + } +} diff --git a/src/Models/RunCommentGenerationResponseBody/payload/usage.php b/src/Models/RunCommentGenerationResponseBody/payload/usage.php new file mode 100644 index 0000000..e8749a7 --- /dev/null +++ b/src/Models/RunCommentGenerationResponseBody/payload/usage.php @@ -0,0 +1,77 @@ + 'inputTokens', + 'outputTokens' => 'outputTokens', + 'totalTokens' => 'totalTokens', + ]; + + public function validate() + { + } + + public function toMap() + { + $res = []; + if (null !== $this->inputTokens) { + $res['inputTokens'] = $this->inputTokens; + } + if (null !== $this->outputTokens) { + $res['outputTokens'] = $this->outputTokens; + } + if (null !== $this->totalTokens) { + $res['totalTokens'] = $this->totalTokens; + } + + return $res; + } + + /** + * @param array $map + * + * @return usage + */ + public static function fromMap($map = []) + { + $model = new self(); + if (isset($map['inputTokens'])) { + $model->inputTokens = $map['inputTokens']; + } + if (isset($map['outputTokens'])) { + $model->outputTokens = $map['outputTokens']; + } + if (isset($map['totalTokens'])) { + $model->totalTokens = $map['totalTokens']; + } + + return $model; + } +} diff --git a/src/Models/RunVideoAnalysisRequest.php b/src/Models/RunVideoAnalysisRequest.php index 763fc1b..b5de014 100644 --- a/src/Models/RunVideoAnalysisRequest.php +++ b/src/Models/RunVideoAnalysisRequest.php @@ -39,6 +39,11 @@ class RunVideoAnalysisRequest extends Model */ public $originalSessionId; + /** + * @var float + */ + public $snapshotInterval; + /** * @example a3d1c2ac-f086-4a21-9069-f5631542f5a2 * @@ -46,6 +51,11 @@ class RunVideoAnalysisRequest extends Model */ public $taskId; + /** + * @var string + */ + public $videoExtraInfo; + /** * @var string */ @@ -70,7 +80,9 @@ class RunVideoAnalysisRequest extends Model 'modelCustomPromptTemplateId' => 'modelCustomPromptTemplateId', 'modelId' => 'modelId', 'originalSessionId' => 'originalSessionId', + 'snapshotInterval' => 'snapshotInterval', 'taskId' => 'taskId', + 'videoExtraInfo' => 'videoExtraInfo', 'videoModelCustomPromptTemplate' => 'videoModelCustomPromptTemplate', 'videoModelId' => 'videoModelId', 'videoUrl' => 'videoUrl', @@ -98,9 +110,15 @@ public function toMap() if (null !== $this->originalSessionId) { $res['originalSessionId'] = $this->originalSessionId; } + if (null !== $this->snapshotInterval) { + $res['snapshotInterval'] = $this->snapshotInterval; + } if (null !== $this->taskId) { $res['taskId'] = $this->taskId; } + if (null !== $this->videoExtraInfo) { + $res['videoExtraInfo'] = $this->videoExtraInfo; + } if (null !== $this->videoModelCustomPromptTemplate) { $res['videoModelCustomPromptTemplate'] = $this->videoModelCustomPromptTemplate; } @@ -139,9 +157,15 @@ public static function fromMap($map = []) if (isset($map['originalSessionId'])) { $model->originalSessionId = $map['originalSessionId']; } + if (isset($map['snapshotInterval'])) { + $model->snapshotInterval = $map['snapshotInterval']; + } if (isset($map['taskId'])) { $model->taskId = $map['taskId']; } + if (isset($map['videoExtraInfo'])) { + $model->videoExtraInfo = $map['videoExtraInfo']; + } if (isset($map['videoModelCustomPromptTemplate'])) { $model->videoModelCustomPromptTemplate = $map['videoModelCustomPromptTemplate']; } diff --git a/src/Models/RunVideoAnalysisShrinkRequest.php b/src/Models/RunVideoAnalysisShrinkRequest.php index 5b6c888..824fade 100644 --- a/src/Models/RunVideoAnalysisShrinkRequest.php +++ b/src/Models/RunVideoAnalysisShrinkRequest.php @@ -39,6 +39,11 @@ class RunVideoAnalysisShrinkRequest extends Model */ public $originalSessionId; + /** + * @var float + */ + public $snapshotInterval; + /** * @example a3d1c2ac-f086-4a21-9069-f5631542f5a2 * @@ -46,6 +51,11 @@ class RunVideoAnalysisShrinkRequest extends Model */ public $taskId; + /** + * @var string + */ + public $videoExtraInfo; + /** * @var string */ @@ -70,7 +80,9 @@ class RunVideoAnalysisShrinkRequest extends Model 'modelCustomPromptTemplateId' => 'modelCustomPromptTemplateId', 'modelId' => 'modelId', 'originalSessionId' => 'originalSessionId', + 'snapshotInterval' => 'snapshotInterval', 'taskId' => 'taskId', + 'videoExtraInfo' => 'videoExtraInfo', 'videoModelCustomPromptTemplate' => 'videoModelCustomPromptTemplate', 'videoModelId' => 'videoModelId', 'videoUrl' => 'videoUrl', @@ -98,9 +110,15 @@ public function toMap() if (null !== $this->originalSessionId) { $res['originalSessionId'] = $this->originalSessionId; } + if (null !== $this->snapshotInterval) { + $res['snapshotInterval'] = $this->snapshotInterval; + } if (null !== $this->taskId) { $res['taskId'] = $this->taskId; } + if (null !== $this->videoExtraInfo) { + $res['videoExtraInfo'] = $this->videoExtraInfo; + } if (null !== $this->videoModelCustomPromptTemplate) { $res['videoModelCustomPromptTemplate'] = $this->videoModelCustomPromptTemplate; } @@ -137,9 +155,15 @@ public static function fromMap($map = []) if (isset($map['originalSessionId'])) { $model->originalSessionId = $map['originalSessionId']; } + if (isset($map['snapshotInterval'])) { + $model->snapshotInterval = $map['snapshotInterval']; + } if (isset($map['taskId'])) { $model->taskId = $map['taskId']; } + if (isset($map['videoExtraInfo'])) { + $model->videoExtraInfo = $map['videoExtraInfo']; + } if (isset($map['videoModelCustomPromptTemplate'])) { $model->videoModelCustomPromptTemplate = $map['videoModelCustomPromptTemplate']; } diff --git a/src/QuanMiaoLightApp.php b/src/QuanMiaoLightApp.php index 7b5e987..df6ae32 100644 --- a/src/QuanMiaoLightApp.php +++ b/src/QuanMiaoLightApp.php @@ -6,8 +6,12 @@ use AlibabaCloud\Endpoint\Endpoint; use AlibabaCloud\OpenApiUtil\OpenApiUtilClient; +use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\GenerateBroadcastNewsRequest; +use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\GenerateBroadcastNewsResponse; use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\ListHotTopicSummariesRequest; use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\ListHotTopicSummariesResponse; +use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunCommentGenerationRequest; +use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunCommentGenerationResponse; use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunMarketingInformationExtractRequest; use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunMarketingInformationExtractResponse; use AlibabaCloud\SDK\QuanMiaoLightApp\V20240801\Models\RunMarketingInformationExtractShrinkRequest; @@ -62,6 +66,58 @@ public function getEndpoint($productId, $regionId, $endpointRule, $network, $suf return Endpoint::getEndpointRules($productId, $regionId, $endpointRule, $network, $suffix); } + /** + * @summary 新闻播报-抽取分类获取播报热点 + * * + * @param string $workspaceId + * @param GenerateBroadcastNewsRequest $request GenerateBroadcastNewsRequest + * @param string[] $headers map + * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions + * + * @return GenerateBroadcastNewsResponse GenerateBroadcastNewsResponse + */ + public function generateBroadcastNewsWithOptions($workspaceId, $request, $headers, $runtime) + { + Utils::validateModel($request); + $body = []; + if (!Utils::isUnset($request->prompt)) { + $body['prompt'] = $request->prompt; + } + $req = new OpenApiRequest([ + 'headers' => $headers, + 'body' => OpenApiUtilClient::parseToMap($body), + ]); + $params = new Params([ + 'action' => 'GenerateBroadcastNews', + 'version' => '2024-08-01', + 'protocol' => 'HTTPS', + 'pathname' => '/' . OpenApiUtilClient::getEncodeParam($workspaceId) . '/quanmiao/lightapp/GenerateBroadcastNews', + 'method' => 'POST', + 'authType' => 'AK', + 'style' => 'ROA', + 'reqBodyType' => 'formData', + 'bodyType' => 'json', + ]); + + return GenerateBroadcastNewsResponse::fromMap($this->callApi($params, $req, $runtime)); + } + + /** + * @summary 新闻播报-抽取分类获取播报热点 + * * + * @param string $workspaceId + * @param GenerateBroadcastNewsRequest $request GenerateBroadcastNewsRequest + * + * @return GenerateBroadcastNewsResponse GenerateBroadcastNewsResponse + */ + public function generateBroadcastNews($workspaceId, $request) + { + $runtime = new RuntimeOptions([]); + $headers = []; + + return $this->generateBroadcastNewsWithOptions($workspaceId, $request, $headers, $runtime); + } + /** * @summary 轻应用-新闻播报-获取热点话题摘要列表 * * @@ -126,6 +182,67 @@ public function listHotTopicSummaries($workspaceId, $request) return $this->listHotTopicSummariesWithOptions($workspaceId, $request, $headers, $runtime); } + /** + * @summary 评论生成服务 + * * + * @param string $workspaceId + * @param RunCommentGenerationRequest $request RunCommentGenerationRequest + * @param string[] $headers map + * @param RuntimeOptions $runtime runtime options for this request RuntimeOptions + * + * @return RunCommentGenerationResponse RunCommentGenerationResponse + */ + public function runCommentGenerationWithOptions($workspaceId, $request, $headers, $runtime) + { + Utils::validateModel($request); + $body = []; + if (!Utils::isUnset($request->length)) { + $body['length'] = $request->length; + } + if (!Utils::isUnset($request->numComments)) { + $body['numComments'] = $request->numComments; + } + if (!Utils::isUnset($request->sourceMaterial)) { + $body['sourceMaterial'] = $request->sourceMaterial; + } + if (!Utils::isUnset($request->style)) { + $body['style'] = $request->style; + } + $req = new OpenApiRequest([ + 'headers' => $headers, + 'body' => OpenApiUtilClient::parseToMap($body), + ]); + $params = new Params([ + 'action' => 'RunCommentGeneration', + 'version' => '2024-08-01', + 'protocol' => 'HTTPS', + 'pathname' => '/' . OpenApiUtilClient::getEncodeParam($workspaceId) . '/quanmiao/lightapp/runCommentGeneration', + 'method' => 'POST', + 'authType' => 'AK', + 'style' => 'ROA', + 'reqBodyType' => 'formData', + 'bodyType' => 'json', + ]); + + return RunCommentGenerationResponse::fromMap($this->callApi($params, $req, $runtime)); + } + + /** + * @summary 评论生成服务 + * * + * @param string $workspaceId + * @param RunCommentGenerationRequest $request RunCommentGenerationRequest + * + * @return RunCommentGenerationResponse RunCommentGenerationResponse + */ + public function runCommentGeneration($workspaceId, $request) + { + $runtime = new RuntimeOptions([]); + $headers = []; + + return $this->runCommentGenerationWithOptions($workspaceId, $request, $headers, $runtime); + } + /** * @summary 营销信息抽取服务 * * @@ -484,9 +601,15 @@ public function runVideoAnalysisWithOptions($workspaceId, $tmpReq, $headers, $ru if (!Utils::isUnset($request->originalSessionId)) { $body['originalSessionId'] = $request->originalSessionId; } + if (!Utils::isUnset($request->snapshotInterval)) { + $body['snapshotInterval'] = $request->snapshotInterval; + } if (!Utils::isUnset($request->taskId)) { $body['taskId'] = $request->taskId; } + if (!Utils::isUnset($request->videoExtraInfo)) { + $body['videoExtraInfo'] = $request->videoExtraInfo; + } if (!Utils::isUnset($request->videoModelCustomPromptTemplate)) { $body['videoModelCustomPromptTemplate'] = $request->videoModelCustomPromptTemplate; }