/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 26750c4be8e6
 */

import {
  audioSpeechComplete,
  CompleteAcceptEnum,
} from "../funcs/audioSpeechComplete.js";
import { EventStream } from "../lib/event-streams.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as components from "../models/components/index.js";
import * as operations from "../models/operations/index.js";
import { unwrapAsync } from "../types/fp.js";

export { CompleteAcceptEnum } from "../funcs/audioSpeechComplete.js";

export class Speech extends ClientSDK {
  /**
   * Speech
   */
  async complete(
    request: components.SpeechRequest & { stream?: false | undefined },
    options?: RequestOptions & { acceptHeaderOverride?: CompleteAcceptEnum },
  ): Promise<operations.SpeechResponse>;
  async complete(
    request: components.SpeechRequest & { stream: true },
    options?: RequestOptions & { acceptHeaderOverride?: CompleteAcceptEnum },
  ): Promise<EventStream<operations.SpeechStreamEvents>>;
  async complete(
    request: components.SpeechRequest,
    options?: RequestOptions & { acceptHeaderOverride?: CompleteAcceptEnum },
  ): Promise<operations.SpeechV1AudioSpeechPostResponse>;
  async complete(
    request: components.SpeechRequest,
    options?: RequestOptions & { acceptHeaderOverride?: CompleteAcceptEnum },
  ): Promise<operations.SpeechV1AudioSpeechPostResponse> {
    return unwrapAsync(audioSpeechComplete(
      this,
      request,
      options,
    ));
  }
}
