> ## Documentation Index
> Fetch the complete documentation index at: https://doc.rapida.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Debugger Deployment

> Create an assistant debugger deployment from the Rapida SDK.

Creates a debugger deployment for an assistant. Use user-scoped authentication because the operation requires organization and project context.

<Info>
  For setup and authentication options, see the [Installation guide](/api-reference/installation) and [Authentication](/api-reference/authentication).
</Info>

## Parameters

<ParamField body="connectionConfig" type="ConnectionConfig" required>
  Configuration for the client connection.
</ParamField>

<ParamField body="request" type="CreateAssistantDeploymentRequest" required>
  Provide the `debugger` deployment variant.

  <Expandable>
    <ParamField body="debugger" type="AssistantDebuggerDeployment" required>
      Debugger deployment configuration.

      <Expandable>
        <ParamField body="assistantId" type="uint64" required>
          Assistant ID for the debugger deployment.
        </ParamField>

        <ParamField body="greeting" type="string">
          First message the assistant sends when the debugger session starts.
        </ParamField>

        <ParamField body="greetingInterruptible" type="boolean">
          Controls whether users can interrupt the opening greeting in audio sessions.
        </ParamField>

        <ParamField body="mistake" type="string">
          Message to use when the assistant cannot understand or handle the input.
        </ParamField>

        <ParamField body="idealTimeout" type="uint64">
          Idle timeout in seconds. Must be between `15` and `120`.
        </ParamField>

        <ParamField body="idealTimeoutBackoff" type="uint64">
          Number of idle-timeout retries. Must be between `0` and `5`.
        </ParamField>

        <ParamField body="idealTimeoutMessage" type="string">
          Message sent when the debugger session reaches the idle timeout.
        </ParamField>

        <ParamField body="maxSessionDuration" type="uint64">
          Maximum debugger session duration in seconds. Must be between `180` and `600`.
        </ParamField>

        <ParamField body="inputAudio" type="DeploymentAudioProvider">
          Speech-to-text audio provider configuration.
        </ParamField>

        <ParamField body="outputAudio" type="DeploymentAudioProvider">
          Text-to-speech audio provider configuration.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

## Usage

