Skip to content

Commit b61fd72

Browse files
committed
fix(sdk): not exported for creators of providers
1 parent 4d972e6 commit b61fd72

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

sdk/typescript/src/backend/alibaba.ts renamed to sdk/typescript/src/backend/alibabacloud.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { objCamelToSnake } from '@xsai/shared'
55

66
import type { UnSpeechOptions, VoiceProviderWithExtraOptions } from '../types'
77

8-
export interface UnAlibabaOptions {
8+
export interface UnAlibabaCloudOptions {
99
/**
1010
* Sampling rate of the synthesized audio.
1111
* @default 22050
@@ -40,8 +40,8 @@ export interface UnAlibabaOptions {
4040
* @param baseURL - UnSpeech Instance URL
4141
* @returns SpeechProviderWithExtraOptions & VoiceProviderWithExtraOptions
4242
*/
43-
export const createUnAlibaba = (apiKey: string, baseURL = 'http://localhost:5933/v1/') => {
44-
const toUnSpeechOptions = (options: UnAlibabaOptions): UnSpeechOptions => {
43+
export const createUnAlibabaCloud = (apiKey: string, baseURL = 'http://localhost:5933/v1/') => {
44+
const toUnSpeechOptions = (options: UnAlibabaCloudOptions): UnSpeechOptions => {
4545
const { sampleRate, volume, rate, pitch } = options
4646

4747
const extraBody: Record<string, unknown> = {
@@ -60,7 +60,7 @@ export const createUnAlibaba = (apiKey: string, baseURL = 'http://localhost:5933
6060
const speechProvider: SpeechProviderWithExtraOptions<
6161
/** @see https://help.aliyun.com/document_detail/451271.html */
6262
'alibaba/v1',
63-
UnAlibabaOptions
63+
UnAlibabaCloudOptions
6464
> = {
6565
speech: (model, options) => ({
6666
...(options ? toUnSpeechOptions(options) : {}),
@@ -73,7 +73,7 @@ export const createUnAlibaba = (apiKey: string, baseURL = 'http://localhost:5933
7373
}
7474

7575
const voiceProvider: VoiceProviderWithExtraOptions<
76-
UnAlibabaOptions
76+
UnAlibabaCloudOptions
7777
> = {
7878
voice: (options) => {
7979
let adjustedBaseURL = baseURL

sdk/typescript/src/backend/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { UnSpeechOptions, VoiceProviderWithExtraOptions } from '../types'
66
export * from './elevenlabs'
77
export * from './microsoft'
88
export * from './volcengine'
9-
export * from './alibaba'
9+
export * from './alibabacloud'
1010

1111
/** @see {@link https://github.com/moeru-ai/unspeech} */
1212
export const createUnSpeech = (apiKey: string, baseURL = 'http://localhost:5933/v1/') => {

sdk/typescript/src/backend/volcengine.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { objCamelToSnake } from '@xsai/shared'
55

66
import type { UnSpeechOptions, VoiceProviderWithExtraOptions } from '../types'
77

8-
export interface UnVolcanoEngineOptions {
8+
export interface UnVolcengineOptions {
99
app?: {
1010
appId?: string
1111
cluster?: string | 'volcano_tts'
@@ -105,8 +105,8 @@ export interface UnVolcanoEngineOptions {
105105
* @param baseURL - UnSpeech Instance URL
106106
* @returns SpeechProviderWithExtraOptions
107107
*/
108-
export const createUnVolcanoEngine = (apiKey: string, baseURL = 'http://localhost:5933/v1/') => {
109-
const toUnSpeechOptions = (options: UnVolcanoEngineOptions): UnSpeechOptions => {
108+
export const createUnVolcengine = (apiKey: string, baseURL = 'http://localhost:5933/v1/') => {
109+
const toUnSpeechOptions = (options: UnVolcengineOptions): UnSpeechOptions => {
110110
const extraBody: Record<string, unknown> = {
111111
app: {
112112
appid: options.app?.appId,
@@ -134,7 +134,7 @@ export const createUnVolcanoEngine = (apiKey: string, baseURL = 'http://localhos
134134
const speechProvider: SpeechProviderWithExtraOptions<
135135
/** @see Currently, only v1 is available */
136136
'volcengine/v1',
137-
UnVolcanoEngineOptions
137+
UnVolcengineOptions
138138
> = {
139139
speech: (model, options) => ({
140140
...(options ? toUnSpeechOptions(options) : {}),
@@ -145,7 +145,7 @@ export const createUnVolcanoEngine = (apiKey: string, baseURL = 'http://localhos
145145
}
146146

147147
const voiceProvider: VoiceProviderWithExtraOptions<
148-
UnVolcanoEngineOptions
148+
UnVolcengineOptions
149149
> = {
150150
voice: (options) => {
151151
if (baseURL.endsWith('v1/')) {

sdk/typescript/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
export type * from './backend'
2-
export { createUnElevenLabs, createUnMicrosoft, createUnSpeech } from './backend'
2+
export {
3+
createUnElevenLabs,
4+
createUnMicrosoft,
5+
createUnSpeech,
6+
createUnAlibabaCloud,
7+
createUnVolcengine
8+
} from './backend'
39
export type * from './types'
410
export type * from './utils/list-voices'
511
export { listVoices } from './utils/list-voices'

0 commit comments

Comments
 (0)