Skip to content

Commit 57c25de

Browse files
confirmdetails button fix
1 parent cb2c76c commit 57c25de

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

assistants/assistant.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const assistant: CreateAssistantDTO | any = {
1515
functions: [
1616
{
1717
name: "suggestShows",
18+
async: true,
1819
description: "Suggests a list of broadway shows to the user.",
1920
parameters: {
2021
type: "object",

components/app/ticket.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { shows } from "@/data/shows";
2+
import { vapi } from "../../lib/vapi.sdk";
3+
import { MessageTypeEnum } from "../../lib/types/conversation.type";
24

35
interface TicketProps {
46
type: "confirm" | "ticket";
@@ -11,6 +13,15 @@ function Ticket({
1113
show = shows[0],
1214
params = {},
1315
}: TicketProps) {
16+
const confirmDetails = () => {
17+
vapi.send({
18+
type: MessageTypeEnum.ADD_MESSAGE,
19+
message: {
20+
role: "user",
21+
content: `Looks good to me. Lets go ahead.`,
22+
},
23+
});
24+
};
1425
return (
1526
<div className={`bg-slate-100 rounded-xl`}>
1627
<div className="container mx-auto px-4 py-8">
@@ -49,6 +60,7 @@ function Ticket({
4960
</div>
5061
{type == "confirm" ? (
5162
<button
63+
onClick={confirmDetails}
5264
className="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline"
5365
type="button"
5466
>

0 commit comments

Comments
 (0)