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

import { VapiClient } from "../../src/Client";
import { mockServerPool } from "../mock-server/MockServerPool";

describe("EvalClient", () => {
    test("EvalController_getPaginated", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            results: [
                {
                    messages: [
                        {
                            role: "assistant",
                            content: "The weather in San Francisco is sunny.",
                            toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                        },
                    ],
                    id: "id",
                    orgId: "orgId",
                    createdAt: "2024-01-15T09:30:00Z",
                    updatedAt: "2024-01-15T09:30:00Z",
                    name: "Verified User Flow Eval",
                    description: "This eval checks if the user flow is verified.",
                    type: "chat.mockConversation",
                },
            ],
            metadata: {
                itemsPerPage: 1.1,
                totalItems: 1.1,
                currentPage: 1.1,
                itemsBeyondRetention: true,
                createdAtLe: "2024-01-15T09:30:00Z",
                createdAtGe: "2024-01-15T09:30:00Z",
            },
        };

        server.mockEndpoint().get("/eval").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.eval.evalControllerGetPaginated();
        expect(response).toEqual({
            results: [
                {
                    messages: [
                        {
                            role: "assistant",
                            content: "The weather in San Francisco is sunny.",
                            toolCalls: [
                                {
                                    name: "get_weather",
                                    arguments: {
                                        key: "value",
                                    },
                                },
                            ],
                        },
                    ],
                    id: "id",
                    orgId: "orgId",
                    createdAt: "2024-01-15T09:30:00Z",
                    updatedAt: "2024-01-15T09:30:00Z",
                    name: "Verified User Flow Eval",
                    description: "This eval checks if the user flow is verified.",
                    type: "chat.mockConversation",
                },
            ],
            metadata: {
                itemsPerPage: 1.1,
                totalItems: 1.1,
                currentPage: 1.1,
                itemsBeyondRetention: true,
                createdAtLe: "2024-01-15T09:30:00Z",
                createdAtGe: "2024-01-15T09:30:00Z",
            },
        });
    });

    test("EvalController_create", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = { messages: [{ role: "assistant" }], type: "chat.mockConversation" };
        const rawResponseBody = {
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        };

        server
            .mockEndpoint()
            .post("/eval")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.eval.evalControllerCreate({
            messages: [
                {
                    role: "assistant",
                },
            ],
            type: "chat.mockConversation",
        });
        expect(response).toEqual({
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [
                        {
                            name: "get_weather",
                            arguments: {
                                key: "value",
                            },
                        },
                    ],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        });
    });

    test("EvalController_get", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        };

        server.mockEndpoint().get("/eval/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.eval.evalControllerGet({
            id: "id",
        });
        expect(response).toEqual({
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [
                        {
                            name: "get_weather",
                            arguments: {
                                key: "value",
                            },
                        },
                    ],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        });
    });

    test("EvalController_remove", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        };

        server.mockEndpoint().delete("/eval/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.eval.evalControllerRemove({
            id: "id",
        });
        expect(response).toEqual({
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [
                        {
                            name: "get_weather",
                            arguments: {
                                key: "value",
                            },
                        },
                    ],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        });
    });

    test("EvalController_update", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = {};
        const rawResponseBody = {
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        };

        server
            .mockEndpoint()
            .patch("/eval/id")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.eval.evalControllerUpdate({
            id: "id",
        });
        expect(response).toEqual({
            messages: [
                {
                    role: "assistant",
                    content: "The weather in San Francisco is sunny.",
                    toolCalls: [
                        {
                            name: "get_weather",
                            arguments: {
                                key: "value",
                            },
                        },
                    ],
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            name: "Verified User Flow Eval",
            description: "This eval checks if the user flow is verified.",
            type: "chat.mockConversation",
        });
    });

    test("EvalController_getRun", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            status: "running",
            endedReason: "mockConversation.done",
            eval: {
                messages: [
                    {
                        role: "assistant",
                        content: "The weather in San Francisco is sunny.",
                        toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                    },
                ],
                name: "Verified User Flow Eval",
                description: "This eval checks if the user flow is verified.",
                type: "chat.mockConversation",
            },
            target: {
                type: "assistant",
                assistant: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                    observabilityPlan: { provider: "langfuse", tags: ["tags"] },
                    credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [{ type: "request-start", blocking: false }],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: { position: -1 },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "。",
                                                    "，",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "،",
                                                    "۔",
                                                    "।",
                                                    "॥",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: { key: "value" },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: { enabled: true },
                        structuredOutputs: [
                            {
                                compliancePlan: { forceStoreOnHipaaEnabled: false },
                                name: "name",
                                schema: { type: "string" },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: { provider: "vapi" },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                assistantOverrides: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                    observabilityPlan: { provider: "langfuse", tags: ["tags"] },
                    credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [{ type: "request-start", blocking: false }],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: { position: -1 },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    "tools:append": [
                        {
                            type: "apiRequest",
                            messages: [{ type: "request-start", blocking: false }],
                            method: "POST",
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            url: "url",
                            backoffPlan: {
                                type: { key: "value" },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                ],
                            },
                            rejectionPlan: {
                                conditions: [
                                    {
                                        type: "regex",
                                        regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                        target: { position: -1 },
                                    },
                                ],
                            },
                        },
                    ],
                    variableValues: { key: "value" },
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "。",
                                                    "，",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "،",
                                                    "۔",
                                                    "।",
                                                    "॥",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: { key: "value" },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: { enabled: true },
                        structuredOutputs: [
                            {
                                compliancePlan: { forceStoreOnHipaaEnabled: false },
                                name: "name",
                                schema: { type: "string" },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: { provider: "vapi" },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                assistantId: "123e4567-e89b-12d3-a456-426614174000",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            startedAt: "2024-01-15T09:30:00Z",
            endedAt: "2024-01-15T09:30:00Z",
            endedMessage: "The Assistant returned an error",
            results: [
                {
                    status: "pass",
                    messages: [{ role: "user", content: "Hello, how are you?" }],
                    startedAt: "2021-01-01T00:00:00Z",
                    endedAt: "2021-01-01T00:00:00Z",
                },
            ],
            cost: 0.01,
            costs: [{ key: "value" }],
            type: "eval",
            evalId: "123e4567-e89b-12d3-a456-426614174000",
        };

        server.mockEndpoint().get("/eval/run/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.eval.evalControllerGetRun({
            id: "id",
        });
        expect(response).toEqual({
            status: "running",
            endedReason: "mockConversation.done",
            eval: {
                messages: [
                    {
                        role: "assistant",
                        content: "The weather in San Francisco is sunny.",
                        toolCalls: [
                            {
                                name: "get_weather",
                                arguments: {
                                    key: "value",
                                },
                            },
                        ],
                    },
                ],
                name: "Verified User Flow Eval",
                description: "This eval checks if the user flow is verified.",
                type: "chat.mockConversation",
            },
            target: {
                type: "assistant",
                assistant: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [
                        {
                            provider: "twilio",
                            timeout: 60,
                            record: false,
                        },
                    ],
                    observabilityPlan: {
                        provider: "langfuse",
                        tags: ["tags"],
                    },
                    credentials: [
                        {
                            provider: "11labs",
                            apiKey: "apiKey",
                        },
                    ],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [
                                            {
                                                type: "request-start",
                                                blocking: false,
                                            },
                                        ],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: {
                                                        position: -1,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "\u3002",
                                                    "\uFF0C",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "\u060C",
                                                    "\u06D4",
                                                    "\u0964",
                                                    "\u0965",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: {
                                                    enabled: true,
                                                    numberToDigitsCutoff: 2025,
                                                },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: {
                        key: "value",
                    },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: {
                            enabled: true,
                        },
                        structuredOutputs: [
                            {
                                compliancePlan: {
                                    forceStoreOnHipaaEnabled: false,
                                },
                                name: "name",
                                schema: {
                                    type: "string",
                                },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: {
                            provider: "vapi",
                        },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                assistantOverrides: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [
                        {
                            provider: "twilio",
                            timeout: 60,
                            record: false,
                        },
                    ],
                    observabilityPlan: {
                        provider: "langfuse",
                        tags: ["tags"],
                    },
                    credentials: [
                        {
                            provider: "11labs",
                            apiKey: "apiKey",
                        },
                    ],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [
                                            {
                                                type: "request-start",
                                                blocking: false,
                                            },
                                        ],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: {
                                                        position: -1,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    "tools:append": [
                        {
                            type: "apiRequest",
                            messages: [
                                {
                                    type: "request-start",
                                    blocking: false,
                                },
                            ],
                            method: "POST",
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            url: "url",
                            backoffPlan: {
                                type: {
                                    key: "value",
                                },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                            rejectionPlan: {
                                conditions: [
                                    {
                                        type: "regex",
                                        regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                        target: {
                                            position: -1,
                                        },
                                    },
                                ],
                            },
                        },
                    ],
                    variableValues: {
                        key: "value",
                    },
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "\u3002",
                                                    "\uFF0C",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "\u060C",
                                                    "\u06D4",
                                                    "\u0964",
                                                    "\u0965",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: {
                                                    enabled: true,
                                                    numberToDigitsCutoff: 2025,
                                                },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: {
                        key: "value",
                    },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: {
                            enabled: true,
                        },
                        structuredOutputs: [
                            {
                                compliancePlan: {
                                    forceStoreOnHipaaEnabled: false,
                                },
                                name: "name",
                                schema: {
                                    type: "string",
                                },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: {
                            provider: "vapi",
                        },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                assistantId: "123e4567-e89b-12d3-a456-426614174000",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            startedAt: "2024-01-15T09:30:00Z",
            endedAt: "2024-01-15T09:30:00Z",
            endedMessage: "The Assistant returned an error",
            results: [
                {
                    status: "pass",
                    messages: [
                        {
                            role: "user",
                            content: "Hello, how are you?",
                        },
                    ],
                    startedAt: "2021-01-01T00:00:00Z",
                    endedAt: "2021-01-01T00:00:00Z",
                },
            ],
            cost: 0.01,
            costs: [
                {
                    key: "value",
                },
            ],
            type: "eval",
            evalId: "123e4567-e89b-12d3-a456-426614174000",
        });
    });

    test("EvalController_removeRun", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            status: "running",
            endedReason: "mockConversation.done",
            eval: {
                messages: [
                    {
                        role: "assistant",
                        content: "The weather in San Francisco is sunny.",
                        toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                    },
                ],
                name: "Verified User Flow Eval",
                description: "This eval checks if the user flow is verified.",
                type: "chat.mockConversation",
            },
            target: {
                type: "assistant",
                assistant: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                    observabilityPlan: { provider: "langfuse", tags: ["tags"] },
                    credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [{ type: "request-start", blocking: false }],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: { position: -1 },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "。",
                                                    "，",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "،",
                                                    "۔",
                                                    "।",
                                                    "॥",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: { key: "value" },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: { enabled: true },
                        structuredOutputs: [
                            {
                                compliancePlan: { forceStoreOnHipaaEnabled: false },
                                name: "name",
                                schema: { type: "string" },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: { provider: "vapi" },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                assistantOverrides: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                    observabilityPlan: { provider: "langfuse", tags: ["tags"] },
                    credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [{ type: "request-start", blocking: false }],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: { position: -1 },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    "tools:append": [
                        {
                            type: "apiRequest",
                            messages: [{ type: "request-start", blocking: false }],
                            method: "POST",
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            url: "url",
                            backoffPlan: {
                                type: { key: "value" },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                ],
                            },
                            rejectionPlan: {
                                conditions: [
                                    {
                                        type: "regex",
                                        regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                        target: { position: -1 },
                                    },
                                ],
                            },
                        },
                    ],
                    variableValues: { key: "value" },
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "。",
                                                    "，",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "،",
                                                    "۔",
                                                    "।",
                                                    "॥",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: { key: "value" },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: { enabled: true },
                        structuredOutputs: [
                            {
                                compliancePlan: { forceStoreOnHipaaEnabled: false },
                                name: "name",
                                schema: { type: "string" },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: { provider: "vapi" },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                assistantId: "123e4567-e89b-12d3-a456-426614174000",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            startedAt: "2024-01-15T09:30:00Z",
            endedAt: "2024-01-15T09:30:00Z",
            endedMessage: "The Assistant returned an error",
            results: [
                {
                    status: "pass",
                    messages: [{ role: "user", content: "Hello, how are you?" }],
                    startedAt: "2021-01-01T00:00:00Z",
                    endedAt: "2021-01-01T00:00:00Z",
                },
            ],
            cost: 0.01,
            costs: [{ key: "value" }],
            type: "eval",
            evalId: "123e4567-e89b-12d3-a456-426614174000",
        };

        server.mockEndpoint().delete("/eval/run/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.eval.evalControllerRemoveRun({
            id: "id",
        });
        expect(response).toEqual({
            status: "running",
            endedReason: "mockConversation.done",
            eval: {
                messages: [
                    {
                        role: "assistant",
                        content: "The weather in San Francisco is sunny.",
                        toolCalls: [
                            {
                                name: "get_weather",
                                arguments: {
                                    key: "value",
                                },
                            },
                        ],
                    },
                ],
                name: "Verified User Flow Eval",
                description: "This eval checks if the user flow is verified.",
                type: "chat.mockConversation",
            },
            target: {
                type: "assistant",
                assistant: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [
                        {
                            provider: "twilio",
                            timeout: 60,
                            record: false,
                        },
                    ],
                    observabilityPlan: {
                        provider: "langfuse",
                        tags: ["tags"],
                    },
                    credentials: [
                        {
                            provider: "11labs",
                            apiKey: "apiKey",
                        },
                    ],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [
                                            {
                                                type: "request-start",
                                                blocking: false,
                                            },
                                        ],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: {
                                                        position: -1,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "\u3002",
                                                    "\uFF0C",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "\u060C",
                                                    "\u06D4",
                                                    "\u0964",
                                                    "\u0965",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: {
                                                    enabled: true,
                                                    numberToDigitsCutoff: 2025,
                                                },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: {
                        key: "value",
                    },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: {
                            enabled: true,
                        },
                        structuredOutputs: [
                            {
                                compliancePlan: {
                                    forceStoreOnHipaaEnabled: false,
                                },
                                name: "name",
                                schema: {
                                    type: "string",
                                },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: {
                            provider: "vapi",
                        },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                assistantOverrides: {
                    transcriber: {
                        provider: "assembly-ai",
                        confidenceThreshold: 0.4,
                        formatTurns: true,
                        endOfTurnConfidenceThreshold: 0.7,
                        minEndOfTurnSilenceWhenConfident: 160,
                        maxTurnSilence: 400,
                        vadAssistedEndpointingEnabled: true,
                        fallbackPlan: {
                            transcribers: [
                                {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                },
                            ],
                        },
                    },
                    model: {
                        provider: "anthropic",
                        tools: [
                            {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        knowledgeBase: {
                            provider: "custom-knowledge-base",
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            },
                        },
                        model: "claude-3-opus-20240229",
                    },
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    firstMessage: "Hello! How can I help you today?",
                    firstMessageInterruptionsEnabled: true,
                    firstMessageMode: "assistant-speaks-first",
                    voicemailDetection: "off",
                    clientMessages: [
                        "conversation-update",
                        "function-call",
                        "hang",
                        "model-output",
                        "speech-update",
                        "status-update",
                        "transfer-update",
                        "transcript",
                        "tool-calls",
                        "user-interrupted",
                        "voice-input",
                        "workflow.node.started",
                        "assistant.started",
                    ],
                    serverMessages: [
                        "conversation-update",
                        "end-of-call-report",
                        "function-call",
                        "hang",
                        "speech-update",
                        "status-update",
                        "tool-calls",
                        "transfer-destination-request",
                        "handoff-destination-request",
                        "user-interrupted",
                        "assistant.started",
                    ],
                    maxDurationSeconds: 600,
                    backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                    modelOutputInMessagesEnabled: false,
                    transportConfigurations: [
                        {
                            provider: "twilio",
                            timeout: 60,
                            record: false,
                        },
                    ],
                    observabilityPlan: {
                        provider: "langfuse",
                        tags: ["tags"],
                    },
                    credentials: [
                        {
                            provider: "11labs",
                            apiKey: "apiKey",
                        },
                    ],
                    hooks: [
                        {
                            on: "call.ending",
                            do: [
                                {
                                    type: "tool",
                                    tool: {
                                        type: "apiRequest",
                                        messages: [
                                            {
                                                type: "request-start",
                                                blocking: false,
                                            },
                                        ],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: {
                                                        position: -1,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    "tools:append": [
                        {
                            type: "apiRequest",
                            messages: [
                                {
                                    type: "request-start",
                                    blocking: false,
                                },
                            ],
                            method: "POST",
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            url: "url",
                            backoffPlan: {
                                type: {
                                    key: "value",
                                },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                            rejectionPlan: {
                                conditions: [
                                    {
                                        type: "regex",
                                        regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                        target: {
                                            position: -1,
                                        },
                                    },
                                ],
                            },
                        },
                    ],
                    variableValues: {
                        key: "value",
                    },
                    name: "name",
                    voicemailMessage: "voicemailMessage",
                    endCallMessage: "endCallMessage",
                    endCallPhrases: ["endCallPhrases"],
                    compliancePlan: {
                        recordingConsentPlan: {
                            type: "stay-on-line",
                            message:
                                "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "\u3002",
                                                    "\uFF0C",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "\u060C",
                                                    "\u06D4",
                                                    "\u0964",
                                                    "\u0965",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: {
                                                    enabled: true,
                                                    numberToDigitsCutoff: 2025,
                                                },
                                            },
                                        },
                                    ],
                                },
                            },
                            waitSeconds: 3,
                        },
                    },
                    metadata: {
                        key: "value",
                    },
                    backgroundSpeechDenoisingPlan: {
                        fourierDenoisingPlan: {
                            mediaDetectionEnabled: true,
                            staticThreshold: -35,
                            baselineOffsetDb: -15,
                            windowSizeMs: 3000,
                            baselinePercentile: 85,
                        },
                    },
                    artifactPlan: {
                        recordingEnabled: true,
                        recordingUseCustomStorageEnabled: true,
                        videoRecordingEnabled: false,
                        fullMessageHistoryEnabled: false,
                        pcapEnabled: true,
                        pcapS3PathPrefix: "/pcaps",
                        pcapUseCustomStorageEnabled: true,
                        loggingEnabled: true,
                        loggingUseCustomStorageEnabled: true,
                        transcriptPlan: {
                            enabled: true,
                        },
                        structuredOutputs: [
                            {
                                compliancePlan: {
                                    forceStoreOnHipaaEnabled: false,
                                },
                                name: "name",
                                schema: {
                                    type: "string",
                                },
                            },
                        ],
                    },
                    startSpeakingPlan: {
                        waitSeconds: 0.4,
                        smartEndpointingPlan: {
                            provider: "vapi",
                        },
                        transcriptionEndpointingPlan: {
                            onPunctuationSeconds: 0.1,
                            onNoPunctuationSeconds: 1.5,
                            onNumberSeconds: 0.5,
                        },
                    },
                    stopSpeakingPlan: {
                        numWords: 0,
                        voiceSeconds: 0.2,
                        backoffSeconds: 1,
                        acknowledgementPhrases: [
                            "i understand",
                            "i see",
                            "i got it",
                            "i hear you",
                            "im listening",
                            "im with you",
                            "right",
                            "okay",
                            "ok",
                            "sure",
                            "alright",
                            "got it",
                            "understood",
                            "yeah",
                            "yes",
                            "uh-huh",
                            "mm-hmm",
                            "gotcha",
                            "mhmm",
                            "ah",
                            "yeah okay",
                            "yeah sure",
                        ],
                        interruptionPhrases: [
                            "stop",
                            "shut",
                            "up",
                            "enough",
                            "quiet",
                            "silence",
                            "but",
                            "dont",
                            "not",
                            "no",
                            "hold",
                            "wait",
                            "cut",
                            "pause",
                            "nope",
                            "nah",
                            "nevermind",
                            "never",
                            "bad",
                            "actually",
                        ],
                    },
                    monitorPlan: {
                        listenEnabled: false,
                        listenAuthenticationEnabled: false,
                        controlEnabled: false,
                        controlAuthenticationEnabled: false,
                        monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                    },
                    credentialIds: ["credentialIds"],
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                assistantId: "123e4567-e89b-12d3-a456-426614174000",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            startedAt: "2024-01-15T09:30:00Z",
            endedAt: "2024-01-15T09:30:00Z",
            endedMessage: "The Assistant returned an error",
            results: [
                {
                    status: "pass",
                    messages: [
                        {
                            role: "user",
                            content: "Hello, how are you?",
                        },
                    ],
                    startedAt: "2021-01-01T00:00:00Z",
                    endedAt: "2021-01-01T00:00:00Z",
                },
            ],
            cost: 0.01,
            costs: [
                {
                    key: "value",
                },
            ],
            type: "eval",
            evalId: "123e4567-e89b-12d3-a456-426614174000",
        });
    });

    test("EvalController_getRunsPaginated", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            results: [
                {
                    status: "running",
                    endedReason: "mockConversation.done",
                    eval: {
                        messages: [
                            {
                                role: "assistant",
                                content: "The weather in San Francisco is sunny.",
                                toolCalls: [{ name: "get_weather", arguments: { key: "value" } }],
                            },
                        ],
                        name: "Verified User Flow Eval",
                        description: "This eval checks if the user flow is verified.",
                        type: "chat.mockConversation",
                    },
                    target: {
                        type: "assistant",
                        assistant: {
                            transcriber: {
                                provider: "assembly-ai",
                                confidenceThreshold: 0.4,
                                formatTurns: true,
                                endOfTurnConfidenceThreshold: 0.7,
                                minEndOfTurnSilenceWhenConfident: 160,
                                maxTurnSilence: 400,
                                vadAssistedEndpointingEnabled: true,
                                fallbackPlan: {
                                    transcribers: [
                                        {
                                            provider: "assembly-ai",
                                            confidenceThreshold: 0.4,
                                            formatTurns: true,
                                            endOfTurnConfidenceThreshold: 0.7,
                                            minEndOfTurnSilenceWhenConfident: 160,
                                            maxTurnSilence: 400,
                                            vadAssistedEndpointingEnabled: true,
                                        },
                                    ],
                                },
                            },
                            model: {
                                provider: "anthropic",
                                tools: [
                                    {
                                        type: "apiRequest",
                                        messages: [{ type: "request-start", blocking: false }],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: { position: -1 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                knowledgeBase: {
                                    provider: "custom-knowledge-base",
                                    server: {
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        staticIpAddressesEnabled: false,
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                    },
                                },
                                model: "claude-3-opus-20240229",
                            },
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "。",
                                                    "，",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "،",
                                                    "۔",
                                                    "।",
                                                    "॥",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                            },
                                        },
                                    ],
                                },
                            },
                            firstMessage: "Hello! How can I help you today?",
                            clientMessages: [
                                "conversation-update",
                                "function-call",
                                "hang",
                                "model-output",
                                "speech-update",
                                "status-update",
                                "transfer-update",
                                "transcript",
                                "tool-calls",
                                "user-interrupted",
                                "voice-input",
                                "workflow.node.started",
                                "assistant.started",
                            ],
                            serverMessages: [
                                "conversation-update",
                                "end-of-call-report",
                                "function-call",
                                "hang",
                                "speech-update",
                                "status-update",
                                "tool-calls",
                                "transfer-destination-request",
                                "handoff-destination-request",
                                "user-interrupted",
                                "assistant.started",
                            ],
                            maxDurationSeconds: 600,
                            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                            modelOutputInMessagesEnabled: false,
                            transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                            credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                            hooks: [
                                {
                                    on: "call.ending",
                                    do: [
                                        {
                                            type: "tool",
                                            tool: {
                                                type: "apiRequest",
                                                messages: [{ type: "request-start", blocking: false }],
                                                method: "POST",
                                                timeoutSeconds: 20,
                                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                                url: "url",
                                                backoffPlan: {
                                                    type: { key: "value" },
                                                    maxRetries: 0,
                                                    baseDelaySeconds: 1,
                                                    excludedStatusCodes: [
                                                        { key: "value" },
                                                        { key: "value" },
                                                        { key: "value" },
                                                        { key: "value" },
                                                    ],
                                                },
                                                rejectionPlan: {
                                                    conditions: [
                                                        {
                                                            type: "regex",
                                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                            target: { position: -1 },
                                                        },
                                                    ],
                                                },
                                            },
                                        },
                                    ],
                                },
                            ],
                            compliancePlan: {
                                recordingConsentPlan: {
                                    type: "stay-on-line",
                                    message:
                                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                                    voice: {
                                        provider: "azure",
                                        cachingEnabled: true,
                                        voiceId: "andrew",
                                        chunkPlan: {
                                            enabled: true,
                                            minCharacters: 30,
                                            punctuationBoundaries: [
                                                "。",
                                                "，",
                                                ".",
                                                "!",
                                                "?",
                                                ";",
                                                "،",
                                                "۔",
                                                "।",
                                                "॥",
                                                "|",
                                                "||",
                                                ",",
                                                ":",
                                            ],
                                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                        },
                                        fallbackPlan: {
                                            voices: [
                                                {
                                                    provider: "azure",
                                                    cachingEnabled: true,
                                                    voiceId: "andrew",
                                                    chunkPlan: {
                                                        enabled: true,
                                                        minCharacters: 30,
                                                        punctuationBoundaries: [
                                                            "。",
                                                            "，",
                                                            ".",
                                                            "!",
                                                            "?",
                                                            ";",
                                                            "،",
                                                            "۔",
                                                            "।",
                                                            "॥",
                                                            "|",
                                                            "||",
                                                            ",",
                                                            ":",
                                                        ],
                                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                    waitSeconds: 3,
                                },
                            },
                            backgroundSpeechDenoisingPlan: {
                                fourierDenoisingPlan: {
                                    mediaDetectionEnabled: true,
                                    staticThreshold: -35,
                                    baselineOffsetDb: -15,
                                    windowSizeMs: 3000,
                                    baselinePercentile: 85,
                                },
                            },
                            artifactPlan: {
                                recordingEnabled: true,
                                recordingUseCustomStorageEnabled: true,
                                videoRecordingEnabled: false,
                                fullMessageHistoryEnabled: false,
                                pcapEnabled: true,
                                pcapS3PathPrefix: "/pcaps",
                                pcapUseCustomStorageEnabled: true,
                                loggingEnabled: true,
                                loggingUseCustomStorageEnabled: true,
                                transcriptPlan: { enabled: true },
                                structuredOutputs: [
                                    {
                                        compliancePlan: { forceStoreOnHipaaEnabled: false },
                                        name: "name",
                                        schema: { type: "string" },
                                    },
                                ],
                            },
                            startSpeakingPlan: {
                                waitSeconds: 0.4,
                                smartEndpointingPlan: { provider: "vapi" },
                                transcriptionEndpointingPlan: {
                                    onPunctuationSeconds: 0.1,
                                    onNoPunctuationSeconds: 1.5,
                                    onNumberSeconds: 0.5,
                                },
                            },
                            stopSpeakingPlan: {
                                numWords: 0,
                                voiceSeconds: 0.2,
                                backoffSeconds: 1,
                                acknowledgementPhrases: [
                                    "i understand",
                                    "i see",
                                    "i got it",
                                    "i hear you",
                                    "im listening",
                                    "im with you",
                                    "right",
                                    "okay",
                                    "ok",
                                    "sure",
                                    "alright",
                                    "got it",
                                    "understood",
                                    "yeah",
                                    "yes",
                                    "uh-huh",
                                    "mm-hmm",
                                    "gotcha",
                                    "mhmm",
                                    "ah",
                                    "yeah okay",
                                    "yeah sure",
                                ],
                                interruptionPhrases: [
                                    "stop",
                                    "shut",
                                    "up",
                                    "enough",
                                    "quiet",
                                    "silence",
                                    "but",
                                    "dont",
                                    "not",
                                    "no",
                                    "hold",
                                    "wait",
                                    "cut",
                                    "pause",
                                    "nope",
                                    "nah",
                                    "nevermind",
                                    "never",
                                    "bad",
                                    "actually",
                                ],
                            },
                            monitorPlan: {
                                listenEnabled: false,
                                listenAuthenticationEnabled: false,
                                controlEnabled: false,
                                controlAuthenticationEnabled: false,
                                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                            },
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                            },
                        },
                        assistantOverrides: {
                            transcriber: {
                                provider: "assembly-ai",
                                confidenceThreshold: 0.4,
                                formatTurns: true,
                                endOfTurnConfidenceThreshold: 0.7,
                                minEndOfTurnSilenceWhenConfident: 160,
                                maxTurnSilence: 400,
                                vadAssistedEndpointingEnabled: true,
                                fallbackPlan: {
                                    transcribers: [
                                        {
                                            provider: "assembly-ai",
                                            confidenceThreshold: 0.4,
                                            formatTurns: true,
                                            endOfTurnConfidenceThreshold: 0.7,
                                            minEndOfTurnSilenceWhenConfident: 160,
                                            maxTurnSilence: 400,
                                            vadAssistedEndpointingEnabled: true,
                                        },
                                    ],
                                },
                            },
                            model: {
                                provider: "anthropic",
                                tools: [
                                    {
                                        type: "apiRequest",
                                        messages: [{ type: "request-start", blocking: false }],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: { position: -1 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                knowledgeBase: {
                                    provider: "custom-knowledge-base",
                                    server: {
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        staticIpAddressesEnabled: false,
                                        backoffPlan: {
                                            type: { key: "value" },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                                { key: "value" },
                                            ],
                                        },
                                    },
                                },
                                model: "claude-3-opus-20240229",
                            },
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "。",
                                                    "，",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "،",
                                                    "۔",
                                                    "।",
                                                    "॥",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                            },
                                        },
                                    ],
                                },
                            },
                            firstMessage: "Hello! How can I help you today?",
                            clientMessages: [
                                "conversation-update",
                                "function-call",
                                "hang",
                                "model-output",
                                "speech-update",
                                "status-update",
                                "transfer-update",
                                "transcript",
                                "tool-calls",
                                "user-interrupted",
                                "voice-input",
                                "workflow.node.started",
                                "assistant.started",
                            ],
                            serverMessages: [
                                "conversation-update",
                                "end-of-call-report",
                                "function-call",
                                "hang",
                                "speech-update",
                                "status-update",
                                "tool-calls",
                                "transfer-destination-request",
                                "handoff-destination-request",
                                "user-interrupted",
                                "assistant.started",
                            ],
                            maxDurationSeconds: 600,
                            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                            modelOutputInMessagesEnabled: false,
                            transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                            credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                            hooks: [
                                {
                                    on: "call.ending",
                                    do: [
                                        {
                                            type: "tool",
                                            tool: {
                                                type: "apiRequest",
                                                messages: [{ type: "request-start", blocking: false }],
                                                method: "POST",
                                                timeoutSeconds: 20,
                                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                                url: "url",
                                                backoffPlan: {
                                                    type: { key: "value" },
                                                    maxRetries: 0,
                                                    baseDelaySeconds: 1,
                                                    excludedStatusCodes: [
                                                        { key: "value" },
                                                        { key: "value" },
                                                        { key: "value" },
                                                        { key: "value" },
                                                    ],
                                                },
                                                rejectionPlan: {
                                                    conditions: [
                                                        {
                                                            type: "regex",
                                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                            target: { position: -1 },
                                                        },
                                                    ],
                                                },
                                            },
                                        },
                                    ],
                                },
                            ],
                            "tools:append": [
                                {
                                    type: "apiRequest",
                                    messages: [{ type: "request-start", blocking: false }],
                                    method: "POST",
                                    timeoutSeconds: 20,
                                    credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                    url: "url",
                                    backoffPlan: {
                                        type: { key: "value" },
                                        maxRetries: 0,
                                        baseDelaySeconds: 1,
                                        excludedStatusCodes: [
                                            { key: "value" },
                                            { key: "value" },
                                            { key: "value" },
                                            { key: "value" },
                                        ],
                                    },
                                    rejectionPlan: {
                                        conditions: [
                                            {
                                                type: "regex",
                                                regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                target: { position: -1 },
                                            },
                                        ],
                                    },
                                },
                            ],
                            compliancePlan: {
                                recordingConsentPlan: {
                                    type: "stay-on-line",
                                    message:
                                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                                    voice: {
                                        provider: "azure",
                                        cachingEnabled: true,
                                        voiceId: "andrew",
                                        chunkPlan: {
                                            enabled: true,
                                            minCharacters: 30,
                                            punctuationBoundaries: [
                                                "。",
                                                "，",
                                                ".",
                                                "!",
                                                "?",
                                                ";",
                                                "،",
                                                "۔",
                                                "।",
                                                "॥",
                                                "|",
                                                "||",
                                                ",",
                                                ":",
                                            ],
                                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                        },
                                        fallbackPlan: {
                                            voices: [
                                                {
                                                    provider: "azure",
                                                    cachingEnabled: true,
                                                    voiceId: "andrew",
                                                    chunkPlan: {
                                                        enabled: true,
                                                        minCharacters: 30,
                                                        punctuationBoundaries: [
                                                            "。",
                                                            "，",
                                                            ".",
                                                            "!",
                                                            "?",
                                                            ";",
                                                            "،",
                                                            "۔",
                                                            "।",
                                                            "॥",
                                                            "|",
                                                            "||",
                                                            ",",
                                                            ":",
                                                        ],
                                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                    waitSeconds: 3,
                                },
                            },
                            backgroundSpeechDenoisingPlan: {
                                fourierDenoisingPlan: {
                                    mediaDetectionEnabled: true,
                                    staticThreshold: -35,
                                    baselineOffsetDb: -15,
                                    windowSizeMs: 3000,
                                    baselinePercentile: 85,
                                },
                            },
                            artifactPlan: {
                                recordingEnabled: true,
                                recordingUseCustomStorageEnabled: true,
                                videoRecordingEnabled: false,
                                fullMessageHistoryEnabled: false,
                                pcapEnabled: true,
                                pcapS3PathPrefix: "/pcaps",
                                pcapUseCustomStorageEnabled: true,
                                loggingEnabled: true,
                                loggingUseCustomStorageEnabled: true,
                                transcriptPlan: { enabled: true },
                                structuredOutputs: [
                                    {
                                        compliancePlan: { forceStoreOnHipaaEnabled: false },
                                        name: "name",
                                        schema: { type: "string" },
                                    },
                                ],
                            },
                            startSpeakingPlan: {
                                waitSeconds: 0.4,
                                smartEndpointingPlan: { provider: "vapi" },
                                transcriptionEndpointingPlan: {
                                    onPunctuationSeconds: 0.1,
                                    onNoPunctuationSeconds: 1.5,
                                    onNumberSeconds: 0.5,
                                },
                            },
                            stopSpeakingPlan: {
                                numWords: 0,
                                voiceSeconds: 0.2,
                                backoffSeconds: 1,
                                acknowledgementPhrases: [
                                    "i understand",
                                    "i see",
                                    "i got it",
                                    "i hear you",
                                    "im listening",
                                    "im with you",
                                    "right",
                                    "okay",
                                    "ok",
                                    "sure",
                                    "alright",
                                    "got it",
                                    "understood",
                                    "yeah",
                                    "yes",
                                    "uh-huh",
                                    "mm-hmm",
                                    "gotcha",
                                    "mhmm",
                                    "ah",
                                    "yeah okay",
                                    "yeah sure",
                                ],
                                interruptionPhrases: [
                                    "stop",
                                    "shut",
                                    "up",
                                    "enough",
                                    "quiet",
                                    "silence",
                                    "but",
                                    "dont",
                                    "not",
                                    "no",
                                    "hold",
                                    "wait",
                                    "cut",
                                    "pause",
                                    "nope",
                                    "nah",
                                    "nevermind",
                                    "never",
                                    "bad",
                                    "actually",
                                ],
                            },
                            monitorPlan: {
                                listenEnabled: false,
                                listenAuthenticationEnabled: false,
                                controlEnabled: false,
                                controlAuthenticationEnabled: false,
                                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                            },
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                            },
                        },
                        assistantId: "123e4567-e89b-12d3-a456-426614174000",
                    },
                    id: "id",
                    orgId: "orgId",
                    createdAt: "2024-01-15T09:30:00Z",
                    startedAt: "2024-01-15T09:30:00Z",
                    endedAt: "2024-01-15T09:30:00Z",
                    endedMessage: "The Assistant returned an error",
                    results: [
                        {
                            status: "pass",
                            messages: [{ role: "user", content: "Hello, how are you?" }],
                            startedAt: "2021-01-01T00:00:00Z",
                            endedAt: "2021-01-01T00:00:00Z",
                        },
                    ],
                    cost: 0.01,
                    costs: [{ key: "value" }],
                    type: "eval",
                    evalId: "123e4567-e89b-12d3-a456-426614174000",
                },
            ],
            metadata: {
                itemsPerPage: 1.1,
                totalItems: 1.1,
                currentPage: 1.1,
                itemsBeyondRetention: true,
                createdAtLe: "2024-01-15T09:30:00Z",
                createdAtGe: "2024-01-15T09:30:00Z",
            },
        };

        server.mockEndpoint().get("/eval/run").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.eval.evalControllerGetRunsPaginated();
        expect(response).toEqual({
            results: [
                {
                    status: "running",
                    endedReason: "mockConversation.done",
                    eval: {
                        messages: [
                            {
                                role: "assistant",
                                content: "The weather in San Francisco is sunny.",
                                toolCalls: [
                                    {
                                        name: "get_weather",
                                        arguments: {
                                            key: "value",
                                        },
                                    },
                                ],
                            },
                        ],
                        name: "Verified User Flow Eval",
                        description: "This eval checks if the user flow is verified.",
                        type: "chat.mockConversation",
                    },
                    target: {
                        type: "assistant",
                        assistant: {
                            transcriber: {
                                provider: "assembly-ai",
                                confidenceThreshold: 0.4,
                                formatTurns: true,
                                endOfTurnConfidenceThreshold: 0.7,
                                minEndOfTurnSilenceWhenConfident: 160,
                                maxTurnSilence: 400,
                                vadAssistedEndpointingEnabled: true,
                                fallbackPlan: {
                                    transcribers: [
                                        {
                                            provider: "assembly-ai",
                                            confidenceThreshold: 0.4,
                                            formatTurns: true,
                                            endOfTurnConfidenceThreshold: 0.7,
                                            minEndOfTurnSilenceWhenConfident: 160,
                                            maxTurnSilence: 400,
                                            vadAssistedEndpointingEnabled: true,
                                        },
                                    ],
                                },
                            },
                            model: {
                                provider: "anthropic",
                                tools: [
                                    {
                                        type: "apiRequest",
                                        messages: [
                                            {
                                                type: "request-start",
                                                blocking: false,
                                            },
                                        ],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: {
                                                        position: -1,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                knowledgeBase: {
                                    provider: "custom-knowledge-base",
                                    server: {
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        staticIpAddressesEnabled: false,
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                    },
                                },
                                model: "claude-3-opus-20240229",
                            },
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "\u3002",
                                                    "\uFF0C",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "\u060C",
                                                    "\u06D4",
                                                    "\u0964",
                                                    "\u0965",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: {
                                                    enabled: true,
                                                    numberToDigitsCutoff: 2025,
                                                },
                                            },
                                        },
                                    ],
                                },
                            },
                            firstMessage: "Hello! How can I help you today?",
                            clientMessages: [
                                "conversation-update",
                                "function-call",
                                "hang",
                                "model-output",
                                "speech-update",
                                "status-update",
                                "transfer-update",
                                "transcript",
                                "tool-calls",
                                "user-interrupted",
                                "voice-input",
                                "workflow.node.started",
                                "assistant.started",
                            ],
                            serverMessages: [
                                "conversation-update",
                                "end-of-call-report",
                                "function-call",
                                "hang",
                                "speech-update",
                                "status-update",
                                "tool-calls",
                                "transfer-destination-request",
                                "handoff-destination-request",
                                "user-interrupted",
                                "assistant.started",
                            ],
                            maxDurationSeconds: 600,
                            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                            modelOutputInMessagesEnabled: false,
                            transportConfigurations: [
                                {
                                    provider: "twilio",
                                    timeout: 60,
                                    record: false,
                                },
                            ],
                            credentials: [
                                {
                                    provider: "11labs",
                                    apiKey: "apiKey",
                                },
                            ],
                            hooks: [
                                {
                                    on: "call.ending",
                                    do: [
                                        {
                                            type: "tool",
                                            tool: {
                                                type: "apiRequest",
                                                messages: [
                                                    {
                                                        type: "request-start",
                                                        blocking: false,
                                                    },
                                                ],
                                                method: "POST",
                                                timeoutSeconds: 20,
                                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                                url: "url",
                                                backoffPlan: {
                                                    type: {
                                                        key: "value",
                                                    },
                                                    maxRetries: 0,
                                                    baseDelaySeconds: 1,
                                                    excludedStatusCodes: [
                                                        {
                                                            key: "value",
                                                        },
                                                        {
                                                            key: "value",
                                                        },
                                                        {
                                                            key: "value",
                                                        },
                                                        {
                                                            key: "value",
                                                        },
                                                    ],
                                                },
                                                rejectionPlan: {
                                                    conditions: [
                                                        {
                                                            type: "regex",
                                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                            target: {
                                                                position: -1,
                                                            },
                                                        },
                                                    ],
                                                },
                                            },
                                        },
                                    ],
                                },
                            ],
                            compliancePlan: {
                                recordingConsentPlan: {
                                    type: "stay-on-line",
                                    message:
                                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                                    voice: {
                                        provider: "azure",
                                        cachingEnabled: true,
                                        voiceId: "andrew",
                                        chunkPlan: {
                                            enabled: true,
                                            minCharacters: 30,
                                            punctuationBoundaries: [
                                                "\u3002",
                                                "\uFF0C",
                                                ".",
                                                "!",
                                                "?",
                                                ";",
                                                "\u060C",
                                                "\u06D4",
                                                "\u0964",
                                                "\u0965",
                                                "|",
                                                "||",
                                                ",",
                                                ":",
                                            ],
                                            formatPlan: {
                                                enabled: true,
                                                numberToDigitsCutoff: 2025,
                                            },
                                        },
                                        fallbackPlan: {
                                            voices: [
                                                {
                                                    provider: "azure",
                                                    cachingEnabled: true,
                                                    voiceId: "andrew",
                                                    chunkPlan: {
                                                        enabled: true,
                                                        minCharacters: 30,
                                                        punctuationBoundaries: [
                                                            "\u3002",
                                                            "\uFF0C",
                                                            ".",
                                                            "!",
                                                            "?",
                                                            ";",
                                                            "\u060C",
                                                            "\u06D4",
                                                            "\u0964",
                                                            "\u0965",
                                                            "|",
                                                            "||",
                                                            ",",
                                                            ":",
                                                        ],
                                                        formatPlan: {
                                                            enabled: true,
                                                            numberToDigitsCutoff: 2025,
                                                        },
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                    waitSeconds: 3,
                                },
                            },
                            backgroundSpeechDenoisingPlan: {
                                fourierDenoisingPlan: {
                                    mediaDetectionEnabled: true,
                                    staticThreshold: -35,
                                    baselineOffsetDb: -15,
                                    windowSizeMs: 3000,
                                    baselinePercentile: 85,
                                },
                            },
                            artifactPlan: {
                                recordingEnabled: true,
                                recordingUseCustomStorageEnabled: true,
                                videoRecordingEnabled: false,
                                fullMessageHistoryEnabled: false,
                                pcapEnabled: true,
                                pcapS3PathPrefix: "/pcaps",
                                pcapUseCustomStorageEnabled: true,
                                loggingEnabled: true,
                                loggingUseCustomStorageEnabled: true,
                                transcriptPlan: {
                                    enabled: true,
                                },
                                structuredOutputs: [
                                    {
                                        compliancePlan: {
                                            forceStoreOnHipaaEnabled: false,
                                        },
                                        name: "name",
                                        schema: {
                                            type: "string",
                                        },
                                    },
                                ],
                            },
                            startSpeakingPlan: {
                                waitSeconds: 0.4,
                                smartEndpointingPlan: {
                                    provider: "vapi",
                                },
                                transcriptionEndpointingPlan: {
                                    onPunctuationSeconds: 0.1,
                                    onNoPunctuationSeconds: 1.5,
                                    onNumberSeconds: 0.5,
                                },
                            },
                            stopSpeakingPlan: {
                                numWords: 0,
                                voiceSeconds: 0.2,
                                backoffSeconds: 1,
                                acknowledgementPhrases: [
                                    "i understand",
                                    "i see",
                                    "i got it",
                                    "i hear you",
                                    "im listening",
                                    "im with you",
                                    "right",
                                    "okay",
                                    "ok",
                                    "sure",
                                    "alright",
                                    "got it",
                                    "understood",
                                    "yeah",
                                    "yes",
                                    "uh-huh",
                                    "mm-hmm",
                                    "gotcha",
                                    "mhmm",
                                    "ah",
                                    "yeah okay",
                                    "yeah sure",
                                ],
                                interruptionPhrases: [
                                    "stop",
                                    "shut",
                                    "up",
                                    "enough",
                                    "quiet",
                                    "silence",
                                    "but",
                                    "dont",
                                    "not",
                                    "no",
                                    "hold",
                                    "wait",
                                    "cut",
                                    "pause",
                                    "nope",
                                    "nah",
                                    "nevermind",
                                    "never",
                                    "bad",
                                    "actually",
                                ],
                            },
                            monitorPlan: {
                                listenEnabled: false,
                                listenAuthenticationEnabled: false,
                                controlEnabled: false,
                                controlAuthenticationEnabled: false,
                                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                            },
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            },
                        },
                        assistantOverrides: {
                            transcriber: {
                                provider: "assembly-ai",
                                confidenceThreshold: 0.4,
                                formatTurns: true,
                                endOfTurnConfidenceThreshold: 0.7,
                                minEndOfTurnSilenceWhenConfident: 160,
                                maxTurnSilence: 400,
                                vadAssistedEndpointingEnabled: true,
                                fallbackPlan: {
                                    transcribers: [
                                        {
                                            provider: "assembly-ai",
                                            confidenceThreshold: 0.4,
                                            formatTurns: true,
                                            endOfTurnConfidenceThreshold: 0.7,
                                            minEndOfTurnSilenceWhenConfident: 160,
                                            maxTurnSilence: 400,
                                            vadAssistedEndpointingEnabled: true,
                                        },
                                    ],
                                },
                            },
                            model: {
                                provider: "anthropic",
                                tools: [
                                    {
                                        type: "apiRequest",
                                        messages: [
                                            {
                                                type: "request-start",
                                                blocking: false,
                                            },
                                        ],
                                        method: "POST",
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        url: "url",
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                        rejectionPlan: {
                                            conditions: [
                                                {
                                                    type: "regex",
                                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                    target: {
                                                        position: -1,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                knowledgeBase: {
                                    provider: "custom-knowledge-base",
                                    server: {
                                        timeoutSeconds: 20,
                                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                        staticIpAddressesEnabled: false,
                                        backoffPlan: {
                                            type: {
                                                key: "value",
                                            },
                                            maxRetries: 0,
                                            baseDelaySeconds: 1,
                                            excludedStatusCodes: [
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                                {
                                                    key: "value",
                                                },
                                            ],
                                        },
                                    },
                                },
                                model: "claude-3-opus-20240229",
                            },
                            voice: {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                                fallbackPlan: {
                                    voices: [
                                        {
                                            provider: "azure",
                                            cachingEnabled: true,
                                            voiceId: "andrew",
                                            chunkPlan: {
                                                enabled: true,
                                                minCharacters: 30,
                                                punctuationBoundaries: [
                                                    "\u3002",
                                                    "\uFF0C",
                                                    ".",
                                                    "!",
                                                    "?",
                                                    ";",
                                                    "\u060C",
                                                    "\u06D4",
                                                    "\u0964",
                                                    "\u0965",
                                                    "|",
                                                    "||",
                                                    ",",
                                                    ":",
                                                ],
                                                formatPlan: {
                                                    enabled: true,
                                                    numberToDigitsCutoff: 2025,
                                                },
                                            },
                                        },
                                    ],
                                },
                            },
                            firstMessage: "Hello! How can I help you today?",
                            clientMessages: [
                                "conversation-update",
                                "function-call",
                                "hang",
                                "model-output",
                                "speech-update",
                                "status-update",
                                "transfer-update",
                                "transcript",
                                "tool-calls",
                                "user-interrupted",
                                "voice-input",
                                "workflow.node.started",
                                "assistant.started",
                            ],
                            serverMessages: [
                                "conversation-update",
                                "end-of-call-report",
                                "function-call",
                                "hang",
                                "speech-update",
                                "status-update",
                                "tool-calls",
                                "transfer-destination-request",
                                "handoff-destination-request",
                                "user-interrupted",
                                "assistant.started",
                            ],
                            maxDurationSeconds: 600,
                            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                            modelOutputInMessagesEnabled: false,
                            transportConfigurations: [
                                {
                                    provider: "twilio",
                                    timeout: 60,
                                    record: false,
                                },
                            ],
                            credentials: [
                                {
                                    provider: "11labs",
                                    apiKey: "apiKey",
                                },
                            ],
                            hooks: [
                                {
                                    on: "call.ending",
                                    do: [
                                        {
                                            type: "tool",
                                            tool: {
                                                type: "apiRequest",
                                                messages: [
                                                    {
                                                        type: "request-start",
                                                        blocking: false,
                                                    },
                                                ],
                                                method: "POST",
                                                timeoutSeconds: 20,
                                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                                url: "url",
                                                backoffPlan: {
                                                    type: {
                                                        key: "value",
                                                    },
                                                    maxRetries: 0,
                                                    baseDelaySeconds: 1,
                                                    excludedStatusCodes: [
                                                        {
                                                            key: "value",
                                                        },
                                                        {
                                                            key: "value",
                                                        },
                                                        {
                                                            key: "value",
                                                        },
                                                        {
                                                            key: "value",
                                                        },
                                                    ],
                                                },
                                                rejectionPlan: {
                                                    conditions: [
                                                        {
                                                            type: "regex",
                                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                            target: {
                                                                position: -1,
                                                            },
                                                        },
                                                    ],
                                                },
                                            },
                                        },
                                    ],
                                },
                            ],
                            "tools:append": [
                                {
                                    type: "apiRequest",
                                    messages: [
                                        {
                                            type: "request-start",
                                            blocking: false,
                                        },
                                    ],
                                    method: "POST",
                                    timeoutSeconds: 20,
                                    credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                    url: "url",
                                    backoffPlan: {
                                        type: {
                                            key: "value",
                                        },
                                        maxRetries: 0,
                                        baseDelaySeconds: 1,
                                        excludedStatusCodes: [
                                            {
                                                key: "value",
                                            },
                                            {
                                                key: "value",
                                            },
                                            {
                                                key: "value",
                                            },
                                            {
                                                key: "value",
                                            },
                                        ],
                                    },
                                    rejectionPlan: {
                                        conditions: [
                                            {
                                                type: "regex",
                                                regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                target: {
                                                    position: -1,
                                                },
                                            },
                                        ],
                                    },
                                },
                            ],
                            compliancePlan: {
                                recordingConsentPlan: {
                                    type: "stay-on-line",
                                    message:
                                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                                    voice: {
                                        provider: "azure",
                                        cachingEnabled: true,
                                        voiceId: "andrew",
                                        chunkPlan: {
                                            enabled: true,
                                            minCharacters: 30,
                                            punctuationBoundaries: [
                                                "\u3002",
                                                "\uFF0C",
                                                ".",
                                                "!",
                                                "?",
                                                ";",
                                                "\u060C",
                                                "\u06D4",
                                                "\u0964",
                                                "\u0965",
                                                "|",
                                                "||",
                                                ",",
                                                ":",
                                            ],
                                            formatPlan: {
                                                enabled: true,
                                                numberToDigitsCutoff: 2025,
                                            },
                                        },
                                        fallbackPlan: {
                                            voices: [
                                                {
                                                    provider: "azure",
                                                    cachingEnabled: true,
                                                    voiceId: "andrew",
                                                    chunkPlan: {
                                                        enabled: true,
                                                        minCharacters: 30,
                                                        punctuationBoundaries: [
                                                            "\u3002",
                                                            "\uFF0C",
                                                            ".",
                                                            "!",
                                                            "?",
                                                            ";",
                                                            "\u060C",
                                                            "\u06D4",
                                                            "\u0964",
                                                            "\u0965",
                                                            "|",
                                                            "||",
                                                            ",",
                                                            ":",
                                                        ],
                                                        formatPlan: {
                                                            enabled: true,
                                                            numberToDigitsCutoff: 2025,
                                                        },
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                    waitSeconds: 3,
                                },
                            },
                            backgroundSpeechDenoisingPlan: {
                                fourierDenoisingPlan: {
                                    mediaDetectionEnabled: true,
                                    staticThreshold: -35,
                                    baselineOffsetDb: -15,
                                    windowSizeMs: 3000,
                                    baselinePercentile: 85,
                                },
                            },
                            artifactPlan: {
                                recordingEnabled: true,
                                recordingUseCustomStorageEnabled: true,
                                videoRecordingEnabled: false,
                                fullMessageHistoryEnabled: false,
                                pcapEnabled: true,
                                pcapS3PathPrefix: "/pcaps",
                                pcapUseCustomStorageEnabled: true,
                                loggingEnabled: true,
                                loggingUseCustomStorageEnabled: true,
                                transcriptPlan: {
                                    enabled: true,
                                },
                                structuredOutputs: [
                                    {
                                        compliancePlan: {
                                            forceStoreOnHipaaEnabled: false,
                                        },
                                        name: "name",
                                        schema: {
                                            type: "string",
                                        },
                                    },
                                ],
                            },
                            startSpeakingPlan: {
                                waitSeconds: 0.4,
                                smartEndpointingPlan: {
                                    provider: "vapi",
                                },
                                transcriptionEndpointingPlan: {
                                    onPunctuationSeconds: 0.1,
                                    onNoPunctuationSeconds: 1.5,
                                    onNumberSeconds: 0.5,
                                },
                            },
                            stopSpeakingPlan: {
                                numWords: 0,
                                voiceSeconds: 0.2,
                                backoffSeconds: 1,
                                acknowledgementPhrases: [
                                    "i understand",
                                    "i see",
                                    "i got it",
                                    "i hear you",
                                    "im listening",
                                    "im with you",
                                    "right",
                                    "okay",
                                    "ok",
                                    "sure",
                                    "alright",
                                    "got it",
                                    "understood",
                                    "yeah",
                                    "yes",
                                    "uh-huh",
                                    "mm-hmm",
                                    "gotcha",
                                    "mhmm",
                                    "ah",
                                    "yeah okay",
                                    "yeah sure",
                                ],
                                interruptionPhrases: [
                                    "stop",
                                    "shut",
                                    "up",
                                    "enough",
                                    "quiet",
                                    "silence",
                                    "but",
                                    "dont",
                                    "not",
                                    "no",
                                    "hold",
                                    "wait",
                                    "cut",
                                    "pause",
                                    "nope",
                                    "nah",
                                    "nevermind",
                                    "never",
                                    "bad",
                                    "actually",
                                ],
                            },
                            monitorPlan: {
                                listenEnabled: false,
                                listenAuthenticationEnabled: false,
                                controlEnabled: false,
                                controlAuthenticationEnabled: false,
                                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                            },
                            server: {
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                staticIpAddressesEnabled: false,
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            },
                        },
                        assistantId: "123e4567-e89b-12d3-a456-426614174000",
                    },
                    id: "id",
                    orgId: "orgId",
                    createdAt: "2024-01-15T09:30:00Z",
                    startedAt: "2024-01-15T09:30:00Z",
                    endedAt: "2024-01-15T09:30:00Z",
                    endedMessage: "The Assistant returned an error",
                    results: [
                        {
                            status: "pass",
                            messages: [
                                {
                                    role: "user",
                                    content: "Hello, how are you?",
                                },
                            ],
                            startedAt: "2021-01-01T00:00:00Z",
                            endedAt: "2021-01-01T00:00:00Z",
                        },
                    ],
                    cost: 0.01,
                    costs: [
                        {
                            key: "value",
                        },
                    ],
                    type: "eval",
                    evalId: "123e4567-e89b-12d3-a456-426614174000",
                },
            ],
            metadata: {
                itemsPerPage: 1.1,
                totalItems: 1.1,
                currentPage: 1.1,
                itemsBeyondRetention: true,
                createdAtLe: "2024-01-15T09:30:00Z",
                createdAtGe: "2024-01-15T09:30:00Z",
            },
        });
    });

    test("EvalController_run", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = { target: { type: "assistant" }, type: "eval" };
        const rawResponseBody = { key: "value" };

        server
            .mockEndpoint()
            .post("/eval/run")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.eval.evalControllerRun({
            target: {
                type: "assistant",
            },
            type: "eval",
        });
        expect(response).toEqual({
            key: "value",
        });
    });
});
