インテリジェントなドキュメントのトーンリフレーズ機能を使用すると、ドキュメントのトーンを調整し、表現を改善し、ドキュメントをよりプロフェッショナル、よりリラックス、またはより分かりやすいトーンにリフレーズできます。
前提条件
Object Storage Service (OSS) バケットが Intelligent Media Management (IMM) プロジェクトに関連付けられています。OSS コンソールで IMM プロジェクトを OSS バケットに関連付ける方法の詳細については、「開始方法」をご参照ください。API 操作を呼び出して IMM プロジェクトをバケットに関連付ける方法の詳細については、「AttachOSSBucket」をご参照ください。
使用上の注意
インテリジェントなドキュメントのトーンリフレーズは、同期処理 (x-oss-process) のみをサポートします。
POST メソッドを使用してリクエストを送信する必要があります。
匿名アクセスは拒否されます。
この機能を使用するには、必要な権限が必要です。詳細については、「権限」をご参照ください。
パラメーター
アクション: doc/rephrase
次の表にパラメーターを示します。
パラメーター | タイプ | 必須 | 説明 |
tone | string | はい | ドキュメントをリフレーズするトーン。有効な値:
|
content | string | はい | リフレーズするコンテンツ。コンテンツは URL セーフな Base64 でエンコードする必要があります。 説明 コンテンツの長さは最大 19,500 バイトです。 |
format | string | いいえ | 応答を返すモード。有効な値:
|
次の表にレスポンスパラメーターを示します。
パラメーター | タイプ | 説明 |
RequestId | string | リクエスト ID。 |
Output | struct | 出力。 子ノード: Text および FinishReason |
Text | string | リフレーズされたコンテンツ。 親ノード: Output |
FinishReason | string | リフレーズタスクのステータス。有効な値:
親ノード: Output |
RESTful API の使用
RESTful API を使用してドキュメントをリフレーズする場合、ファイル名を指定する必要がありますが、これはプレースホルダーとしてのみ使用されます。インテリジェントなドキュメントのリフレーズでは、content パラメーターの値のみがリフレーズ対象のコンテンツとして識別されます。
通常モードでのドキュメントのリフレーズ
処理メソッド
リフレーズするファイル: example.doc
言い換え対象のテキスト:アーネスト・ヘミングウェイの「老人と海」は、老漁師サンティアゴと、彼が巨大なカジキを捕らえようとする壮大な闘いの物語です。この物語は、人間の忍耐力、不屈の精神、そして自然の力との闘いを深く探求したものです。逆境に直面しても揺るぎないサンティアゴの決意と尊厳は、人間の精神の強さの証となっています。
使用するトーン: relaxed
リクエストの例
POST /example.doc?x-oss-process HTTP/1.1
Host: doc-demo.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 28 Oct 2022 06:40:10 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
x-oss-process=doc/rephrase,tone_relaxed,content_RXJuZXN0IEhlbWluZ3dheSdzICJUaGUgT2xkIE1hbiBhbmQgdGhlIFNlYSIgaXMgYSB0YWxlIG9mIGFuIG9sZCBmaXNoZXJtYW4sIFNhbnRpYWdvLCBhbmQgaGlzIGVwaWMgc3RydWdnbGUgdG8gY2F0Y2ggYSBnaWFudCBtYXJsaW4uIFRoaXMgc3RvcnkgaXMgYSBwcm9mb3VuZCBleHBsb3JhdGlvbiBvZiBodW1hbiBlbmR1cmFuY2UsIHBlcnNldmVyYW5jZSwgYW5kIHRoZSBiYXR0bGUgYWdhaW5zdCB0aGUgZm9yY2VzIG9mIG5hdHVyZS4gU2FudGlhZ28ncyB1bndhdmVyaW5nIGRldGVybWluYXRpb24gYW5kIGRpZ25pdHkgaW4gdGhlIGZhY2Ugb2YgYWR2ZXJzaXR5IHNlcnZlIGFzIGEgdGVzdGFtZW50IHRvIHRoZSBzdHJlbmd0aCBvZiB0aGUgaHVtYW4gc3Bpcml0Lg==レスポンスの例
HTTP/1.1 200 OK
Server: AliyunOSS
Date: Thu, 10 Aug 2023 11:09:00 GMT
Content-Type: application/json;charset=UTF-8
Connection: close
Vary: Accept-Encoding
x-oss-request-id: 67614664D1170E36323E2D22
x-oss-server-time: 2010
Content-Encoding: gzip
{
"RequestId":"67614664D1170E36323E2D22",
"Output":{
"Text":"Ernest Hemingway's \"The Old Man and the Sea\" is a cool little story about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s all about how people keep going even when things get really tough, and how we stand up to nature's challenges with grit and grace. Santiago’s stubborn bravery and his dignity through it all show just how strong the human spirit can be. It’s like, if you ever feel down, just think of this guy battling it out with a huge fish for days!",
"FinishReason":"stop"
}
}SSE モードでのドキュメントのリフレーズ
処理メソッド
リフレーズするファイル: example.doc
言い換え対象のテキスト:アーネスト・ヘミングウェイの「老人と海」は、老漁師サンティアゴと、彼が巨大なカジキを捕らえようとする壮大な闘いの物語です。この物語は、人間の忍耐力、不屈の精神、そして自然の力との闘いを深く探求したものです。サンティアゴの揺るぎない決意と逆境に立ち向かう尊厳は、人間の精神の強さの証です。
使用するトーン: relaxed
レスポンスフォーマット: event-stream
リクエストの例
POST /example.doc?x-oss-process HTTP/1.1
Host: doc-demo.oss-cn-hangzhou.aliyuncs.com
Date: Fri, 28 Oct 2022 06:40:10 GMT
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e
x-oss-process=doc/rephrase,tone_relaxed,format_event-stream,content_RXJuZXN0IEhlbWluZ3dheSdzICJUaGUgT2xkIE1hbiBhbmQgdGhlIFNlYSIgaXMgYSB0YWxlIG9mIGFuIG9sZCBmaXNoZXJtYW4sIFNhbnRpYWdvLCBhbmQgaGlzIGVwaWMgc3RydWdnbGUgdG8gY2F0Y2ggYSBnaWFudCBtYXJsaW4uIFRoaXMgc3RvcnkgaXMgYSBwcm9mb3VuZCBleHBsb3JhdGlvbiBvZiBodW1hbiBlbmR1cmFuY2UsIHBlcnNldmVyYW5jZSwgYW5kIHRoZSBiYXR0bGUgYWdhaW5zdCB0aGUgZm9yY2VzIG9mIG5hdHVyZS4gU2FudGlhZ28ncyB1bndhdmVyaW5nIGRldGVybWluYXRpb24gYW5kIGRpZ25pdHkgaW4gdGhlIGZhY2Ugb2YgYWR2ZXJzaXR5IHNlcnZlIGFzIGEgdGVzdGFtZW50IHRvIHRoZSBzdHJlbmd0aCBvZiB0aGUgaHVtYW4gc3Bpcml0Lg==レスポンスの例
HTTP/1.1 200 OK
Server: AliyunOSS
Date: Thu, 10 Aug 2023 11:20:11 GMT
Content-Type: text/event-stream;charset=UTF-8
Transfer-Encoding: chunked
Connection: close
x-oss-request-id: 6761463BD5C0693133B15752
x-oss-server-time: 587
id: 0
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Er","FinishReason":"null"}}
id: 1
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest","FinishReason":"null"}}
id: 2
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hem","FinishReason":"null"}}
id: 3
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"","FinishReason":"null"}}
id: 4
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and","FinishReason":"null"}}
id: 5
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is","FinishReason":"null"}}
id: 6
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old","FinishReason":"null"}}
id: 7
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago","FinishReason":"null"}}
id: 8
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure","FinishReason":"null"}}
id: 9
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a","FinishReason":"null"}}
id: 10
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin.","FinishReason":"null"}}
id: 11
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep","FinishReason":"null"}}
id: 12
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans","FinishReason":"null"}}
id: 13
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough","FinishReason":"null"}}
id: 14
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong","FinishReason":"null"}}
id: 15
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on","FinishReason":"null"}}
id: 16
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges.","FinishReason":"null"}}
id: 17
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes","FinishReason":"null"}}
id: 18
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago","FinishReason":"null"}}
id: 19
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up","FinishReason":"null"}}
id: 20
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how","FinishReason":"null"}}
id: 21
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how resilient the human spirit","FinishReason":"null"}}
id: 22
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how resilient the human spirit can be. It","FinishReason":"null"}}
id: 23
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how resilient the human spirit can be. It’s a story that","FinishReason":"null"}}
id: 24
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how resilient the human spirit can be. It’s a story that’ll make you cheer","FinishReason":"null"}}
id: 25
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how resilient the human spirit can be. It’s a story that’ll make you cheer for the underdog","FinishReason":"null"}}
id: 26
event: Result
data: {"RequestId":"6761463BD5C0693133B15752","Output":{"Text":"Ernest Hemingway’s \"The Old Man and the Sea\" is all about an old fisherman named Santiago and his big adventure trying to catch a massive marlin. It’s a deep dive into how humans can push through tough times, stay strong, and take on nature’s challenges. Despite everything that comes his way, Santiago keeps his chin up and shows just how resilient the human spirit can be. It’s a story that’ll make you cheer for the underdog!","FinishReason":"stop"}}
OSS SDK の使用
次のサンプルコードは、一般的なプログラミング言語の OSS SDK を使用してドキュメントをリフレーズする方法の例を示しています。他のプログラミング言語の SDK を使用してドキュメントをリフレーズする場合は、次のサンプルコードに基づいてパラメーターを変更してください。
Java
OSS SDK for Java V3.17.4 以降が必要です。
import com.aliyun.oss.*;
import com.aliyun.oss.common.auth.*;
import com.aliyun.oss.common.comm.SignVersion;
import com.aliyun.oss.common.utils.BinaryUtil;
import com.aliyun.oss.common.utils.IOUtils;
import com.aliyun.oss.model.GenericResult;
import com.aliyun.oss.model.ProcessObjectRequest;
import java.io.IOException;
import java.util.Formatter;
public class Demo {
public static void main(String[] args) throws ClientException, com.aliyuncs.exceptions.ClientException {
// バケットが配置されているリージョンのエンドポイントを指定します。
String endpoint = "https://oss-cn-hangzhou.aliyuncs.com";
// バケットが配置されている Alibaba Cloud リージョンの ID を指定します。例: cn-hangzhou。
String region = "cn-hangzhou";
// 環境変数から資格情報を取得します。サンプルコードを実行する前に、OSS_ACCESS_KEY_ID および OSS_ACCESS_KEY_SECRET 環境変数が設定されていることを確認してください。
EnvironmentVariableCredentialsProvider credentialsProvider = CredentialsProviderFactory.newEnvironmentVariableCredentialsProvider();
// バケットの名前を指定します。
String bucketName = "examplebucket";
// ファイル名を指定します。これはプレースホルダーとしてのみ使用されます。インテリジェントなドキュメントのリフレーズでは、ファイルの内容は読み取られません。
String key ="example.docx";
// リフレーズするテキストコンテンツを指定します。
String content = "yourTxt";
String encodeContent = BinaryUtil.toBase64String(content.getBytes()).replaceAll("\\+","-")
.replaceAll("/","_").replaceAll("=","");
// OSSClient インスタンスを作成します。
// OSSClient が不要になったら、shutdown メソッドを呼び出して解放します。
ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
clientBuilderConfiguration.setSignatureVersion(SignVersion.V4);
OSS ossClient = OSSClientBuilder.create()
.endpoint(endpoint)
.credentialsProvider(credentialsProvider)
.clientConfiguration(clientBuilderConfiguration)
.region(region)
.build();
try {
StringBuilder sbStyle = new StringBuilder();
Formatter styleFormatter = new Formatter(sbStyle);
// インテリジェントなドキュメントリフレーズ命令を作成します。
styleFormatter.format("doc/rephrase,tone_straightforward,content_%s",
encodeContent);
System.out.println(sbStyle.toString());
ProcessObjectRequest request = new ProcessObjectRequest(bucketName, key, sbStyle.toString());
GenericResult processResult = ossClient.processObject(request);
String json = IOUtils.readStreamAsString(processResult.getResponse().getContent(), "UTF-8");
processResult.getResponse().getContent().close();
System.out.println(json);
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
+ "but was rejected with an error response for some reason.");
System.out.println("Error Message:" + oe.getErrorMessage());
System.out.println("Error Code:" + oe.getErrorCode());
System.out.println("Request ID:" + oe.getRequestId());
System.out.println("Host ID:" + oe.getHostId());
} catch (ClientException ce) {
System.out.println("Caught an ClientException, which means the client encountered "
+ "a serious internal problem while trying to communicate with OSS, "
+ "such as not being able to access the network.");
System.out.println("Error Message:" + ce.getMessage());
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ossClient != null) {
ossClient.shutdown();
}
}
}
}
PHP
OSS SDK for PHP V2.7.0 以降が必要です。
<?php
// 環境変数から資格情報を取得します。サンプルコードを実行する前に、OSS_ACCESS_KEY_ID および OSS_ACCESS_KEY_SECRET 環境変数が設定されていることを確認してください。
$ak = getenv('OSS_ACCESS_KEY_ID');
$sk = getenv('OSS_ACCESS_KEY_SECRET');
// バケットの名前を指定します。例: examplebucket。
$bucket = 'examplebucket';
// ファイル名を指定します。これはプレースホルダーとしてのみ使用されます。インテリジェリジェントなドキュメントのリフレーズでは、ファイルの内容は読み取られません。
$objectKey = 'example.docx';
// リフレーズするテキストコンテンツを指定します。
$txt = "yourTxt";
$base64url = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($txt));
// インテリジェントなドキュメントリフレーズ命令を作成します。
$body = sprintf("x-oss-process=doc/rephrase,tone_straightforward,content_%s", $base64url);
$httpVerb = 'POST';
$contentMd5 = base64_encode(md5($body, true));
$contentType = '';
$date = gmdate('D, d M Y H:i:s T');
$stringToSign = $httpVerb . "\n" . $contentMd5 . "\n" . $contentType . "\n" . $date . "\n" . "/{$bucket}/{$objectKey}?x-oss-process";
$signature = base64_encode(hash_hmac('sha1', $stringToSign, $sk, true));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://{$bucket}.oss-cn-hangzhou.aliyuncs.com/{$objectKey}?x-oss-process");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Date: ' . $date,
'Authorization: OSS ' . $ak . ':' . $signature,
'Content-Type: ' . $contentType,
'Content-Md5:' . $contentMd5,
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($response === false) {
echo "Error: " . curl_error($ch);
} else {
if ($httpcode == 200) {
var_dump($response);
} else {
echo "Error: HTTP code " . $httpcode;
}
}Go
OSS SDK for Go V3.0.2 以降が必要です。
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"os"
"strings"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
)
type TextData struct {
RequestId string `json:"RequestId"`
Output struct {
Text string `json:"Text"`
FinishReason string `json:"FinishReason"`
} `json:"Output"`
}
func main() {
// 環境変数から一時的な資格情報を取得します。サンプルコードを実行する前に、OSS_ACCESS_KEY_ID、OSS_ACCESS_KEY_SECRET、および OSS_SESSION_TOKEN 環境変数が設定されていることを確認してください。
provider, err := oss.NewEnvironmentVariableCredentialsProvider()
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
// OSSClient インスタンスを作成します。
client, err := oss.New("https://oss-cn-hangzhou.aliyuncs.com", "", "", oss.SetCredentialsProvider(&provider), oss.AuthVersion(oss.AuthV4), oss.Region("cn-hangzhou"))
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
// バケットの名前を指定します。例: examplebucket。
bucketName := "examplebucket"
bucket, err := client.Bucket(bucketName)
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
params := make(map[string]interface{})
params["x-oss-process"] = nil
// リフレーズするテキストコンテンツを指定します。
txt := "yourTxt"
// インテリジェントなドキュメントリフレーズ命令を作成します。
data := fmt.Sprintf("x-oss-process=doc/rephrase,tone_straightforward,content_%v", base64.URLEncoding.EncodeToString([]byte(txt)))
// example.docx はバケット内のファイルです。これはプレースホルダーとして使用されます。インテリジェントなドキュメントのリフレーズでは、ファイルの内容は読み取られません。
response, err := bucket.Do("POST", "example.docx", params, nil, strings.NewReader(data), nil)
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
defer response.Body.Close()
jsonData, err := io.ReadAll(response.Body)
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
var text TextData
err = json.Unmarshal(jsonData, &text)
if err != nil {
fmt.Println("Error:", err)
os.Exit(-1)
}
fmt.Printf("RequestId:%v\n", text.RequestId)
fmt.Printf("Text:%v\n", text.Output.Text)
fmt.Printf("FinishReason:%v\n", text.Output.FinishReason)
}