<CodeGroup>
  ```ts React theme={null}
  import {
    AssistantDebuggerDeployment,
    ConnectionConfig,
    CreateAssistantDebuggerDeployment,
    CreateAssistantDeploymentRequest,
    DeploymentAudioProvider,
    Metadata,
  } from "@rapidaai/react";

  const auth = ConnectionConfig.WithDebugger({
    authorization: "AUTHORIZATION_TOKEN_PLACEHOLDER",
    userId: "AUTH_ID_PLACEHOLDER",
    projectId: "PROJECT_ID_PLACEHOLDER",
  });
  const connectionCfg = ConnectionConfig.DefaultConnectionConfig(auth);

  const inputModel = new Metadata();
  inputModel.setKey("model");
  inputModel.setValue("nova-3");

  const inputAudio = new DeploymentAudioProvider();
  inputAudio.setAudioprovider("deepgram");
  inputAudio.setAudiotype("stt");
  inputAudio.setAudiooptionsList([inputModel]);

  const outputVoice = new Metadata();
  outputVoice.setKey("voiceId");
  outputVoice.setValue("VOICE_ID_PLACEHOLDER");

  const outputAudio = new DeploymentAudioProvider();
  outputAudio.setAudioprovider("elevenlabs");
  outputAudio.setAudiotype("tts");
  outputAudio.setAudiooptionsList([outputVoice]);

  const deployment = new AssistantDebuggerDeployment();
  deployment.setAssistantid("ASSISTANT_ID_PLACEHOLDER");
  deployment.setGreeting("Hi, how can I help you today?");
  deployment.setGreetinginterruptible(false);
  deployment.setMistake("Sorry, I did not understand that.");
  deployment.setIdealtimeout("30");
  deployment.setIdealtimeoutbackoff("2");
  deployment.setIdealtimeoutmessage("Are you still there?");
  deployment.setMaxsessionduration("300");
  deployment.setInputaudio(inputAudio);
  deployment.setOutputaudio(outputAudio);

  const request = new CreateAssistantDeploymentRequest();
  request.setDebugger(deployment);

  const response = await CreateAssistantDebuggerDeployment(connectionCfg, request);
  console.dir(response.toObject());
  ```

  ```javascript Node.js theme={null}
  import {
    AssistantDebuggerDeployment,
    ConnectionConfig,
    CreateAssistantDebuggerDeployment,
    CreateAssistantDeploymentRequest,
    DeploymentAudioProvider,
    Metadata,
  } from "@rapidaai/nodejs";

  const auth = ConnectionConfig.WithDebugger({
    authorization: process.env.RAPIDA_AUTHORIZATION,
    userId: process.env.RAPIDA_AUTH_ID,
    projectId: process.env.RAPIDA_PROJECT_ID,
  });
  const connectionCfg = ConnectionConfig.DefaultConnectionConfig(auth);

  const inputModel = new Metadata();
  inputModel.setKey("model");
  inputModel.setValue("nova-3");

  const inputAudio = new DeploymentAudioProvider();
  inputAudio.setAudioprovider("deepgram");
  inputAudio.setAudiotype("stt");
  inputAudio.setAudiooptionsList([inputModel]);

  const outputVoice = new Metadata();
  outputVoice.setKey("voiceId");
  outputVoice.setValue("VOICE_ID_PLACEHOLDER");

  const outputAudio = new DeploymentAudioProvider();
  outputAudio.setAudioprovider("elevenlabs");
  outputAudio.setAudiotype("tts");
  outputAudio.setAudiooptionsList([outputVoice]);

  const deployment = new AssistantDebuggerDeployment();
  deployment.setAssistantid(process.env.RAPIDA_ASSISTANT_ID);
  deployment.setGreeting("Hi, how can I help you today?");
  deployment.setGreetinginterruptible(false);
  deployment.setMistake("Sorry, I did not understand that.");
  deployment.setIdealtimeout("30");
  deployment.setIdealtimeoutbackoff("2");
  deployment.setIdealtimeoutmessage("Are you still there?");
  deployment.setMaxsessionduration("300");
  deployment.setInputaudio(inputAudio);
  deployment.setOutputaudio(outputAudio);

  const request = new CreateAssistantDeploymentRequest();
  request.setDebugger(deployment);

  try {
    const response = await CreateAssistantDebuggerDeployment(connectionCfg, request);
    console.dir(response.toObject());
  } catch (error) {
    console.error("Error with CreateAssistantDebuggerDeployment call:", error);
  }
  ```

  ```python Python theme={null}
  import os
  from pprint import pprint

  from rapida import (
      AssistantDebuggerDeployment,
      ConnectionConfig,
      DeploymentAudioProvider,
      Metadata,
  )
  from rapida.clients.protos.assistant_deployment_pb2 import (
      CreateAssistantDeploymentRequest,
  )

  auth = ConnectionConfig.with_debugger(
      authorization=os.getenv("RAPIDA_AUTHORIZATION"),
      user_id=os.getenv("RAPIDA_AUTH_ID"),
      project_id=os.getenv("RAPIDA_PROJECT_ID"),
  )
  connection_config = ConnectionConfig.default_connection_config(auth)

  deployment = AssistantDebuggerDeployment(
      assistantId=int(os.getenv("RAPIDA_ASSISTANT_ID")),
      greeting="Hi, how can I help you today?",
      greetingInterruptible=False,
      mistake="Sorry, I did not understand that.",
      idealTimeout=30,
      idealTimeoutBackoff=2,
      idealTimeoutMessage="Are you still there?",
      maxSessionDuration=300,
      inputAudio=DeploymentAudioProvider(
          audioProvider="deepgram",
          audioType="stt",
          audioOptions=[Metadata(key="model", value="nova-3")],
      ),
      outputAudio=DeploymentAudioProvider(
          audioProvider="elevenlabs",
          audioType="tts",
          audioOptions=[Metadata(key="voiceId", value="VOICE_ID_PLACEHOLDER")],
      ),
  )

  response = connection_config.assistant_deployment_client.CreateAssistantDebuggerDeployment(
      CreateAssistantDeploymentRequest(debugger=deployment),
      metadata=connection_config.auth,
  )
  pprint(response)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"os"

  	"google.golang.org/protobuf/proto"

  	clients "github.com/rapidaai/rapida-go/rapida/clients"
  	connections "github.com/rapidaai/rapida-go/rapida/connections"
  	protos "github.com/rapidaai/rapida-go/protos"
  )

  func main() {
  	connectionConfig := connections.DefaultconnectionConfig(
  		connections.WithPersonalToken(
  			os.Getenv("RAPIDA_AUTHORIZATION"),
  			os.Getenv("RAPIDA_AUTH_ID"),
  			os.Getenv("RAPIDA_PROJECT_ID"),
  		),
  	)

  	response, err := clients.CreateAssistantDebuggerDeployment(
  		context.Background(),
  		connectionConfig,
  		&protos.CreateAssistantDeploymentRequest{
  			Deployment: &protos.CreateAssistantDeploymentRequest_Debugger{
  				Debugger: &protos.AssistantDebuggerDeployment{
  					AssistantId:         2227823180112723968,
  					Greeting:            proto.String("Hi, how can I help you today?"),
  					GreetingInterruptible: proto.Bool(false),
  					Mistake:             proto.String("Sorry, I did not understand that."),
  					IdealTimeout:        30,
  					IdealTimeoutBackoff: 2,
  					IdealTimeoutMessage: "Are you still there?",
  					MaxSessionDuration:  300,
  					InputAudio: &protos.DeploymentAudioProvider{
  						AudioProvider: "deepgram",
  						AudioType:     "stt",
  						AudioOptions: []*protos.Metadata{{
  							Key:   "model",
  							Value: "nova-3",
  						}},
  					},
  					OutputAudio: &protos.DeploymentAudioProvider{
  						AudioProvider: "elevenlabs",
  						AudioType:     "tts",
  						AudioOptions: []*protos.Metadata{{
  							Key:   "voiceId",
  							Value: "VOICE_ID_PLACEHOLDER",
  						}},
  					},
  				},
  			},
  		},
  	)
  	if err != nil {
  		fmt.Printf("error while creating debugger deployment: %+v\n", err)
  		return
  	}
  	fmt.Printf("create debugger deployment response: %+v\n", response)
  }
  ```
