MCPcopy
hub / github.com/MiniMax-AI/cli / synthesize

Method synthesize

src/sdk/speech/index.ts:30–46  ·  view source on GitHub ↗
(request: ModelPartial<SpeechRequest>)

Source from the content-addressed store, hash-verified

28 async synthesize(request: ModelPartial<SpeechRequest> & { stream: true }): Promise<AsyncGenerator<SpeechResponse>>;
29 async synthesize(request: ModelPartial<SpeechRequest>): Promise<SpeechResponse>;
30 async synthesize(request: ModelPartial<SpeechRequest>): Promise<SpeechResponse | AsyncGenerator<SpeechResponse>> {
31 const body = this.validateParams(request);
32
33 const url = speechEndpoint(this.config.baseUrl);
34
35 if (body.stream) {
36 return this.synthesizeStream(body, url);
37 }
38
39 const res = await this.requestJson<SpeechResponse>({
40 url,
41 method: "POST",
42 body,
43 });
44
45 return res;
46 }
47
48 private async *synthesizeStream(body: SpeechRequest, url: string): AsyncGenerator<SpeechResponse> {
49 const res = await this.request({

Callers 1

speech.test.tsFile · 0.80

Calls 3

validateParamsMethod · 0.95
synthesizeStreamMethod · 0.95
speechEndpointFunction · 0.90

Tested by

no test coverage detected