-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
36 lines (34 loc) · 732 Bytes
/
test.ts
File metadata and controls
36 lines (34 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {
EDialogueActor,
IConversation,
} from "@bavard/agent-config/dist/conversations";
import { EUserActionType } from "@bavard/agent-config/dist/enums";
import axios from "axios";
const conversation: IConversation = {
currentAgentType: "BOT",
turns: [
{
actor: EDialogueActor.USER,
timestamp: Date.now(),
userAction: {
type: EUserActionType.UTTERANCE_ACTION,
utterance: "Open the pod bay doors.",
},
},
],
};
axios
.post(
"http://localhost:3000/my-webhook-action",
{
conversation,
},
{
headers: {
Authorization: "Basic super-secret",
},
}
)
.then((res) => {
console.log(JSON.stringify(res.data, null, 2));
});