全部产品
Search
文档中心

Object Storage Service:Pengubahan Nada Dokumen Cerdas

更新时间:Sep 13, 2025

Gunakan fitur pengubahan nada dokumen cerdas untuk menyesuaikan nada dokumen Anda, memperbaiki ekspresi, dan mengubahnya menjadi nada yang lebih profesional, santai, atau langsung.

Prasyarat

Bucket Object Storage Service (OSS) harus terhubung dengan Proyek Intelligent Media Management (IMM). Untuk informasi lebih lanjut tentang cara menghubungkan proyek IMM dengan bucket OSS di Konsol OSS, lihat Memulai. Untuk detail tentang cara menghubungkan proyek IMM dengan bucket menggunakan Operasi API, lihat AttachOSSBucket.

Catatan penggunaan

  • Pengubahan nada dokumen cerdas hanya mendukung pemrosesan sinkron (x-oss-process).

  • Permintaan harus dikirim menggunakan metode POST.

  • Akses anonim tidak diperbolehkan.

  • Anda memerlukan izin tertentu untuk menggunakan fitur ini. Untuk informasi lebih lanjut, lihat izin.

Parameter

Action: doc/rephrase

Tabel berikut menjelaskan parameter:

Parameter

Tipe

Diperlukan

Deskripsi

tone

string

Ya

Nada ke mana Anda ingin mengubah dokumen. Nilai valid:

  • professional: lebih profesional.

  • relaxed: lebih santai.

  • straightforward: lebih langsung.

  • confident: lebih percaya diri.

  • friendly: lebih bersahabat.

content

string

Ya

Konten yang ingin Anda ubah. Konten tersebut harus dikodekan dalam URL-safe Base64.

Catatan

Konten dapat memiliki panjang hingga 19.500 byte.

format

string

Tidak

Mode untuk mengembalikan tanggapan. Nilai valid:

  • json (default): mode reguler. Paket data yang berisi tanggapan lengkap dikembalikan.

  • event-stream: mode Server-Sent Events (SSE). Beberapa paket dikembalikan. Setiap paket berisi data lengkap.

Tabel berikut menjelaskan parameter tanggapan:

Parameter

Tipe

Deskripsi

RequestId

string

ID permintaan.

Output

struct

Output.

Node anak: Text dan FinishReason

Text

string

Konten yang telah diubah.

Node induk: Output

FinishReason

string

Status tugas pengubahan. Nilai valid:

  • null: Tugas sedang berjalan.

  • stop: Tugas selesai.

Node induk: Output

Menggunakan RESTful API

Catatan

Jika menggunakan RESTful API untuk mengubah dokumen, Anda harus menentukan nama file sebagai placeholder. Pengubahan nada dokumen cerdas hanya mengidentifikasi nilai parameter konten sebagai teks yang akan diubah.

Mengubah dokumen dalam mode reguler

Metode pemrosesan

  • File yang akan diubah: example.doc

  • Teks yang akan diubah: "The Old Man and the Sea" karya Ernest Hemingway adalah kisah seorang nelayan tua, Santiago, dan perjuangannya menangkap marlin raksasa. Cerita ini mengeksplorasi ketahanan manusia, ketekunan, serta pertarungan melawan kekuatan alam. Keteguhan dan martabat Santiago menjadi bukti kekuatan semangat manusia.

  • Nada yang digunakan: santai

Contoh permintaan

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==

Contoh tanggapan

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\" adalah cerita keren tentang seorang nelayan tua bernama Santiago dan petualangannya yang besar mencoba menangkap marlin raksasa. Ini semua tentang bagaimana orang terus maju bahkan ketika segala sesuatunya menjadi sangat sulit, dan bagaimana kita menghadapi tantangan alam dengan keteguhan dan keanggunan. Keteguhan dan martabat Santiago melalui semuanya menunjukkan betapa kuatnya semangat manusia. Ini seperti, jika kamu pernah merasa sedih, pikirkan saja pria ini bertarung dengan ikan besar selama berhari-hari!",
    "FinishReason":"stop"
  }
}

Mengubah dokumen dalam mode SSE

Metode pemrosesan

  • File yang akan diubah: example.doc

  • Teks yang akan diubah: "The Old Man and the Sea" karya Ernest Hemingway adalah kisah seorang nelayan tua, Santiago, dan perjuangannya menangkap marlin raksasa. Cerita ini mengeksplorasi ketahanan manusia, ketekunan, serta pertarungan melawan kekuatan alam. Keteguhan dan martabat Santiago menjadi bukti kekuatan semangat manusia.

  • Nada yang digunakan: santai

  • Format tanggapan: event-stream

Contoh permintaan

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_RXJuZXN0IEhlbWluZ3dheSdzICJUaGUgT2xkIE1hbiBhbmQgdGhlIFNlYSIgaXMgYSB0YWxlIG9mIGFuIG9sZCBmaXNoZXJtYW4sIFNhbnRpYWdvLCBhbmQgaGlzIGVwaWMgc3RydWdlIGtoYXQgY2F0Y2ggYSBnaWFudCBtYXJsaW4uIFRoaXMgc3RvcnkgaXMgYSBwcm9mb3VuZCBleHBsb3JhdGlvbiBvZiBodW1hbiBlbmR1cmFuY2UsIHBlcnNldmVyYW5jZSwgYW5kIHRoZSBiYXR0bGUgYWdhaW5zdCB0aGUgZm9yY2VzIG9mIG5hdHVyZS4gU2FudGlhZ28ncyB1bndhdmVyaW5nIGRldGVybWluYXRpb24gYW5kIGRpZ25pdHkgaW4gdGhlIGZhY2Ugb2YgYWR2ZXJzaXR5IHNlcnZlIGFzIGEgdGVzdGFtZW50IHRvIHRoZSBzdHJlbmd0aCBvZiB0aGUgaHVtYW4gc3Bpcml0Lg==

