Skip to content

Commit 2a43456

Browse files
minhanh-phanstainless-app[bot]
authored andcommitted
Fix Azure OpenAI client import
1 parent 41a7ce3 commit 2a43456

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/beta/realtime/websocket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class OpenAIRealtimeWebSocket extends OpenAIRealtimeEmitter {
9595
}
9696

9797
static async azure(
98-
client: AzureOpenAI,
98+
client: Pick<AzureOpenAI, '_getAzureADToken' | 'apiVersion' | 'apiKey' | 'baseURL' | 'deploymentName'>,
9999
options: { deploymentName?: string; dangerouslyAllowBrowser?: boolean } = {},
100100
): Promise<OpenAIRealtimeWebSocket> {
101101
const token = await client._getAzureADToken();

src/beta/realtime/ws.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
5252
}
5353

5454
static async azure(
55-
client: AzureOpenAI,
55+
client: Pick<AzureOpenAI, '_getAzureADToken' | 'apiVersion' | 'apiKey' | 'baseURL' | 'deploymentName'>,
5656
options: { deploymentName?: string; options?: WS.ClientOptions | undefined } = {},
5757
): Promise<OpenAIRealtimeWS> {
5858
const deploymentName = options.deploymentName ?? client.deploymentName;
@@ -82,7 +82,7 @@ export class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
8282
}
8383
}
8484

85-
async function getAzureHeaders(client: AzureOpenAI) {
85+
async function getAzureHeaders(client: Pick<AzureOpenAI, '_getAzureADToken' | 'apiKey'>) {
8686
if (client.apiKey !== '<Missing Key>') {
8787
return { 'api-key': client.apiKey };
8888
} else {

0 commit comments

Comments
 (0)