Skip to content

Commit

Permalink
add custom runtime note and typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
valgaze committed Feb 7, 2024
1 parent 22942ff commit 8613c2a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 10 deletions.
6 changes: 6 additions & 0 deletions docs/examples/voiceflow-kb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions docs/examples/voiceflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions examples/voiceflow-kb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions examples/voiceflow-kb/settings/voiceflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions examples/voiceflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions examples/voiceflow/settings/voiceflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8613c2a

Please sign in to comment.