From 8613c2ae358746c4ee397e770b21ccc145ab9906 Mon Sep 17 00:00:00 2001 From: Victor Algaze Date: Tue, 6 Feb 2024 20:00:27 -0800 Subject: [PATCH] add custom runtime note and typo fix --- docs/examples/voiceflow-kb/README.md | 6 ++++++ docs/examples/voiceflow/README.md | 6 ++++++ examples/voiceflow-kb/README.md | 2 ++ examples/voiceflow-kb/settings/voiceflow.ts | 10 +++++----- examples/voiceflow/README.md | 2 ++ examples/voiceflow/settings/voiceflow.ts | 10 +++++----- 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/docs/examples/voiceflow-kb/README.md b/docs/examples/voiceflow-kb/README.md index a61cf75..e350777 100644 --- a/docs/examples/voiceflow-kb/README.md +++ b/docs/examples/voiceflow-kb/README.md @@ -99,6 +99,12 @@ BOT_TOKEN=NmFjNODY3MTgtNWIx_PF84_1eb65fdfm1Gak5PRFkzTVRndE5XSXhfUEY4NF8xZWI2NWZk VOICEFLOW_KEY=VF.DM.12345cbc8ef.sjaPjTtrgn ``` +::: details Custom runtime? + +Custom runtime: If you have a custom runtime/endpoint (ie the URL you see in the integration tab sample is something other than https://general-runtime.voiceflow.com), you can swap the `BASE_URL` value in **[settings/voiceflow.ts](https://github.com/valgaze/speedybot/blob/v2/examples/voiceflow-kb/settings/voiceflow.ts#L7)** + +::: + ## 6) Boot it up! Start up your agent with the following command: diff --git a/docs/examples/voiceflow/README.md b/docs/examples/voiceflow/README.md index 6afa5af..fa023d3 100644 --- a/docs/examples/voiceflow/README.md +++ b/docs/examples/voiceflow/README.md @@ -101,6 +101,12 @@ BOT_TOKEN=NmFjNODY3MTgtNWIx_PF84_1eb65fdfm1Gak5PRFkzTVRndE5XSXhfUEY4NF8xZWI2NWZk VOICEFLOW_KEY=VF.DM.12345cbc8ef.sjaPjTtrgn ``` +::: details Custom runtime? + +Custom runtime: If you have a custom runtime/endpoint (ie the URL you see in the integration tab sample is something other than https://general-runtime.voiceflow.com), you can swap the `BASE_URL` value in **[settings/voiceflow.ts](https://github.com/valgaze/speedybot/blob/v2/examples/voiceflow-kb/settings/voiceflow.ts#L7)** + +::: + ## 6) Boot it up! Start up your agent with the following command: diff --git a/examples/voiceflow-kb/README.md b/examples/voiceflow-kb/README.md index c7f0400..78d0c44 100644 --- a/examples/voiceflow-kb/README.md +++ b/examples/voiceflow-kb/README.md @@ -99,6 +99,8 @@ BOT_TOKEN=NmFjNODY3MTgtNWIx_PF84_1eb65fdfm1Gak5PRFkzTVRndE5XSXhfUEY4NF8xZWI2NWZk VOICEFLOW_KEY=VF.DM.12345cbc8ef.sjaPjTtrgn ``` +**Custom runtime:** If you have a custom runtime/endpoint (ie the URL you see in the integration tab is something other than https://general-runtime.voiceflow.com), you can swap the `BASE_URL` value in **[settings/voiceflow.ts](https://github.com/valgaze/speedybot/blob/v2/examples/voiceflow-kb/settings/voiceflow.ts#L7)** + ## 6) Boot it up! Start up your agent with the following command: diff --git a/examples/voiceflow-kb/settings/voiceflow.ts b/examples/voiceflow-kb/settings/voiceflow.ts index e650842..8378f07 100644 --- a/examples/voiceflow-kb/settings/voiceflow.ts +++ b/examples/voiceflow-kb/settings/voiceflow.ts @@ -4,7 +4,7 @@ import { $Magic } from "speedybot"; // https://www.voiceflow.com/api/dialog-manager export class VFHelper { - private BASE_URL = "https://general-runtime.voiceflow.com"; + private BASE_URL = "https://general-runtime.voiceflow.com"; // <<-- Change this if using a private instance public static submitLabel = "VF_TAP_BUTTON"; public static fallbackText = "Sorry, it appears your client does not support Adaptive Cards"; @@ -518,10 +518,10 @@ export class VFHelper { }, method, }; - const response = await fetch( - `https://general-runtime.voiceflow.com/state/user/${sessionId}`, - { ...config, ...(payload && { body: JSON.stringify(payload) }) } - ); + const response = await fetch(`${this.BASE_URL}/state/user/${sessionId}`, { + ...config, + ...(payload && { body: JSON.stringify(payload) }), + }); const data = await response.json(); return data; } catch (err) { diff --git a/examples/voiceflow/README.md b/examples/voiceflow/README.md index b2bce9e..6cd5cce 100644 --- a/examples/voiceflow/README.md +++ b/examples/voiceflow/README.md @@ -101,6 +101,8 @@ BOT_TOKEN=NmFjNODY3MTgtNWIx_PF84_1eb65fdfm1Gak5PRFkzTVRndE5XSXhfUEY4NF8xZWI2NWZk VOICEFLOW_KEY=VF.DM.12345cbc8ef.sjaPjTtrgn ``` +**Custom runtime:** If you have a custom runtime/endpoint (ie the URL you see in the integration tab is something other than https://general-runtime.voiceflow.com), you can swap the `BASE_URL` value in **[settings/voiceflow.ts](https://github.com/valgaze/speedybot/blob/v2/examples/voiceflow/settings/voiceflow.ts#L7)** + ## 6) Boot it up! Start up your agent with the following command: diff --git a/examples/voiceflow/settings/voiceflow.ts b/examples/voiceflow/settings/voiceflow.ts index e650842..8378f07 100644 --- a/examples/voiceflow/settings/voiceflow.ts +++ b/examples/voiceflow/settings/voiceflow.ts @@ -4,7 +4,7 @@ import { $Magic } from "speedybot"; // https://www.voiceflow.com/api/dialog-manager export class VFHelper { - private BASE_URL = "https://general-runtime.voiceflow.com"; + private BASE_URL = "https://general-runtime.voiceflow.com"; // <<-- Change this if using a private instance public static submitLabel = "VF_TAP_BUTTON"; public static fallbackText = "Sorry, it appears your client does not support Adaptive Cards"; @@ -518,10 +518,10 @@ export class VFHelper { }, method, }; - const response = await fetch( - `https://general-runtime.voiceflow.com/state/user/${sessionId}`, - { ...config, ...(payload && { body: JSON.stringify(payload) }) } - ); + const response = await fetch(`${this.BASE_URL}/state/user/${sessionId}`, { + ...config, + ...(payload && { body: JSON.stringify(payload) }), + }); const data = await response.json(); return data; } catch (err) {