Skip to content

Commit

Permalink
Rework field description
Browse files Browse the repository at this point in the history
  • Loading branch information
PopDaph committed Dec 20, 2023
1 parent 4a3bfdd commit f6f612e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { SendNotificationsContext } from "@app/components/sparkle/Notification";
import { getDataSource } from "@app/lib/api/data_sources";
import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth";
import { handleFileUploadToText } from "@app/lib/client/handle_file_upload";
import { classNames } from "@app/lib/utils";

const { GA_TRACKING_ID = "" } = process.env;

Expand Down Expand Up @@ -71,7 +72,7 @@ export const getServerSideProps: GetServerSideProps<{
};
};

export default function DataSourceUpsert({
export default function DatabaseUpsert({
user,
owner,
subscription,
Expand Down Expand Up @@ -242,12 +243,12 @@ export default function DataSourceUpsert({
<div className="pt-4">
<Page.SectionHeader
title="Database name"
description="The name of your database."
description="Enter the database name. This identifier will be used in the Assistant builder to choose the specific database for querying."
/>
<div className="pt-4">
<Input
placeholder="name-of-database"
name="document"
placeholder="name_of_database"
name="database-name"
disabled={readOnly || !!loadDatabaseId}
value={databaseName}
onChange={(v) => setDatabaseName(v)}
Expand All @@ -264,12 +265,12 @@ export default function DataSourceUpsert({
<div className="pt-4">
<Page.SectionHeader
title="Table Name"
description="This is the name of the table inside your database. One table is the equivalent of one CSV file. For now we only support one table per database but we plan to allow for muliple ones attached to the same database."
description="We will generate a table by extracting data from your CSV file and name it accordingly."
/>
<div className="pt-4">
<Input
placeholder="name-of-table"
name="document"
placeholder="name_of_table"
name="table-name"
disabled={readOnly || !!loadDatabaseId}
value={tableName}
onChange={(v) => setTableName(v)}
Expand All @@ -286,15 +287,23 @@ export default function DataSourceUpsert({
<div className="pt-4">
<Page.SectionHeader
title="Table Description"
description="This is the description of the content of your CSV file. It will be used to generate relevant queries."
description="Describe the content of your CSV file. It will be used by the LLM model to generate relevant queries."
/>
<div className="pt-4">
<Input
placeholder="This database contains the list of all the company 2024 OKRs with appetite, status and owners."
name="document"
<textarea
name="table-description"
placeholder="This table contains..."
rows={10}
disabled={readOnly || !!loadDatabaseId}
value={tableDescription}
onChange={(v) => setTableDescription(v)}
onChange={(e) => setTableDescription(e.target.value)}
className={classNames(
"font-mono text-normal block w-full min-w-0 flex-1 rounded-md",
"border-structure-200 bg-structure-50",
readOnly
? "focus:border-gray-300 focus:ring-0"
: "focus:border-action-300 focus:ring-action-300"
)}
/>
</div>
</div>
Expand All @@ -304,7 +313,7 @@ export default function DataSourceUpsert({
<>
<Page.SectionHeader
title="CSV File"
description={`Upload a CSV file to create a new database.`}
description="Select the CSV file for data extraction. The maximum file size allowed is 5MB."
action={{
label: uploading
? "Uploading..."
Expand Down
2 changes: 1 addition & 1 deletion front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const getServerSideProps: GetServerSideProps<{
};
};

export default function DataSourceUpsert({
export default function DatasourceUpsert({
user,
owner,
subscription,
Expand Down
4 changes: 2 additions & 2 deletions types/src/front/lib/actions/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ export const DustProdActionRegistry = createActionRegistry({
workspaceId: PRODUCTION_DUST_APPS_WORKSPACE_ID,
appId: "e0c5993d65",
appHash:
"f4895d867ca82023fb5933e6279e2e315164a386145fd971dc9e7293c9fc4cce",
"80aa115754ae0d4e968609d4fea47ed4de7dbbc013bfacc0a48eb93129583388",
},
config: {
MODEL: {
provider_id: "openai",
model_id: "gpt-4",
use_cache: false,
function_call: "return_sql_query",
function_call: "execute_sql_query",
},
},
},
Expand Down

0 comments on commit f6f612e

Please sign in to comment.