</CodeGroup>

## Response

<ParamField body="code" type="int32">
  Numeric status code for the operation.
</ParamField>

<ParamField body="success" type="boolean">
  Indicates whether the operation was successful.
</ParamField>

<ParamField body="data" type="AssistantDebuggerDeployment">
  Created debugger deployment.

  <Expandable>
    <ParamField body="id" type="uint64">
      Unique identifier for the debugger deployment.
    </ParamField>

    <ParamField body="assistantId" type="uint64">
      Assistant ID for the deployment.
    </ParamField>

    <ParamField body="greeting" type="string">
      First message for the debugger session.
    </ParamField>

    <ParamField body="greetingInterruptible" type="boolean">
      Controls whether users can interrupt the opening greeting in audio sessions.
    </ParamField>

    <ParamField body="mistake" type="string">
      Message used when the assistant cannot understand or handle input.
    </ParamField>

    <ParamField body="inputAudio" type="DeploymentAudioProvider">
      Speech-to-text provider configuration.
    </ParamField>

    <ParamField body="outputAudio" type="DeploymentAudioProvider">
      Text-to-speech provider configuration.
    </ParamField>

    <ParamField body="status" type="string">
      Current deployment status.
    </ParamField>

    <ParamField body="idealTimeout" type="uint64">
      Idle timeout in seconds.
    </ParamField>

    <ParamField body="idealTimeoutBackoff" type="uint64">
      Number of idle-timeout retries.
    </ParamField>

    <ParamField body="idealTimeoutMessage" type="string">
      Message sent on idle timeout.
    </ParamField>

    <ParamField body="maxSessionDuration" type="uint64">
      Maximum debugger session duration in seconds.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="error" type="Error">
  Error details when the operation fails.

  <Expandable>
    <ResponseField name="errorCode" type="string">
      Stable, machine-readable numeric code.
    </ResponseField>

    <ResponseField name="errorMessage" type="string">
      Developer-oriented message with diagnostic details.
    </ResponseField>

    <ResponseField name="humanMessage" type="string">
      Human-friendly description safe for display to end users.
    </ResponseField>
  </Expandable>
</ParamField>

## Errors

| Code      | Meaning                                                       |
| --------- | ------------------------------------------------------------- |
| `1004001` | Invalid request.                                              |
| `1004002` | Unauthenticated request.                                      |
| `1004003` | Missing authentication scope.                                 |
| `1004004` | Invalid `assistantId`.                                        |
| `1004005` | Unable to create assistant debugger deployment.               |
| `1004006` | Invalid `audioProvider`.                                      |
| `1004007` | `idealTimeout` must be between `15` and `120` seconds.        |
| `1004008` | `idealTimeoutBackoff` must be between `0` and `5` times.      |
| `1004009` | `maxSessionDuration` must be between `180` and `600` seconds. |
