36 | Enter your OpenAI key
37 |
38 | Get your OpenAI key from{" "}
39 |
44 | https://openai.com/product
45 | {" "}
46 | and paste it below. It will be stored locally on your computer; we will
47 | never store it on our servers.
48 |
49 | Note: Once GPT-4 Vision is out of preview, your vision requests are on
50 | us based on your current plan.
51 |
52 |
53 | setOpenAIKey(e.target.value)}
56 | placeholder="Pasted your OpenAI key here"
57 | />
58 |
59 | Set OpenAI Key
60 |
61 |
62 |
63 | );
64 | };
65 |
66 | export default Setup;
67 |
--------------------------------------------------------------------------------
/client/extension/src/lib/ui/pages/workflows.tsx:
--------------------------------------------------------------------------------
1 | import React, { useEffect, useState } from "react";
2 |
3 | import { sendMessage } from "../utils/message";
4 | import { ActionType } from "../utils/types";
5 | import { useStore } from "../store";
6 | import { Page } from "../store/pageSlice";
7 | import * as S from "../styles/workflows";
8 | import Workflow from "../components/Workflow";
9 |
10 | const Workflows = () => {
11 | const { setActivePage } = useStore();
12 | const [workflowsLoading, setWorkflowsLoading] = useState(true);
13 | const [workflows, setWorkflows] = useState([]);
14 |
15 | useEffect(() => {
16 | async function fetchWorkflows() {
17 | try {
18 | const response = await sendMessage({
19 | actionType: ActionType.GET_WORKFLOWS,
20 | });
21 | setWorkflows(response.payload);
22 | setWorkflowsLoading(false);
23 | if (response.payload.length === 0) {
24 | setActivePage(Page.CreateWorkflow);
25 | }
26 | } catch (error) {
27 | console.error("Error fetching workflows:", error);
28 | }
29 | }
30 |
31 | fetchWorkflows();
32 | }, []);
33 |
34 | if (workflows.length === 0 && !workflowsLoading) {
35 | setActivePage(Page.CreateWorkflow);
36 | }
37 |
38 | return (
39 |