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

100 lines (99 loc) 4.77 kB
/** * This file was auto-generated by Fern from our API Definition. */ import * as Phonic from "../index.mjs"; export interface CreateAgentRequest { /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */ name: string; phone_number: CreateAgentRequest.PhoneNumber | null; /** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */ custom_phone_number?: string | null; /** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */ custom_phone_numbers?: string[]; /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */ timezone?: string; /** The voice ID to use. */ voice_id?: string; /** The audio format of the agent. */ audio_format?: CreateAgentRequest.AudioFormat; /** The audio speed of the agent. */ audio_speed?: number; /** The background noise level of the agent. */ background_noise_level?: number; /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */ background_noise?: CreateAgentRequest.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. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */ welcome_message?: string; /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */ system_prompt?: string; /** Variables that can be used in the welcome message and the system prompt. */ template_variables?: Record<string, CreateAgentRequest.TemplateVariables.Value>; /** Array of built-in or custom tool names to use. */ tools?: CreateAgentRequest.Tools.Item[]; /** Array of task objects with `name` and `description` fields. */ 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`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */ configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint | null; } export declare namespace CreateAgentRequest { type PhoneNumber = "assign-automatically" | "custom"; const PhoneNumber: { readonly AssignAutomatically: "assign-automatically"; readonly Custom: "custom"; }; /** * The audio format of the agent. */ 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; is_boosted_keyword?: boolean; } } type Tools = Tools.Item[]; namespace Tools { type Item = "keypad_input" | "natural_conversation_ending" /** * Custom tool */ | string; } /** * When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */ interface ConfigurationEndpoint { /** URL to call */ url: string; /** Object of key-value pairs. */ headers?: Record<string, string>; /** Timeout in milliseconds for the endpoint call. */ timeout_ms?: number; } }