forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWaitForUserInput.tsx
More file actions
34 lines (30 loc) · 910 Bytes
/
Copy pathWaitForUserInput.tsx
File metadata and controls
34 lines (30 loc) · 910 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
"use client";
import { useCopilotAction } from "@copilotkit/react-core";
import { CopilotPopup } from "@copilotkit/react-ui";
export function WaitForUserInput() {
useCopilotAction({
name: "AskHuman",
available: "remote",
parameters: [
{
name: "question",
},
],
handler: async ({ question }) => {
return window.prompt(question);
},
});
return (
<div className="flex flex-col items-center justify-center h-screen">
<div className="text-2xl">LangGraph Wait For User Input Example</div>
<div className="text-xs">
(https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/wait-user-input/#agent)
</div>
<div>
Use the search tool to ask the user where they are, then look up the
weather there
</div>
<CopilotPopup defaultOpen={true} clickOutsideToClose={false} />
</div>
);
}