Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/inference/src/providers/together.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,17 @@ export class TogetherTextToSpeechTask extends TaskProviderHelper implements Text
}

preparePayload(params: BodyParams): Record<string, unknown> {
const userParams = (params.args.parameters as Record<string, unknown> | undefined) ?? {};
// Together's /v1/audio/speech requires a `voice` field. Voices are model-specific
// (Kokoro accepts `af_*`, Orpheus uses different names, etc.), so we only default
// when the target model is Kokoro — the only TTS model currently registered.
const isKokoro = params.model.toLowerCase().includes("kokoro");
const voice = userParams.voice ?? (isKokoro ? "af_alloy" : undefined);

return {
...omit(params.args, ["inputs", "parameters"]),
...(params.args.parameters as Record<string, unknown> | undefined),
...userParams,
...(voice !== undefined ? { voice } : {}),
input: params.args.inputs,
model: params.model,
};
Expand Down
Loading