- Assistants can incorporate existing company data and
- knowledge to formulate answers.
-
- There are two types of knowledge sources:{" "}
-
Data Sources (Files you can upload) and{" "}
-
Connections (Automatically synchronized
- with platforms like Notion, Slack, ...).
+ {configurableDataSources.length === 0 &&
+ Object.keys(builderState.dataSourceConfigurations).length ===
+ 0 && (
+
+
+
+ Assistants can incorporate existing company data and
+ knowledge to formulate answers.
+
+
+ There are two types of data sources:{" "}
+ Folders (Files you can upload) and{" "}
+ Connections (Automatically synchronized
+ with platforms like Notion, Slack, ...).
+
+ {(() => {
+ switch (owner.role) {
+ case "admin":
+ return (
+
+
+ Visit the "Connections" and "Folders" sections
+ in the Assistants panel to add new data sources.
+
+
+ );
+ case "builder":
+ return (
+
+
+ Only Admins can activate Connections.
+
+ You can add Data Sources by visiting "Folders"
+ in the Assistants panel.
+
+
+ );
+ case "user":
+ return (
+
+
+ Only Admins and Builders can activate
+ Connections or create Folders.
+
+
+ );
+ case "none":
+ return <>>;
+ default:
+ ((x: never) => {
+ throw new Error("Unkonwn role " + x);
+ })(owner.role);
+ }
+ })()}
- {(() => {
- switch (owner.role) {
- case "admin":
- return (
-
-
- Visit the "Data Sources" and "Connections"
- sections in your workspace admin panel to add new
- sources of knowledge.
-
-
- );
- case "builder":
- return (
-
-
- Only Admins can activate Connections.
-
- You can Data Sources by visiting "Data Source" in
- your workspace admin panel.
-
-
- );
- case "user":
- return (
-
-
- Only Admins and Builders can activate Connections
- and Data Sources.
-
-
- );
- case "none":
- return <>>;
- default:
- ((x: never) => {
- throw new Error("Unkonwn role " + x);
- })(owner.role);
- }
- })()}
-
-
- )}
+
+ )}
You can ask the assistant to perform actions before answering,
like{" "}
diff --git a/front/components/sparkle/navigation.tsx b/front/components/sparkle/navigation.tsx
index ba481c395635..609522803378 100644
--- a/front/components/sparkle/navigation.tsx
+++ b/front/components/sparkle/navigation.tsx
@@ -142,7 +142,7 @@ export const subNavigationConversations = ({
menus: [
{
id: "personal_assistants",
- label: "My Assistants",
+ label: "Assistants",
icon: RobotIcon,
href: `/w/${owner.sId}/assistant/assistants`,
current: current === "personal_assistants",
diff --git a/front/pages/w/[wId]/assistant/assistants.tsx b/front/pages/w/[wId]/assistant/assistants.tsx
index 779f75baba17..931838f40a62 100644
--- a/front/pages/w/[wId]/assistant/assistants.tsx
+++ b/front/pages/w/[wId]/assistant/assistants.tsx
@@ -8,19 +8,21 @@ import {
PlusIcon,
RobotIcon,
Searchbar,
+ SliderToggle,
Tab,
Tooltip,
XMarkIcon,
} from "@dust-tt/sparkle";
import {
AgentConfigurationType,
+ AgentUserListStatus,
UserType,
WorkspaceType,
} from "@dust-tt/types";
import { SubscriptionType } from "@dust-tt/types";
import { GetServerSideProps, InferGetServerSidePropsType } from "next";
import Link from "next/link";
-import { useState } from "react";
+import { useContext, useState } from "react";
import {
DeleteAssistantDialog,
@@ -32,9 +34,11 @@ import {
subNavigationAssistants,
subNavigationConversations,
} from "@app/components/sparkle/navigation";
+import { SendNotificationsContext } from "@app/components/sparkle/Notification";
import { Authenticator, getSession, getUserFromSession } from "@app/lib/auth";
import { useAgentConfigurations } from "@app/lib/swr";
import { classNames, subFilter } from "@app/lib/utils";
+import { PostAgentListStatusRequestBody } from "@app/pages/api/w/[wId]/members/me/agent_list_status";
const { GA_TRACKING_ID = "" } = process.env;
@@ -91,7 +95,7 @@ export default function PersonalAssistants({
const { agentConfigurations, mutateAgentConfigurations } =
useAgentConfigurations({
workspaceId: owner.sId,
- agentsGetView: "list",
+ agentsGetView: view === "personal" ? "list" : "workspace",
});
const [assistantSearch, setAssistantSearch] = useState
("");
@@ -127,6 +131,47 @@ export default function PersonalAssistants({
},
];
+ const sendNotification = useContext(SendNotificationsContext);
+
+ const updateAgentUserListStatus = async (
+ agentConfiguration: AgentConfigurationType,
+ listStatus: AgentUserListStatus
+ ) => {
+ const body: PostAgentListStatusRequestBody = {
+ agentId: agentConfiguration.sId,
+ listStatus,
+ };
+
+ const res = await fetch(
+ `/api/w/${owner.sId}/members/me/agent_list_status`,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(body),
+ }
+ );
+ if (!res.ok) {
+ const data = await res.json();
+ sendNotification({
+ title: `Error ${
+ listStatus === "in-list" ? "adding" : "removing"
+ } Assistant`,
+ description: data.error.message,
+ type: "error",
+ });
+ } else {
+ sendNotification({
+ title: `Assistant ${
+ listStatus === "in-list" ? "added to" : "removed from"
+ } your list`,
+ type: "success",
+ });
+ await mutateAgentConfigurations();
+ }
+ };
+
return (