Skip to content

Commit

Permalink
✨ feat: Add duplex to microsoft fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Nov 15, 2023
1 parent ad3b0ab commit 702194a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/server/createEdgeSpeechComletion.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import qs from 'query-string';
import { v4 as uuidv4 } from 'uuid';

import { EDGE_API_TOKEN, EDGE_SPEECH_URL } from '../const/api';
import { EdgeSpeechPayload } from '../server/types';
import { genSSML } from '../utils/genSSML';
import { genSendContent } from '../utils/genSendContent';
import { getHeadersAndData } from '../utils/getHeadersAndData';
import { EDGE_API_TOKEN, EDGE_SPEECH_URL } from '@/const/api';
import { EdgeSpeechPayload } from '@/server/types';
import { genSSML } from '@/utils/genSSML';
import { genSendContent } from '@/utils/genSendContent';
import { getHeadersAndData } from '@/utils/getHeadersAndData';

const configConent = JSON.stringify({
context: {
Expand Down
8 changes: 5 additions & 3 deletions src/server/createMicrosoftSpeechComletion.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { v4 as uuidv4 } from 'uuid';

import { MICROSOFT_SPEECH_URL } from '../const/api';
import { MicrosoftSpeechPayload } from '../server/types';
import { genSSML } from '../utils/genSSML';
import { MICROSOFT_SPEECH_URL } from '@/const/api';
import { MicrosoftSpeechPayload } from '@/server/types';
import { genSSML } from '@/utils/genSSML';

interface CreateMicrosoftSpeechComletionOptions {
payload: MicrosoftSpeechPayload;
Expand Down Expand Up @@ -41,6 +41,8 @@ export const createMicrosoftSpeechComletion = async ({

const res = await fetch(MICROSOFT_SPEECH_URL, {
body,
// @ts-ignore
duplex: 'half',
headers: DEFAULT_HEADERS,
method: 'POST',
// @ts-ignore
Expand Down

0 comments on commit 702194a

Please sign in to comment.