UNPKG

phonic

Version:

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FPhonic-Co%2Fphonic-node) [![npm shield](htt

102 lines (101 loc) 4.34 kB
/** * This file was auto-generated by Fern from our API Definition. */ import * as Phonic from "../index.mjs"; export interface Agent { /** The ID of the agent. */ id: string; /** The name of the agent. */ name: string; /** The phone number that the agent uses to accept calls. `null` if the agent is not associated with a phone number, in which can the agent can be used via WebSockets. This field is deprecated. Use `phone_numbers` instead. */ phone_number: string | null; /** Array of phone numbers that the agent uses to accept phone calls. */ phone_numbers: string[]; /** The project the agent belongs to. */ project: Agent.Project; /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */ timezone: string; /** The voice ID of the agent. */ voice_id: string; /** The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`. */ audio_format: Agent.AudioFormat; /** The audio speed of the agent. Must be a multiple of 0.1. */ audio_speed: number; /** The background noise level of the agent. Must be between 0 and 1. */ background_noise_level: number; /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */ background_noise: Agent.BackgroundNoise | null; /** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */ generate_welcome_message: boolean; /** Message to play when the conversation starts. Ignored when `generate_welcome_message` is `true`. */ welcome_message: string | null; /** Instructions for the conversation. */ system_prompt: string; /** Template variables that the agent can use in the welcome message and the system prompt. */ template_variables: Record<string, Agent.TemplateVariables.Value>; /** List of tools available to the agent. */ tools: Agent.Tools.Item[]; /** Tasks for the agent to complete during the conversation. */ tasks: Phonic.Task[]; /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */ no_input_poke_sec: number | null; /** The message to send after the specified silence. */ no_input_poke_text: string; /** Seconds of silence before ending the conversation. */ no_input_end_conversation_sec: number; /** Array of ISO 639-1 language codes that the agent should be able to recognize */ languages: Phonic.LanguageCode[]; /** These words, or short phrases, will be more accurately recognized by the agent. */ boosted_keywords: string[]; /** When not `null`, the agent will call this endpoint to get configuration options. */ configuration_endpoint: Agent.ConfigurationEndpoint | null; } export declare namespace Agent { /** * The project the agent belongs to. */ interface Project { id: string; name: string; } /** * The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`. */ type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000"; const AudioFormat: { readonly Pcm44100: "pcm_44100"; readonly Pcm16000: "pcm_16000"; readonly Pcm8000: "pcm_8000"; readonly Mulaw8000: "mulaw_8000"; }; /** * The background noise type. Can be "office", "call-center", "coffee-shop", or null. */ type BackgroundNoise = "office" | "call-center" | "coffee-shop"; const BackgroundNoise: { readonly Office: "office"; readonly CallCenter: "call-center"; readonly CoffeeShop: "coffee-shop"; }; namespace TemplateVariables { interface Value { default_value: string | null; } } type Tools = Tools.Item[]; namespace Tools { type Item = "keypad_input" | "natural_conversation_ending" /** * Custom tool */ | string; } /** * When not `null`, the agent will call this endpoint to get configuration options. */ interface ConfigurationEndpoint { url: string; headers: Record<string, string>; /** The timeout for the configuration endpoint in milliseconds. */ timeout_ms: number; } }