diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6b6073..491db96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,10 @@ jobs: node-version: '18' - name: Install dependencies - run: | - yarn install + run: yarn install - name: Check types - run: | - yarn build + run: ./scripts/lint test: name: test runs-on: ubuntu-latest diff --git a/.stats.yml b/.stats.yml index b51bef1..1890df9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 19 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/toddlzt%2Ftoddlzt-f0177db0b6324f53655f822042aab4713e7fe57f201b7dcfc4473491fd3fe474.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/toddlzt%2Ftoddlzt-0ec4945a61394a51a20257bed7aed1a1ebdcb79d391f6f182512c0643ba8a132.yml diff --git a/scripts/format b/scripts/format new file mode 100755 index 0000000..d297e76 --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running eslint --fix" +./node_modules/.bin/eslint --fix --ext ts,js . diff --git a/scripts/lint b/scripts/lint index 4f05d66..6b0e5dc 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,4 +4,5 @@ set -e cd "$(dirname "$0")/.." +echo "==> Running eslint" ./node_modules/.bin/eslint --ext ts,js . diff --git a/scripts/test b/scripts/test index b62a7cc..2049e31 100755 --- a/scripts/test +++ b/scripts/test @@ -52,6 +52,5 @@ else echo fi -# Run tests echo "==> Running tests" ./node_modules/.bin/jest "$@" diff --git a/src/resources/agent.ts b/src/resources/agent.ts index 6f8ecc3..1b665b9 100644 --- a/src/resources/agent.ts +++ b/src/resources/agent.ts @@ -141,6 +141,12 @@ export interface AgentResponse { */ enable_backchannel?: boolean; + /** + * If users stay silent for a period after agent speech, end the call. The minimum + * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). + */ + end_call_after_silence_ms?: number; + /** * Controls how sensitive the agent is to user interruptions. Value ranging from * [0,1]. Lower value means it will take longer / more words for user to interrupt @@ -342,6 +348,12 @@ export interface AgentCreateParams { */ enable_backchannel?: boolean; + /** + * If users stay silent for a period after agent speech, end the call. The minimum + * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). + */ + end_call_after_silence_ms?: number; + /** * Controls how sensitive the agent is to user interruptions. Value ranging from * [0,1]. Lower value means it will take longer / more words for user to interrupt @@ -528,6 +540,12 @@ export interface AgentUpdateParams { */ enable_backchannel?: boolean; + /** + * If users stay silent for a period after agent speech, end the call. The minimum + * value allowed is 10,000 ms (10 s). By default, this is set to 600000 (10 min). + */ + end_call_after_silence_ms?: number; + /** * Controls how sensitive the agent is to user interruptions. Value ranging from * [0,1]. Lower value means it will take longer / more words for user to interrupt diff --git a/src/resources/call.ts b/src/resources/call.ts index 2053f24..8abd18a 100644 --- a/src/resources/call.ts +++ b/src/resources/call.ts @@ -511,8 +511,9 @@ export interface RegisterCallResponse { 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). + * If users stay silent for a period after agent speech, end the call. The minimum + * value allowed is 10,000 ms (10 s). This value, if set, would overwrite the agent + * level end_call_after_silence_ms parameter. */ end_call_after_silence_ms?: number; @@ -684,8 +685,9 @@ export interface CallRegisterParams { sample_rate: number; /** - * 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). + * If users stay silent for a period after agent speech, end the call. The minimum + * value allowed is 10,000 ms (10 s). This value, if set, would overwrite the agent + * level end_call_after_silence_ms parameter. */ end_call_after_silence_ms?: number; diff --git a/tests/api-resources/agent.test.ts b/tests/api-resources/agent.test.ts index fa5c20c..71be0d2 100644 --- a/tests/api-resources/agent.test.ts +++ b/tests/api-resources/agent.test.ts @@ -33,6 +33,7 @@ describe('resource agent', () => { backchannel_words: ['yeah', 'uh-huh'], boosted_keywords: ['retell', 'kroger'], enable_backchannel: true, + end_call_after_silence_ms: 600000, interruption_sensitivity: 1, language: 'en-US', normalize_for_speech: true,