-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
376 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// import { createClient } from "@supabase/supabase-js"; | ||
|
||
// interface Client { | ||
// url?: string; | ||
// key?: string; | ||
// } | ||
|
||
// const client: Client = { | ||
// url: process.env.NEXT_PUBLIC_SUPABASE_URL, | ||
// key: process.env.SUPABASE_ANON_KEY | ||
// }; | ||
|
||
// if (!client.url || !client.key) { | ||
// throw new Error("Missing Supabase credentials"); | ||
// } | ||
|
||
// export const supabaseClient = createClient(client.url!, client.key!); | ||
|
||
// import { NextPage } from "next"; | ||
// import { useState } from "react"; | ||
|
||
|
||
// const Embeddings: NextPage = () => { | ||
// const [urls, setUrls] = useState<string[]>([]); | ||
// const [loading, setLoading] = useState(false); | ||
|
||
// const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => { | ||
// e.preventDefault(); | ||
// setLoading(true); | ||
|
||
// const response = await fetch("/api/generate-embeddings", { | ||
// method: "POST", | ||
// headers: { "Content-Type": "application/json" }, | ||
// body: JSON.stringify({ urls }) | ||
// }); | ||
|
||
// setLoading(false); | ||
|
||
// if (!response.ok) { | ||
// // Handle error | ||
// } | ||
// }; | ||
|
||
// return ( | ||
// <div className="flex flex-col items-center max-w-xl m-auto text-center"> | ||
// <h1 className="w-full my-5 text-2xl font-bold sm:text-4xl "> | ||
// Generate embeddings | ||
// </h1> | ||
// <p className="mb-4"> | ||
// Paste a list of URLs below to geneate embeddings using the OpenAI API, and add the embeddings to the Supabase embeddings table. | ||
// </p> | ||
// <form onSubmit={handleSubmit}> | ||
// <textarea | ||
// className="w-full h-[150px] textarea textarea-bordered" | ||
// placeholder="Enter URLs here" | ||
// value={urls.join("\n")} | ||
// onChange={(e) => setUrls(e.target.value.split("\n"))} | ||
// /> | ||
// <button | ||
// className="my-4 btn btn-primary" | ||
// type="submit" | ||
// disabled={loading} | ||
// > | ||
// Generate Embeddings | ||
// </button> | ||
// </form> | ||
// {loading && <div>Loading...</div>} | ||
// </div> | ||
// ); | ||
// }; | ||
|
||
// export default Embeddings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.