Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 24, 2024
1 parent 530ecb2 commit 7439431
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
93 changes: 93 additions & 0 deletions src/resources/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,37 @@ export interface CallResponse {
*/
sample_rate: number;

/**
* Post conversation evaluation of the call. Including information such as
* sentiment, intent, call completion status and other metrics. Available after
* call ends. Subscribe to "call_analyzed" webhook event type to receive it once
* ready.
*/
conversation_eval?: CallResponse.ConversationEval;

/**
* The reason for the disconnection of the call. Debug using explanation in docs
* based on the reason code. Please reachout to Retell team having trouble
* understanding the reason.
*/
disconnection_reason?:
| 'user_hangup'
| 'agent_hangup'
| 'call_transfer'
| 'inactivity'
| 'machine_detected'
| 'concurrency_limit_reached'
| 'error_llm_websocket_open'
| 'error_llm_websocket_lost_connection'
| 'error_llm_websocket_runtime'
| 'error_llm_websocket_corrupt_payload'
| 'error_frontend_corrupted_payload'
| 'error_twilio'
| 'error_no_audio_received'
| 'error_asr'
| 'error_retell'
| 'error_unknown';

/**
* End to end latency (from user stops talking to agent start talking) tracking of
* the call, available after call ends. This latency does not account for the
Expand Down Expand Up @@ -201,9 +232,59 @@ export interface CallResponse {
* Available after call ends.
*/
transcript_object?: Array<CallResponse.TranscriptObject>;

/**
* Transcript of the call weaved with tool call invocation and results. It
* precisely captures when (at what utterance, which word) the tool was invoked and
* what was the result. Available after call ends.
*/
transcript_with_tool_calls?: Array<unknown>;
}

export namespace CallResponse {
/**
* Post conversation evaluation of the call. Including information such as
* sentiment, intent, call completion status and other metrics. Available after
* call ends. Subscribe to "call_analyzed" webhook event type to receive it once
* ready.
*/
export interface ConversationEval {
/**
* Evaluate agent task completion status, whether the agent has completed his task.
*/
agent_task_completion?: 'Completed' | 'Incomplete' | 'Partial';

/**
* Reason for the agent task completion status.
*/
agent_task_completion_reason?: string;

/**
* Sentiment of the agent in the conversation.
*/
agnet_sentiment?: 'Aggressive' | 'Friendly' | 'Neutral';

/**
* Evaluate whether the conversation ended normally or was cut off.
*/
conversation_completion?: 'Completed' | 'Incomplete' | 'Partial';

/**
* Reason for the conversation completion status.
*/
conversation_completion_reason?: string;

/**
* A high level summary of the conversation conversation.
*/
conversation_summary?: string;

/**
* Sentiment of the user in the conversation.
*/
user_sentiment?: 'Frustrated' | 'Positive' | 'Neutral';
}

/**
* End to end latency (from user stops talking to agent start talking) tracking of
* the call, available after call ends. This latency does not account for the
Expand Down Expand Up @@ -439,6 +520,12 @@ export interface RegisterCallResponse {
*/
sample_rate: number;

/**
* If set, will drop the call if machine (voicemail, IVR) is detected. If not set,
* default value of false will apply.
*/
drop_call_if_machine_detected?: boolean;

/**
* If users stay silent for a period, end the call. By default, it is set to
* 600,000 ms (10 min). The minimum value allowed is 10,000 ms (10 s).
Expand Down Expand Up @@ -510,6 +597,12 @@ export interface CallListParams {
*/
limit?: number;

/**
* The pagination call id to continue fetching the next page of calls. If not set,
* will start from the beginning.
*/
pagination_key?: string;

/**
* The calls will be sorted by `start_timestamp`, whether to return the calls in
* ascending or descending order.
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/call.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ describe('resource call', () => {
after_end_timestamp: 1703302428800,
},
limit: 0,
pagination_key: 'string',
sort_order: 'ascending',
},
{ path: '/_stainless_unknown_path' },
Expand Down

0 comments on commit 7439431

Please sign in to comment.