From ac51767cba1a4694980ee26272b09194ddefb0a7 Mon Sep 17 00:00:00 2001 From: srichman333 Date: Mon, 4 Dec 2023 16:49:47 -0500 Subject: small dataviz ui tweaks --- src/client/apis/gpt/GPT.ts | 33 +--------------------- src/client/views/nodes/DataVizBox/DataVizBox.tsx | 15 ++++------ .../views/nodes/DataVizBox/SchemaCSVPopUp.tsx | 4 ++- .../views/nodes/DataVizBox/components/Chart.scss | 4 +-- 4 files changed, 12 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts index d1606e7f0..6bde7989b 100644 --- a/src/client/apis/gpt/GPT.ts +++ b/src/client/apis/gpt/GPT.ts @@ -1,5 +1,3 @@ -import { config } from "dotenv"; -config(); import { Configuration, OpenAIApi } from 'openai'; enum GPTCallType { @@ -67,33 +65,4 @@ const gptImageCall = async (prompt: string, n?: number) => { } }; -const gptCSVCall = async (inputText: string, callType: GPTCallType) => { - const opts: GPTCallOpts = callTypeMap[callType]; - try { - const configuration = new Configuration({ - apiKey: process.env.OPENAI_KEY, - }); - const openai = new OpenAIApi(configuration); - // const client = OpenAIApi; - // const response = await openai.createCompletion({ - // model: opts.model, - // max_tokens: opts.maxTokens, - // temperature: opts.temp, - // prompt: `${opts.prompt}${inputText}`, - // }); - // return response.data.choices[0].text; - - const responseGpt = await openai.createChatCompletion({ - model: "gpt-3.5-turbo-16k", - messages: [{role: "user", content: inputText}], - }) - const generatedResponse = responseGpt.data.choices[0].message?.content; - console.log(generatedResponse); - return generatedResponse; - } catch (err) { - console.log(err); - return 'Error connecting with API.'; - } -}; - -export { gptAPICall, gptImageCall, gptCSVCall, GPTCallType }; +export { gptAPICall, gptImageCall, GPTCallType }; diff --git a/src/client/views/nodes/DataVizBox/DataVizBox.tsx b/src/client/views/nodes/DataVizBox/DataVizBox.tsx index cfa420473..32ed57861 100644 --- a/src/client/views/nodes/DataVizBox/DataVizBox.tsx +++ b/src/client/views/nodes/DataVizBox/DataVizBox.tsx @@ -353,9 +353,7 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { this.props.addDocument?.(newDoc); } DocUtils.MakeLink(anchor, newDoc, { link_relationship: 'GPT Data Prompt' }); - } - - + } } render() { @@ -386,15 +384,15 @@ export class DataVizBox extends ViewBoxAnnotatableComponent() { (this.layoutDoc._dataViz = DataVizView.PIECHART)} toggleStatus={this.layoutDoc._dataViz == -DataVizView.PIECHART} /> - () { removeDocument={this.removeDocument} moveDocument={this.moveDocument} addDocument={this.addDocument}> - {this.renderVizView} + */} - - + {this.renderVizView}
{ heading = (headingText: string) => (
+ } onClick={() => this.setVisible(false)} />
); diff --git a/src/client/views/nodes/DataVizBox/components/Chart.scss b/src/client/views/nodes/DataVizBox/components/Chart.scss index cc1923b98..bef3cced5 100644 --- a/src/client/views/nodes/DataVizBox/components/Chart.scss +++ b/src/client/views/nodes/DataVizBox/components/Chart.scss @@ -15,8 +15,8 @@ font-size: larger; display: flex; flex-direction: row; - margin-top: -10px; - margin-bottom: -10px; + margin-top: -20px; + margin-bottom: -20px; } .asHistogram-checkBox { // display: flex; -- cgit v1.2.3-70-g09d2