ws.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. import * as WS from 'ws';
  2. import { AzureOpenAI, OpenAI } from "../../index.js";
  3. import type { RealtimeClientEvent } from "../../resources/beta/realtime/realtime.js";
  4. import { OpenAIRealtimeEmitter } from "./internal-base.js";
  5. export declare class OpenAIRealtimeWS extends OpenAIRealtimeEmitter {
  6. url: URL;
  7. socket: WS.WebSocket;
  8. constructor(props: {
  9. model: string;
  10. options?: WS.ClientOptions | undefined;
  11. /** @internal */ __resolvedApiKey?: boolean;
  12. }, client?: Pick<OpenAI, 'apiKey' | 'baseURL'>);
  13. static create(client: Pick<OpenAI, 'apiKey' | 'baseURL' | '_callApiKey'>, props: {
  14. model: string;
  15. options?: WS.ClientOptions | undefined;
  16. }): Promise<OpenAIRealtimeWS>;
  17. static azure(client: Pick<AzureOpenAI, '_callApiKey' | 'apiVersion' | 'apiKey' | 'baseURL' | 'deploymentName'>, props?: {
  18. deploymentName?: string;
  19. options?: WS.ClientOptions | undefined;
  20. }): Promise<OpenAIRealtimeWS>;
  21. send(event: RealtimeClientEvent): void;
  22. close(props?: {
  23. code: number;
  24. reason: string;
  25. }): void;
  26. }
  27. //# sourceMappingURL=ws.d.ts.map