MCPcopy Create free account
hub / github.com/CopilotKit/OpenGenerativeUI / handlePick

Function handlePick

apps/app/src/app/pick/page.tsx:105–119  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

103 }, [sessionId]);
104
105 const handlePick = async (prompt: string) => {
106 if (!sessionId || picked) return;
107 setPicked(true);
108 try {
109 const res = await fetch("/api/pick", {
110 method: "POST",
111 headers: { "Content-Type": "application/json" },
112 body: JSON.stringify({ sessionId, prompt }),
113 });
114 if (!res.ok) throw new Error("Failed to submit");
115 } catch {
116 setError("Something went wrong. Try again.");
117 setPicked(false);
118 }
119 };
120
121 if (!sessionId) {
122 return (

Callers 1

PickPageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected