Skip to content

Commit

Permalink
馃悰 fix: Fix header
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Nov 19, 2023
1 parent 7715758 commit 38f1052
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/OpenAITTS/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,14 @@ export class OpenAITTS {

static voiceList = voiceList;

fetch = async (payload: OpenAITTSPayload, headers?: Headers) => {
fetch = async (payload: OpenAITTSPayload) => {
const url = urlJoin(this.OPENAI_BASE_URL, 'audio/speech');
return this.serviceUrl
? fetch(this.serviceUrl, { body: JSON.stringify(payload), headers, method: 'POST' })
? fetch(this.serviceUrl, {
body: JSON.stringify(payload),
headers: this.headers,
method: 'POST',
})
: fetch(url, {
body: JSON.stringify({
input: payload.input,
Expand Down

0 comments on commit 38f1052

Please sign in to comment.