Skip to content

Commit

Permalink
move /ds to /builder/data-sources
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanierh committed Sep 6, 2023
1 parent d49ceec commit 9b3a4b7
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 37 deletions.
12 changes: 6 additions & 6 deletions docs/src/pages/guide-document-qa.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ We will use a Data Source to automatically chunk, embed and index 4 IPCC reports
<Note>
You can review this section without the need to actually create the data
source, and use the pre-filled public Data Source
[ipcc-ar6](https://dust.tt/w/3e26b0e764/ds/ipcc-ar6) in the rest of the guide.
[ipcc-ar6](https://dust.tt/w/3e26b0e764/builder/data-sources/ipcc-ar6) in the rest of the guide.
</Note>

You can create your first Data Source from your Dust home page by selecting the **Data Sources** tab
Expand Down Expand Up @@ -81,7 +81,7 @@ if it already existed for the provided identifier.
</Image>

Once the 4 documents are inserted, you should be able to see them in the Data Source interface. You
can review the public [ipcc-ar6](https://dust.tt/w/3e26b0e764/ds/ipcc-ar6) Data Source as an
can review the public [ipcc-ar6](https://dust.tt/w/3e26b0e764/builder/data-sources/ipcc-ar6) Data Source as an
example.

<Image
Expand All @@ -94,14 +94,14 @@ example.
</Image>

Now that your Data Source is ready (or you plan to use
[ipcc-ar6](https://dust.tt/w/3e26b0e764/ds/ipcc-ar6)), you can move on to the next section to create
[ipcc-ar6](https://dust.tt/w/3e26b0e764/builder/data-sources/ipcc-ar6)), you can move on to the next section to create
a Q&A app that will use it.

## Creating a Q&A app

In this section we'll provide step-by-step instructions to create a Q&A app that will use the data
source to answer user-provided questions. You can find a finalized version of the app
[here](https://dust.tt/w/3e26b0e764/ds/ipcc-ar6).
[here](https://dust.tt/w/3e26b0e764/builder/data-sources/ipcc-ar6).

### `input` block

Expand All @@ -123,7 +123,7 @@ Data Source:

Once the `input` block points to your new dataset you can add a `data_source` block and select your
Data Source. If you want to use the publicly available Data Source
[ipcc-ar6](https://dust.tt/w/3e26b0e764/ds/ipcc-ar6), edit the user name to `spolu` and then select
[ipcc-ar6](https://dust.tt/w/3e26b0e764/builder/data-sources/ipcc-ar6), edit the user name to `spolu` and then select
`ipcc-ar6`. You should set `top_k` to 12, meaning that we'll consume 3072 tokens of context to
present chunks to the model.

Expand All @@ -146,7 +146,7 @@ At this point you can run your app and introspect the outputs of the `data_sourc
We will use `gpt-3.5-turbo` to process the chunks and generate an answer to the user.

We use the following instruction in the context of
[ipcc-ar6](https://dust.tt/w/3e26b0e764/ds/ipcc-ar6):
[ipcc-ar6](https://dust.tt/w/3e26b0e764/builder/data-sources/ipcc-ar6):

```txt
You are an helpful assistant. For each user question, you'll receive 12 additional system
Expand Down
6 changes: 3 additions & 3 deletions front/components/data_source/DataSourcePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function DataSourcePicker({
<div className="flex items-center">
{readOnly ? (
name ? (
<Link href={`/${owner.sId}/ds/${name}`}>
<Link href={`/${owner.sId}/builder/data-sources/${name}`}>
<div className="text-sm font-bold text-action-500">{name}</div>
</Link>
) : (
Expand All @@ -91,7 +91,7 @@ export default function DataSourcePicker({
>
{name && name.length > 0 ? (
<>
<Link href={`/w/${owner.sId}/ds/${name}`}>
<Link href={`/w/${owner.sId}/builder/data-sources/${name}`}>
<div className="mr-1 text-sm font-bold text-action-500">
{name}
</div>
Expand All @@ -102,7 +102,7 @@ export default function DataSourcePicker({
"Select DataSource"
) : (
<Link
href={`/w/${owner.sId}/ds`}
href={`/w/${owner.sId}/builder/data-sources`}
className={classNames(
readOnly
? "border-white text-gray-300"
Expand Down
4 changes: 2 additions & 2 deletions front/components/sparkle/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const topNavigation = ({
label: "Settings",
hideLabel: true,
icon: Cog6ToothIcon,
href: `/w/${owner.sId}/ds`,
href: `/w/${owner.sId}/builder/data-sources`,
current: current === "settings",
});
}
Expand All @@ -110,7 +110,7 @@ export const subNavigationAdmin = ({
id: "data_sources",
label: "Data Sources",
icon: CloudArrowDownIcon,
href: `/w/${owner.sId}/ds`,
href: `/w/${owner.sId}/builder/data-sources`,
current: current === "data_sources",
subMenuLabel: current === "data_sources" ? subMenuLabel : undefined,
subMenu: current === "data_sources" ? subMenu : undefined,
Expand Down
14 changes: 7 additions & 7 deletions front/pages/w/[wId]/builder/data-sources/[name]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { classNames, timeAgoFrom } from "@app/lib/utils";
import { DataSourceType } from "@app/types/data_source";
import { UserType, WorkspaceType } from "@app/types/user";

import { DATA_SOURCE_INTEGRATIONS } from "../data-sources";
import { DATA_SOURCE_INTEGRATIONS } from "..";

const {
GA_TRACKING_ID = "",
Expand Down Expand Up @@ -195,7 +195,7 @@ function StandardDataSourceView({
icon: Cog6ToothIcon,
onClick: () => {
void router.push(
`/w/${owner.sId}/ds/${dataSource.name}/settings`
`/w/${owner.sId}/builder/data-sources/${dataSource.name}/settings`
);
},
}
Expand Down Expand Up @@ -264,7 +264,7 @@ function StandardDataSourceView({
return;
} else {
void router.push(
`/w/${owner.sId}/ds/${dataSource.name}/upsert`
`/w/${owner.sId}/builder/data-sources/${dataSource.name}/upsert`
);
}
}}
Expand All @@ -282,7 +282,7 @@ function StandardDataSourceView({
className="group rounded border border-gray-300 px-2 px-4"
>
<Link
href={`/w/${owner.sId}/ds/${
href={`/w/${owner.sId}/builder/data-sources/${
dataSource.name
}/upsert?documentId=${encodeURIComponent(d.document_id)}`}
className="block"
Expand Down Expand Up @@ -410,7 +410,7 @@ function ManagedDataSourceView({
// To prevent it from reopening on page refresh,
// we remove the flag from the URL and then display the modal.
router
.push(`/w/${owner.sId}/ds/${dataSource.name}`)
.push(`/w/${owner.sId}/builder/data-sources/${dataSource.name}`)
.then(() => {
setShowPermissionModal(true);
})
Expand Down Expand Up @@ -537,7 +537,7 @@ function ManagedDataSourceView({
icon: Cog6ToothIcon,
onClick: () => {
void router.push(
`/w/${owner.sId}/ds/${dataSource.name}/settings`
`/w/${owner.sId}/builder/data-sources/${dataSource.name}/settings`
);
},
}
Expand All @@ -551,7 +551,7 @@ function ManagedDataSourceView({
type="secondary"
onClick={() => {
void router.push(
`/w/${owner.sId}/ds/${dataSource.name}/search`
`/w/${owner.sId}/builder/data-sources/${dataSource.name}/search`
);
}}
/>
Expand Down
6 changes: 4 additions & 2 deletions front/pages/w/[wId]/builder/data-sources/[name]/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ export default function DataSourceView({
<AppLayoutSimpleCloseTitle
title="Search documents"
onClose={() => {
void router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
}}
/>
}
Expand Down Expand Up @@ -197,7 +199,7 @@ export default function DataSourceView({
</div>
) : null}
<Link
href={`/w/${owner.sId}/ds/${
href={`/w/${owner.sId}/builder/data-sources/${
dataSource.name
}/upsert?documentId=${encodeURIComponent(
d.document_id
Expand Down
18 changes: 13 additions & 5 deletions front/pages/w/[wId]/builder/data-sources/[name]/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ export default function DataSourceSettings({
}
);
if (res.ok) {
await router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
await router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
} else {
setIsUpdating(false);
const err = (await res.json()) as { error: APIError };
Expand All @@ -133,7 +135,9 @@ export default function DataSourceSettings({
<AppLayoutSimpleCloseTitle
title="Data Source Settings"
onClose={() => {
void router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
}}
/>
}
Expand Down Expand Up @@ -204,7 +208,7 @@ function StandardDataSourceSettings({
);
if (res.ok) {
await mutate(`/api/w/${owner.sId}/data_sources`);
await router.push(`/w/${owner.sId}/ds`);
await router.push(`/w/${owner.sId}/builder/data-sources`);
} else {
setIsDeleting(false);
const err = (await res.json()) as { error: APIError };
Expand Down Expand Up @@ -367,7 +371,9 @@ function StandardDataSourceSettings({
<Button
type="tertiary"
onClick={() => {
void router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
}}
disabled={isDeleting || isUpdating}
label={"Cancel"}
Expand Down Expand Up @@ -447,7 +453,9 @@ function ManagedDataSourceSettings({
<Button
type="tertiary"
onClick={() => {
void router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
}}
disabled={isUpdating}
label={"Cancel"}
Expand Down
12 changes: 9 additions & 3 deletions front/pages/w/[wId]/builder/data-sources/[name]/upsert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ export default function DataSourceUpsert({
);

if (res.ok) {
await router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
await router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
} else {
const data = await res.json();
console.log("UPSERT Error", data.error);
Expand Down Expand Up @@ -220,7 +222,9 @@ export default function DataSourceUpsert({
<AppLayoutSimpleCloseTitle
title="Upsert document"
onClose={() => {
void router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
}}
/>
}
Expand Down Expand Up @@ -398,7 +402,9 @@ export default function DataSourceUpsert({
type="tertiary"
disabled={loading || readOnly}
onClick={async () => {
void router.push(`/w/${owner.sId}/ds/${dataSource.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${dataSource.name}`
);
}}
label="Cancel"
/>
Expand Down
16 changes: 10 additions & 6 deletions front/pages/w/[wId]/builder/data-sources/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export default function DataSourcesView({
);
if (provider === "google_drive") {
void router.push(
`/w/${owner.sId}/ds/${createdManagedDataSource.dataSource.name}?edit_permissions=true`
`/w/${owner.sId}/builder/data-sources/${createdManagedDataSource.dataSource.name}?edit_permissions=true`
);
}
} else {
Expand Down Expand Up @@ -418,7 +418,7 @@ export default function DataSourcesView({
<div className="flex flex-col sm:flex-row sm:items-center">
{ds.connector ? (
<Link
href={`/w/${owner.sId}/ds/${ds.dataSourceName}`}
href={`/w/${owner.sId}/builder/data-sources/${ds.dataSourceName}`}
className="flex"
>
<span
Expand Down Expand Up @@ -525,7 +525,7 @@ export default function DataSourcesView({
}
onClick={() => {
void router.push(
`/w/${owner.sId}/ds/${ds.dataSourceName}`
`/w/${owner.sId}/builder/data-sources/${ds.dataSourceName}`
);
}}
label={isAdmin ? "Manage" : "View"}
Expand Down Expand Up @@ -563,7 +563,9 @@ export default function DataSourcesView({
);
return;
} else {
void router.push(`/w/${owner.sId}/ds/new`);
void router.push(
`/w/${owner.sId}/builder/data-sources/new`
);
}
},
}
Expand All @@ -582,7 +584,7 @@ export default function DataSourcesView({
</div>
<div className="fexl flex-col">
<Link
href={`/w/${owner.sId}/ds/${ds.name}`}
href={`/w/${owner.sId}/builder/data-sources/${ds.name}`}
className="flex"
>
<p className="truncate text-sm font-bold text-element-900">
Expand All @@ -601,7 +603,9 @@ export default function DataSourcesView({
type="secondary"
icon={Cog6ToothIcon}
onClick={() => {
void router.push(`/w/${owner.sId}/ds/${ds.name}`);
void router.push(
`/w/${owner.sId}/builder/data-sources/${ds.name}`
);
}}
label="Manage"
/>
Expand Down
4 changes: 2 additions & 2 deletions front/pages/w/[wId]/builder/data-sources/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function DataSourceNew({
}),
});
if (res.ok) {
await router.push(`/w/${owner.sId}/ds`);
await router.push(`/w/${owner.sId}/builder/data-sources`);
} else {
const err = (await res.json()) as { error: APIError };
setCreating(false);
Expand Down Expand Up @@ -237,7 +237,7 @@ export default function DataSourceNew({
type="tertiary"
disabled={creating}
onClick={async () => {
void router.push(`/w/${owner.sId}/ds`);
void router.push(`/w/${owner.sId}/builder/data-sources`);
}}
label="Cancel"
/>
Expand Down
4 changes: 3 additions & 1 deletion front/pages/w/[wId]/u/chat/[cId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,9 @@ export default function AppChat({
icon={CloudArrowDownIcon}
label="Set up your first Data Source"
onClick={() => {
void router.push(`/w/${owner.sId}/ds`);
void router.push(
`/w/${owner.sId}/builder/data-sources`
);
}}
/>
</div>
Expand Down

0 comments on commit 9b3a4b7

Please sign in to comment.