// This file was auto-generated by Fern from our API Definition.

import type * as Vapi from "../index.js";

export interface ServerMessageVoiceRequest {
    /** This is the phone number that the message is associated with. */
    phoneNumber?: Vapi.ServerMessageVoiceRequestPhoneNumber | undefined;
    /**
     * This is the type of the message. "voice-request" is sent when using `assistant.voice={ "type": "custom-voice" }`.
     *
     * Here is what the request will look like:
     *
     * POST https://{assistant.voice.server.url}
     * Content-Type: application/json
     *
     * {
     *   "messsage": {
     *     "type": "voice-request",
     *     "text": "Hello, world!",
     *     "sampleRate": 24000,
     *     ...other metadata about the call...
     *   }
     * }
     *
     * The expected response is 1-channel 16-bit raw PCM audio at the sample rate specified in the request. Here is how the response will be piped to the transport:
     * ```
     * response.on('data', (chunk: Buffer) => {
     *   outputStream.write(chunk);
     * });
     * ```
     */
    type: Vapi.ServerMessageVoiceRequestType;
    /** This is the timestamp of the message. */
    timestamp?: number | undefined;
    /**
     * This is a live version of the `call.artifact`.
     *
     * This matches what is stored on `call.artifact` after the call.
     */
    artifact?: Vapi.Artifact | undefined;
    /** This is the assistant that the message is associated with. */
    assistant?: Vapi.CreateAssistantDto | undefined;
    /** This is the customer that the message is associated with. */
    customer?: Vapi.CreateCustomerDto | undefined;
    /** This is the call that the message is associated with. */
    call?: Vapi.Call | undefined;
    /** This is the chat object. */
    chat?: Vapi.Chat | undefined;
    /** This is the text to be synthesized. */
    text: string;
    /** This is the sample rate to be synthesized. */
    sampleRate: number;
}