Contoh tanggapan

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"}}

Menggunakan SDK OSS

Contoh kode berikut menunjukkan cara mengubah dokumen menggunakan SDK OSS untuk beberapa bahasa pemrograman umum. Jika ingin menggunakan SDK untuk bahasa lain, sesuaikan parameter berdasarkan contoh berikut.

Java

Diperlukan OSS SDK for Java versi 3.17.4 atau lebih baru.

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 {
        // Tentukan endpoint wilayah tempat bucket berada.
        String endpoint = "https://oss-cn-hangzhou.aliyuncs.com";
        // Tentukan ID wilayah Alibaba Cloud tempat bucket berada. Contoh: cn-hangzhou.
        String region = "cn-hangzhou";
        // Dapatkan kredensial dari variabel lingkungan. Sebelum menjalankan kode sampel, pastikan variabel lingkungan OSS_ACCESS_KEY_ID dan OSS_ACCESS_KEY_SECRET telah dikonfigurasi.
        EnvironmentVariableCredentialsProvider credentialsProvider = CredentialsProviderFactory.newEnvironmentVariableCredentialsProvider();
        // Tentukan nama bucket.
        String bucketName = "examplebucket";
        // Tentukan nama file, yang hanya digunakan sebagai placeholder. Pengubahan nada dokumen cerdas tidak membaca isi file.
        String key ="example.docx";
        // Tentukan konten teks yang akan diubah.
        String content = "yourTxt";
        String encodeContent = BinaryUtil.toBase64String(content.getBytes()).replaceAll("\\+","-")
                .replaceAll("/","_").replaceAll("=","");

        // Buat instance OSSClient.
        // Panggil metode shutdown untuk melepaskan OSSClient saat tidak lagi digunakan.
        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);
            // Buat instruksi pengubahan nada dokumen cerdas.
            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("Tangkap OSSException, yang berarti permintaan Anda sampai ke OSS, "
                    + "tetapi ditolak dengan respons kesalahan karena suatu alasan.");
            System.out.println("Pesan Kesalahan:" + oe.getErrorMessage());
            SystemSystem.out.println("Kode Kesalahan:" + oe.getErrorCode());
            System.out.println("ID Permintaan:" + oe.getRequestId());
            System.out.println("ID Host:" + oe.getHostId());
        } catch (ClientException ce) {
            System.out.println("Tangkap ClientException, yang berarti klien mengalami "
                    + "masalah internal serius saat mencoba berkomunikasi dengan OSS, "
                    + "seperti tidak dapat mengakses jaringan.");
            System.out.println("Pesan Kesalahan:" + ce.getMessage());
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (ossClient != null) {
                ossClient.shutdown();
            }
        }
    }
}

PHP

Diperlukan OSS SDK for PHP versi 2.7.0 atau lebih baru.

<?php
// Dapatkan kredensial dari variabel lingkungan. Sebelum menjalankan kode sampel, pastikan variabel lingkungan OSS_ACCESS_KEY_ID dan OSS_ACCESS_KEY_SECRET telah dikonfigurasi.
$ak = getenv('OSS_ACCESS_KEY_ID');
$sk = getenv('OSS_ACCESS_KEY_SECRET');
// Tentukan nama bucket. Contoh: examplebucket.
$bucket = 'examplebucket';
// Tentukan nama file, yang hanya digunakan sebagai placeholder. Pengubahan nada dokumen cerdas tidak membaca isi file.
$objectKey = 'example.docx';
// Tentukan konten teks yang akan diubah.
$txt = "yourTxt";

$base64url = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($txt));
// Buat instruksi pengubahan nada dokumen cerdas.
$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

Diperlukan OSS SDK for Go versi 3.0.2 atau lebih baru.

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() {
	// Dapatkan kredensial sementara dari variabel lingkungan. Sebelum menjalankan kode sampel, pastikan variabel lingkungan OSS_ACCESS_KEY_ID, OSS_ACCESS_KEY_SECRET, dan OSS_SESSION_TOKEN telah dikonfigurasi.
	provider, err := oss.NewEnvironmentVariableCredentialsProvider()
	if err != nil {
		fmt.Println("Error:", err)
		os.Exit(-1)
	}
	// Buat instance 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)
	}

	// Tentukan nama bucket. Contoh: 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
        // Tentukan konten teks yang akan diubah.
	txt := "yourTxt"
        // Buat instruksi pengubahan nada dokumen cerdas.
	data := fmt.Sprintf("x-oss-process=doc/rephrase,tone_straightforward,content_%v", base64.URLEncoding.EncodeToString([]byte(txt)))
        // example.docx adalah file dalam bucket. Ini digunakan sebagai placeholder. Pengubahan nada dokumen cerdas tidak membaca isi file.
	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)
}