- Linked Meta Response settings with components

- fixed bugs
This commit is contained in:
sherifButt 2024-03-26 09:35:19 +00:00
parent 5318b599b7
commit 26c311d6d3
20 changed files with 688 additions and 401 deletions

View File

@ -30,7 +30,10 @@ export default function Badge({
showClose = false, showClose = false,
bg = "bg-green-500", bg = "bg-green-500",
animated = false, animated = false,
active = false,
onClose = () => {}, // Callback for close icon onClose = () => {}, // Callback for close icon
onSelect = () => {}, // Callback for badge click
onDoubleClick = () => {}, // Callback for badge double click
}) { }) {
const { const {
text: textColor, text: textColor,
@ -64,7 +67,9 @@ export default function Badge({
lg: "shadow-lg", lg: "shadow-lg",
xl: "shadow-xl", xl: "shadow-xl",
}[shadow]; }[shadow];
const backgroundClasses = `${bg} bg-opacity-10 hover:bg-opacity-20`; const backgroundClasses = `${bg} ${
active ? "bg-opacity-20" : "bg-opacity-10"
} hover:bg-opacity-30`;
// SVG Icons // SVG Icons
const DotIcon = () => ( const DotIcon = () => (
@ -91,7 +96,9 @@ export default function Badge({
return ( return (
<div <div
className={`flex flex-row gap-0.5 w-fit h-fit justify-center items-center group ${sizeClasses} ${backgroundClasses} ${roundedClasses} ${shadowClasses} ${ringClasses}`} className={`flex flex-row gap-0.5 w-fit h-fit justify-center items-center cursor-pointer select-none group ${sizeClasses} ${backgroundClasses} ${roundedClasses} ${shadowClasses} ${ringClasses}`}
onDoubleClick={onDoubleClick}
onClick={onSelect}
> >
{showDot && ( {showDot && (
<div> <div>
@ -103,10 +110,10 @@ export default function Badge({
</p> </p>
{showClose && ( {showClose && (
<div <div
className="flex flex-row justify-start items-start p-1 rounded-lg cursor-pointer" className="flex flex-row justify-start items-start p-1 rounded-lg cursor-pointer z-10"
onClick={onClose} onClick={onClose}
> >
<CloseIcon /> <CloseIcon className="p1" />
</div> </div>
)} )}
</div> </div>

View File

@ -15,6 +15,7 @@ export default function TextAreaBlock({
wrap, wrap,
code, code,
onSave, onSave,
value,
}) { }) {
return ( return (
<div> <div>
@ -32,6 +33,7 @@ export default function TextAreaBlock({
</div> </div>
<TextArea <TextArea
defaultValue={defaultValue} defaultValue={defaultValue}
value={value}
required={required} required={required}
placeholder={placeholder} placeholder={placeholder}
onChange={onChange} onChange={onChange}

View File

@ -13,6 +13,7 @@ export default function ToggleBlock({
badgeLabel, badgeLabel,
badgeAnimated, badgeAnimated,
badgeBg, badgeBg,
badgeShowDot,
border, border,
bg, bg,
Icon, Icon,
@ -23,6 +24,7 @@ export default function ToggleBlock({
const borderStyle = border ? "border border-gray-600 rounded-2xl p-4" : ""; const borderStyle = border ? "border border-gray-600 rounded-2xl p-4" : "";
const backgroundStyle = bg ? "bg-black/10" : ""; const backgroundStyle = bg ? "bg-black/10" : "";
return ( return (
<div <div
className={`relative w-full max-h-full ${borderStyle} ${backgroundStyle}`} className={`relative w-full max-h-full ${borderStyle} ${backgroundStyle}`}
@ -49,7 +51,7 @@ export default function ToggleBlock({
</label> </label>
{badge && ( {badge && (
<Badge <Badge
showDot showDot={badgeShowDot}
animated={badgeAnimated} animated={badgeAnimated}
label={badgeLabel} label={badgeLabel}
bg={badgeBg} bg={badgeBg}

View File

@ -0,0 +1,27 @@
import React from "react";
export default function Button({
onClick,
disabled,
icon: Icon,
text,
className = "",
iconSize = 18,
iconColor = "#D3D4D4",
textClass = "",
}) {
return (
<button
onClick={onClick}
disabled={disabled}
className={`flex items-center gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-[#222628]/60 transition-all duration-150 ease-in-out ${className}`}
>
{Icon && <Icon size={iconSize} weight="bold" color={iconColor} />}
<div
className={`text-[#D3D4D4] text-xs font-bold leading-[18px] ${textClass}`}
>
{text}
</div>
</button>
);
}

View File

@ -1,4 +1,4 @@
import { ArrowsIn, ArrowsOut, Check } from "@phosphor-icons/react"; import { ArrowsIn, ArrowsOut, Check, X } from "@phosphor-icons/react";
import React, { useState, useRef, useEffect } from "react"; import React, { useState, useRef, useEffect } from "react";
export default function TextArea({ export default function TextArea({
@ -14,19 +14,21 @@ export default function TextArea({
wrap = "soft", wrap = "soft",
code = false, code = false,
onSave, onSave,
value,
}) { }) {
const [rows, setRows] = useState(initialRows); const [rows, setRows] = useState(initialRows);
const [isExpanded, setIsExpanded] = useState(false); const [isExpanded, setIsExpanded] = useState(false);
const [showExpandIcon, setShowExpandIcon] = useState(false); const [showExpandIcon, setShowExpandIcon] = useState(false);
const [content, setContent] = useState(defaultValue); const [content, setContent] = useState(value || "");
const [showSaveButton, setShowSaveButton] = useState(false); const [showSaveButton, setShowSaveButton] = useState(false);
const textAreaRef = useRef(null); const textAreaRef = useRef(null);
useEffect(() => { useEffect(() => {
setContent(value);
adjustRowsToFitContent(); adjustRowsToFitContent();
// Initial check to determine if the expand icon should be shown // Initial check to determine if the expand icon should be shown
checkForOverflow(); checkForOverflow();
}, [defaultValue]); }, [value]);
const toggleExpansion = () => { const toggleExpansion = () => {
setIsExpanded(!isExpanded); setIsExpanded(!isExpanded);
@ -78,6 +80,12 @@ export default function TextArea({
} }
}; };
// Handle cancel action
const handleCancel = () => {
setContent(value);
setShowSaveButton(false);
};
const textColorClass = disabled ? "text-white/40" : "text-white/60"; const textColorClass = disabled ? "text-white/40" : "text-white/60";
const codeClass = code ? "font-mono text-xs" : "text-sm"; const codeClass = code ? "font-mono text-xs" : "text-sm";
@ -87,7 +95,8 @@ export default function TextArea({
ref={textAreaRef} ref={textAreaRef}
name={name} name={name}
rows={rows} rows={rows}
defaultValue={defaultValue} // defaultValue={defaultValue}
value={content}
className={`resize-none bg-zinc-900 placeholder:text-white/20 ${codeClass} rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2 ${textColorClass} ${className}`} className={`resize-none bg-zinc-900 placeholder:text-white/20 ${codeClass} rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2 ${textColorClass} ${className}`}
placeholder={placeholder} placeholder={placeholder}
required={required} required={required}
@ -97,7 +106,7 @@ export default function TextArea({
disabled={disabled} disabled={disabled}
/> />
{showSaveButton && ( {showSaveButton && (
<div className="flex flex-row justify-end px-8 sticky bottom-4 right-6"> <div className="flex flex-row justify-end px-8 sticky bottom-4 right-6 gap-4">
<button <button
onClick={handleSave} onClick={handleSave}
className="flex items-center mt-4 gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-[#222628]/60 transition-all duration-150 ease-in-out " className="flex items-center mt-4 gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-[#222628]/60 transition-all duration-150 ease-in-out "
@ -105,25 +114,34 @@ export default function TextArea({
> >
<Check size={18} weight="bold" color="#D3D4D4" /> <Check size={18} weight="bold" color="#D3D4D4" />
<div className="text-[#D3D4D4] text-xs font-bold leading-[18px]"> <div className="text-[#D3D4D4] text-xs font-bold leading-[18px]">
Save Update Save
</div>
</button>
<button
onClick={handleCancel}
className="flex items-center mt-4 gap-x-2 cursor-pointer px-[14px] py-[7px] -mr-[14px] rounded-lg hover:bg-[#222628]/60 transition-all duration-150 ease-in-out "
>
<X size={18} weight="bold" color="#D3D4D4" />
<div className="text-[#D3D4D4] text-xs font-bold leading-[18px]">
Cancel
</div> </div>
</button> </button>
</div> </div>
)} )}
{showExpandIcon && (
{showExpandIcon && !showSaveButton && (
<button <button
type="button"
onClick={toggleExpansion} onClick={toggleExpansion}
className={`absolute bottom-2 right-2 text-lg ${ className={`absolute bottom-1 right-2 text-lg ${
isExpanded ? "text-2xl" : "text-xl" isExpanded ? "text-2xl" : "text-xl"
} text-white/60 hover:text-white transition-all duration-150 ease-in-out`} } text-white/60 hover:text-white transition-all duration-150 ease-in-out`}
aria-label={isExpanded ? "Contract" : "Expand"} aria-label={isExpanded ? "Contract" : "Expand"}
disabled={disabled} disabled={disabled}
> >
{isExpanded ? ( {isExpanded ? (
<ArrowsIn className="hover:scale-90" /> <span className="hover:scale-90">-</span>
) : ( ) : (
<ArrowsOut className="hover:scale-110 active:scale-125 transition-all duration-150 ease-in-out" /> <span className="hover:scale-110 active:scale-125 transition-all duration-150 ease-in-out">+</span>
)} )}
</button> </button>
)} )}

View File

@ -24,7 +24,7 @@ export default function ToggleButton({ initialChecked, onToggle, name, disabled
className="peer sr-only pointer-events-none" className="peer sr-only pointer-events-none"
disabled={disabled} disabled={disabled}
/> />
<div className="pointer-events-none peer h-6 w-11 rounded-full bg-stone-400 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:shadow-xl after:border after:border-gray-600 after:bg-white after:box-shadow-md after:transition-all after:content-[''] peer-checked:bg-sky-400 peer-checked:after:translate-x-full peer-checked:after:border-white peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-800"></div> <div className="pointer-events-none peer h-6 w-11 rounded-full bg-stone-400 after:absolute after:left-[2px] after:top-[2px] after:h-5 after:w-5 after:rounded-full after:shadow-xl after:border after:border-gray-600 after:bg-white after:box-shadow-md after:transition-all after:content-[''] peer-checked:bg-lime-300 peer-checked:after:translate-x-full peer-checked:after:border-gray-400 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-800"></div>
</label> </label>
); );
} }

View File

@ -1,7 +1,7 @@
import { PaperPlaneRight } from "@phosphor-icons/react"; import { PaperPlaneRight } from "@phosphor-icons/react";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
const OptionSelect = ({ data, settings, submit, message, setMessage }) => { const OptionSelect = ({ data, settings, submit, message, setMessage ,workspace}) => {
const [selectedOptions, setSelectedOptions] = useState([]); const [selectedOptions, setSelectedOptions] = useState([]);
const [submitMessage, setSubmitMessage] = useState(false); const [submitMessage, setSubmitMessage] = useState(false);
@ -12,6 +12,7 @@ const OptionSelect = ({ data, settings, submit, message, setMessage }) => {
} }
}, [message]); }, [message]);
const handleSelection = (value) => { const handleSelection = (value) => {
const currentIndex = selectedOptions.indexOf(value); const currentIndex = selectedOptions.indexOf(value);
const newSelectedOptions = [...selectedOptions]; const newSelectedOptions = [...selectedOptions];
@ -28,42 +29,11 @@ const OptionSelect = ({ data, settings, submit, message, setMessage }) => {
const handleSubmit = () => { const handleSubmit = () => {
setSubmitMessage(true); setSubmitMessage(true);
setSelectedOptions([])
}; };
// Grid of Buttons
if (settings.displayType === "buttons") {
return (
<div className=" mb-2 w-full p-4 backdrop-blur-sm rounded-t-xl overflow-hidden py-4 px-6 border-l border-t border-r border-[#2f3238]">
<Label label={data?.label} />
<div className=" pb-0 mt-2 grid grid-cols-1 md:grid-cols-2 gap-4 text-white/70 text-sm ">
{data.options.map((option, index) => (
<button
key={index}
className="group relative shadow-lg hover:shadow-sm transition-all duration-200 ease-in-out text-left p-2.5 border rounded-xl border-white/20 bg-sidebar hover:bg-sidebar/50 overflow-hidden "
onClick={() => {
{
handleSelection(option.value);
handleSubmit();
}
}}
>
<p className="truncate max-w-xl group-hover:max-w-xl group-hover:truncate-0">
<span className="text-white/50 mr-1">{index + 1}.</span>{" "}
{option.label}
</p>
<span className="absolute invisible group-hover:visible bg-black text-white text-sm rounded-lg p-2 left-0 bottom-full mb-2">
<span className="text-white/50 mr-1">{index + 1}.</span>{" "}
{option.label}
</span>
</button>
))}
</div>
</div>
);
}
// Normal List with Hyperlinks // Normal List with Hyperlinks
if (settings.displayType === "list") { if (settings.displayType.includes("list") && workspace?.metaResponseSettings?.inputs?.config?.components?.optionsList?.isEnabled) {
return ( return (
<div className=" text-white/70 text-sm w-full backdrop-blur-sm rounded-t-xl overflow-hidden py-4 px-6 border-l border-t border-r border-[#2f3238]"> <div className=" text-white/70 text-sm w-full backdrop-blur-sm rounded-t-xl overflow-hidden py-4 px-6 border-l border-t border-r border-[#2f3238]">
<Label {...data} /> <Label {...data} />
@ -90,7 +60,7 @@ const OptionSelect = ({ data, settings, submit, message, setMessage }) => {
} }
// Checkbox // Checkbox
if (settings.displayType === "checkbox") { if (settings.displayType.includes("checkbox") && workspace?.metaResponseSettings?.inputs?.config?.components?.multiSelectCheckboxes?.isEnabled) {
return ( return (
<div className="w-full p-4 backdrop-blur-sm rounded-t-xl overflow-hidden py-4 px-6 border-l border-t border-r border-[#2f3238]"> <div className="w-full p-4 backdrop-blur-sm rounded-t-xl overflow-hidden py-4 px-6 border-l border-t border-r border-[#2f3238]">
<Label label={data?.label} /> <Label label={data?.label} />
@ -126,10 +96,12 @@ const OptionSelect = ({ data, settings, submit, message, setMessage }) => {
} }
// Dropdown Menu // Dropdown Menu
return ( if (settings.displayType.includes("dropdown") && workspace?.metaResponseSettings?.inputs?.config?.components?.dropDownMenu?.isEnabled) {
<div className="mt-5 mb-5 w-full backdrop-blur-sm rounded-t-xl py-4 px-6 border-l border-t border-r border-[#2f3238]">
<Label {...data} /> return (
<select <div className="mt-5 mb-5 w-full backdrop-blur-sm rounded-t-xl py-4 px-6 border-l border-t border-r border-[#2f3238]">
<Label {...data} />
<select
name="optionSelect" name="optionSelect"
id="optionSelect" id="optionSelect"
multiple={settings.allowMultiple} multiple={settings.allowMultiple}
@ -158,7 +130,39 @@ const OptionSelect = ({ data, settings, submit, message, setMessage }) => {
)} )}
</select> </select>
</div> </div>
); )}
// Grid of Buttons fallback
return (
<div className=" mb-2 w-full p-4 backdrop-blur-sm rounded-t-xl overflow-hidden py-4 px-6 border-l border-t border-r border-[#2f3238]">
<Label label={data?.label} />
<div className=" pb-0 mt-2 grid grid-cols-1 md:grid-cols-2 gap-4 text-white/70 text-sm ">
{data.options.map((option, index) => (
<button
key={index}
className="group relative shadow-lg hover:shadow-sm transition-all duration-200 ease-in-out text-left p-2.5 border rounded-xl border-white/20 bg-sidebar hover:bg-sidebar/50 overflow-hidden "
onClick={() => {
{
handleSelection(option.value);
handleSubmit();
}
}}
>
<p className="truncate max-w-xl group-hover:max-w-xl group-hover:truncate-0">
<span className="text-white/50 mr-1">{index + 1}.</span>{" "}
{option.label}
</p>
<span className="absolute invisible group-hover:visible bg-black text-white text-sm rounded-lg p-2 left-0 bottom-full mb-2">
<span className="text-white/50 mr-1">{index + 1}.</span>{" "}
{option.label}
</span>
</button>
))}
</div>
</div>
);
}; };
const Label = ({ label, description }) => { const Label = ({ label, description }) => {

View File

@ -13,6 +13,10 @@ import PromptInput from "../PromptInput";
const inputComponents = { const inputComponents = {
text: PromptInput, text: PromptInput,
options: OptionSelect, options: OptionSelect,
checkbox: OptionSelect,
list: OptionSelect,
buttons: OptionSelect,
dropdown: OptionSelect,
// range: RangeSlider, // range: RangeSlider,
// date: DatePicker, // date: DatePicker,
// time: TimePicker, // time: TimePicker,
@ -47,11 +51,14 @@ const MetaInputs = ({
// Condition to show the dynamic input or the forced text input // Condition to show the dynamic input or the forced text input
const shouldShowMetaInputs = const shouldShowMetaInputs =
isMetaInputs && inputs !== undefined && !isForcedTextInput; workspace?.metaResponse && inputs !== undefined && !isForcedTextInput
return ( return (
<div className="w-full md:px-4 fixed md:absolute bottom-10 left-0 z-10 md:z-0 flex justify-center items-center"> <div className="w-full md:px-4 fixed md:absolute bottom-10 left-0 z-10 md:z-0 flex justify-center items-center">
<div className="w-[700px]"> <div className="w-[700px]">
{shouldShowMetaInputs ? ( {shouldShowMetaInputs ? (
<InputComponent <InputComponent
submit={submit} submit={submit}
@ -78,7 +85,7 @@ const MetaInputs = ({
sendCommand={sendCommand} sendCommand={sendCommand}
/> />
)} )}
{isMetaInputs && inputs != undefined && ( {workspace?.metaResponse && inputs != undefined && (
<div className="w-full absolute -bottom-8 left-0 z-10 md:z-0 flex justify-center items-center"> <div className="w-full absolute -bottom-8 left-0 z-10 md:z-0 flex justify-center items-center">
<button <button
type="button" type="button"

View File

@ -109,7 +109,7 @@ export default function ChatContainer({
); );
} }
if (isMetaInputs) { if (workspace?.metaResponse) {
const { remainingText, metaData } = extractMetaData( const { remainingText, metaData } = extractMetaData(
_chatHistory[_chatHistory.length - 1].content _chatHistory[_chatHistory.length - 1].content
); );
@ -131,11 +131,11 @@ export default function ChatContainer({
{isMobile && <SidebarMobileHeader />} {isMobile && <SidebarMobileHeader />}
<div className="flex flex-col h-full w-full md:mt-0 mt-[40px]"> <div className="flex flex-col h-full w-full md:mt-0 mt-[40px]">
<ChatHistory <ChatHistory
history={isMetaInputs ? finalizedChatHistory : chatHistory} history={workspace?.metaResponse ? finalizedChatHistory : chatHistory}
workspace={workspace} workspace={workspace}
sendCommand={sendCommand} sendCommand={sendCommand}
/> />
{isMetaInputs && currentInputMeta?.inputs?.type !== undefined ? ( {workspace?.metaResponse && currentInputMeta?.inputs?.type !== undefined ? (
<MetaInputs <MetaInputs
inputs={currentInputMeta?.inputs} inputs={currentInputMeta?.inputs}
isMetaInputs={isMetaInputs} isMetaInputs={isMetaInputs}

View File

@ -1,9 +1,5 @@
import { API_BASE } from "@/utils/constants"; import { API_BASE } from "@/utils/constants";
import { baseHeaders } from "@/utils/request"; import { baseHeaders } from "@/utils/request";
import { fetchEventSource } from "@microsoft/fetch-event-source";
import WorkspaceThread from "@/models/workspaceThread";
import { v4 } from "uuid";
import { ABORT_STREAM_EVENT } from "@/utils/chat";
const MetaResponse = { const MetaResponse = {
toggle: async function (slug) { toggle: async function (slug) {
@ -18,7 +14,6 @@ const MetaResponse = {
.catch(() => false); .catch(() => false);
return result; return result;
}, },
update: async function (slug, data = {}) { update: async function (slug, data = {}) {
const { workspace, message } = await fetch( const { workspace, message } = await fetch(
`${API_BASE}/workspace/${slug}/update`, `${API_BASE}/workspace/${slug}/update`,
@ -35,29 +30,6 @@ const MetaResponse = {
return { workspace, message }; return { workspace, message };
}, },
delete: async function (slug) {
const result = await fetch(`${API_BASE}/workspace/${slug}`, {
method: "DELETE",
headers: baseHeaders(),
})
.then((res) => res.ok)
.catch(() => false);
return result;
},
uploadFile: async function (slug, formData) {
const response = await fetch(`${API_BASE}/workspace/${slug}/upload`, {
method: "POST",
body: formData,
headers: baseHeaders(),
});
const data = await response.json();
return { response, data };
},
getMetaResponseSettings: async function (slug) { getMetaResponseSettings: async function (slug) {
const settings = await fetch( const settings = await fetch(
`${API_BASE}/workspace/${slug}/metaResponse/settings`, `${API_BASE}/workspace/${slug}/metaResponse/settings`,
@ -83,54 +55,6 @@ const MetaResponse = {
.catch(() => ({})); .catch(() => ({}));
return settings; return settings;
}, },
uploadPfp: async function (formData, slug) {
return await fetch(`${API_BASE}/workspace/${slug}/upload-pfp`, {
method: "POST",
body: formData,
headers: baseHeaders(),
})
.then((res) => {
if (!res.ok) throw new Error("Error uploading pfp.");
return { success: true, error: null };
})
.catch((e) => {
console.log(e);
return { success: false, error: e.message };
});
},
fetchPfp: async function (slug) {
return await fetch(`${API_BASE}/workspace/${slug}/pfp`, {
method: "GET",
cache: "no-cache",
headers: baseHeaders(),
})
.then((res) => {
if (res.ok && res.status !== 204) return res.blob();
throw new Error("Failed to fetch pfp.");
})
.then((blob) => (blob ? URL.createObjectURL(blob) : null))
.catch((e) => {
console.log(e);
return null;
});
},
removePfp: async function (slug) {
return await fetch(`${API_BASE}/workspace/${slug}/remove-pfp`, {
method: "DELETE",
headers: baseHeaders(),
})
.then((res) => {
if (res.ok) return { success: true, error: null };
throw new Error("Failed to remove pfp.");
})
.catch((e) => {
console.log(e);
return { success: false, error: e.message };
});
},
}; };
export default MetaResponse; export default MetaResponse;

View File

@ -36,6 +36,7 @@ function ShowWorkspaceChat() {
setWorkspace({ setWorkspace({
..._workspace, ..._workspace,
suggestedMessages, suggestedMessages,
metaResponseSettings: JSON.parse(_workspace.metaResponseSettings),
pfpUrl, pfpUrl,
}); });
setLoading(false); setLoading(false);
@ -46,7 +47,7 @@ function ShowWorkspaceChat() {
return ( return (
<div className="w-screen h-screen overflow-hidden bg-sidebar flex"> <div className="w-screen h-screen overflow-hidden bg-sidebar flex">
{!isMobile && <Sidebar />} {!isMobile && <Sidebar />}
<WorkspaceChatContainer loading={loading} workspace={workspace} /> <WorkspaceChatContainer loading={loading} workspace={workspace} />
</div> </div>
); );
} }

View File

@ -10,13 +10,15 @@ export default function ChatEnableMetaResponse({ workspace, setHasChanges }) {
initialChecked={workspace?.metaResponse} initialChecked={workspace?.metaResponse}
label={ label={
workspace.metaResponse workspace.metaResponse
? "Meta Response is Enabled" ? "Meta Response is (Enabled)"
: "Enable Meta Response" : "Enable Meta Response"
} }
onToggle={toggleMetaResponse} onToggle={toggleMetaResponse}
name="metaResponse" name="metaResponse"
description="Turn on this feature to dynamically adjust the chat interface based on conversation context, using options like dropdowns, sliders, and suggestions for a tailored user experience." description="Turn on this feature to dynamically adjust the chat interface based on conversation context, using options like dropdowns, sliders, and suggestions for a tailored user experience."
badge // badge
// badgeLabel="New"
// badgeAnimated
/> />
</div> </div>
); );

View File

@ -1,11 +1,44 @@
import Button from "@/components/Generic/Buttons/Button";
import { chatPrompt } from "@/utils/chat"; import { chatPrompt } from "@/utils/chat";
import { useEffect, useState } from "react";
export default function ChatPromptSettings({ workspace, setHasChanges }) { export default function ChatPromptSettings({ workspace, setHasChanges }) {
const [settings, setSettings] = useState(
JSON.parse(workspace.metaResponseSettings)
);
const [textareaSettings, setTextareaSettings] = useState({
isDisabled: false,
message: "",
disableClasses: "",
});
useEffect(() => {
console.log("ChatPromptSettings: ", settings);
if (
workspace.metaResponse &&
Object.keys(settings).length > 0 &&
Object.values(settings).some((feature) => feature.isEnabled)
) {
console.log("Prompt is managed by Meta Response");
setTextareaSettings({
...textareaSettings,
isDisabled: true,
message: "(Prompt is managed now by Meta Response)",
disableClasses: "cursor-not-allowed bg-zinc-900 text-white/40",
});
}
}, [settings]);
return ( return (
<div> <div className="relative">
<div className="flex flex-col"> <div className="flex flex-col">
<label htmlFor="name" className="block input-label"> <label htmlFor="name" className="block input-label">
Prompt Prompt{" "}
{textareaSettings.isDisabled && (
<span className="text-xs text-red-500/80 text-right mt-1.5 ml-2">
{textareaSettings.message}
</span>
)}
</label> </label>
<p className="text-white text-opacity-60 text-xs font-medium py-1.5"> <p className="text-white text-opacity-60 text-xs font-medium py-1.5">
The prompt that will be used on this workspace. Define the context and The prompt that will be used on this workspace. Define the context and
@ -18,12 +51,17 @@ export default function ChatPromptSettings({ workspace, setHasChanges }) {
name="openAiPrompt" name="openAiPrompt"
rows={5} rows={5}
defaultValue={chatPrompt(workspace)} defaultValue={chatPrompt(workspace)}
className="bg-zinc-900 placeholder:text-white/20 text-white text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2" className={`${
textareaSettings.isDisabled
? textareaSettings.disableClasses
: " bg-zinc-900"
} text-white placeholder:text-white/20 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 mt-2`}
placeholder="Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed." placeholder="Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed."
required={true} required={true}
wrap="soft" wrap="soft"
autoComplete="off" autoComplete="off"
onChange={() => setHasChanges(true)} onChange={() => setHasChanges(true)}
disabled={textareaSettings.isDisabled}
/> />
</div> </div>
); );

View File

@ -76,7 +76,6 @@ export default function ChatSettings({ workspace, setWorkspace }) {
/> />
<ChatEnableMetaResponse <ChatEnableMetaResponse
workspace={workspace} workspace={workspace}
setHasChanges={setHasChanges} setHasChanges={setHasChanges}
/> />
{hasChanges && ( {hasChanges && (

View File

@ -2,10 +2,16 @@ import ToggleBlock from "@/components/Generic/Blocks/ToggleBlock";
import showToast from "@/utils/toast"; import showToast from "@/utils/toast";
import { useState } from "react"; import { useState } from "react";
export default function EnableSystemPrompt({ settings, onUpdateSettings }) { export default function EnableSystemPrompt({
settings,
onUpdateSettings,
content,
}) {
const [isEnabled, setIsEnabled] = useState( const [isEnabled, setIsEnabled] = useState(
settings.config.systemPrompt.isEnabled settings.config.systemPrompt.isEnabled ||
settings.config.systemPrompt.content !== ""
); );
const toggleSystemPrompt = () => { const toggleSystemPrompt = () => {
onUpdateSettings({ onUpdateSettings({
...settings, ...settings,
@ -30,16 +36,17 @@ export default function EnableSystemPrompt({ settings, onUpdateSettings }) {
return ( return (
<div className="relative w-full max-h-full "> <div className="relative w-full max-h-full ">
<ToggleBlock <ToggleBlock
initialChecked={settings.config.systemPrompt.isEnabled} initialChecked={isEnabled}
label={ label={
settings.config.systemPrompt.isEnabled isEnabled
? "System Prompt (is now handled by Meta Response Inputs)" ? "System Prompt (Handled by Meta Response Inputs)"
: "Handle System Prompt - (optional)" : "Handle System Prompt - (optional)"
} }
onToggle={toggleSystemPrompt} onToggle={toggleSystemPrompt}
name="systemPrompt" name="systemPrompt"
description="Specify the context and instructions for the AI in this workspace. A well-defined prompt ensures the AI delivers relevant and precise responses." description="Specify the context and instructions for the AI in this workspace. A well-defined prompt ensures the AI delivers relevant and precise responses."
inline inline
content={content}
/> />
</div> </div>
); );

View File

@ -1,10 +1,11 @@
import Badge from "@/components/Generic/Badges/Badge";
import TextAreaBlock from "@/components/Generic/Blocks/TextAreaBlock"; import TextAreaBlock from "@/components/Generic/Blocks/TextAreaBlock";
import EnableSystemPrompt from "./EnableSystemPrompt";
import CheckBoxBlock from "@/components/Generic/Blocks/CheckBoxBlock";
import TitleBlock from "@/components/Generic/Blocks/TitleBlock"; import TitleBlock from "@/components/Generic/Blocks/TitleBlock";
import ToggleBlock from "@/components/Generic/Blocks/ToggleBlock"; import ToggleBlock from "@/components/Generic/Blocks/ToggleBlock";
import Button from "@/components/Generic/Buttons/Button";
import TextArea from "@/components/Generic/Inputs/TextArea"; import TextArea from "@/components/Generic/Inputs/TextArea";
import Badge from "@/components/Generic/Badges/Badge"; import showToast from "@/utils/toast";
import EnableSystemPrompt from "./EnableSystemPrompt";
export default function FeatureSettings({ export default function FeatureSettings({
workspace, workspace,
@ -19,15 +20,14 @@ export default function FeatureSettings({
settings={settings} settings={settings}
onUpdateSettings={onUpdateSettings} onUpdateSettings={onUpdateSettings}
/> />
{settings.config.systemPrompt.isEnabled && ( {settings.config.systemPrompt.content !== "" ||
settings.config.systemPrompt.isEnabled ? (
<div className="flex flex-col gap-2"> <div className="flex flex-col gap-2">
<TextAreaBlock <TextAreaBlock
workspace={workspace} workspace={workspace}
label="System Prompt"
description="Specify the context and instructions for the AI in this workspace. A well-defined prompt ensures the AI delivers relevant and precise responses."
name="systemPrompt" name="systemPrompt"
defaultValue={settings.config.systemPrompt.content} value={settings.config.systemPrompt.content}
onSave={(newContent) => onSave={(newContent) => {
onUpdateSettings({ onUpdateSettings({
...settings, ...settings,
config: { config: {
@ -37,63 +37,171 @@ export default function FeatureSettings({
content: newContent, content: newContent,
}, },
}, },
}) });
} }}
code code
initialRows={6} initialRows={6}
/> />
<CheckBoxBlock </div>
workspace={workspace} ) : null}
label="override workspace prompt" </div>
inline <div>
name="overrideSystemPrompt" <TitleBlock
initialChecked={settings.config.systemPrompt.override} label="Inputs Schema"
onToggle={(override) => description="Define the schema context and instructions for the AI to generate a response. You should to provide a carefully crafted prompt so the AI can generate a relevant and accurate response."
/>
<div className=" flex gap-1 -mb-1 mt-4 flex-wrap items-center">
{settings.config.promptSchema.list.map((item, index) => (
<Badge
key={`schema_${index}`}
showClose
size="md"
rounded="md"
label={`${item?.title}`}
active={settings.config.promptSchema.active === index}
onSelect={
// fill promptSchema.active with index of selected item
(e) => {
e.stopPropagation();
console.log("selected item", item);
onUpdateSettings({
...settings,
config: {
...settings.config,
promptSchema: {
...settings.config.promptSchema,
active: index,
},
},
});
showToast(
`Schema ${item.title} has been selected`,
"success",
{ clear: true }
);
}
}
onDoubleClick={() => {
// rename item
console.log("renaming item", item);
const newSchemas = settings.config.promptSchema.list.map(
(s, i) => {
if (i === index) {
return {
...s,
title:
prompt("Enter new item title", s.title) || s.title,
};
}
return s;
}
);
console.log("New item", newSchemas);
onUpdateSettings({ onUpdateSettings({
...settings, ...settings,
config: { config: {
...settings.config, ...settings.config,
systemPrompt: { promptSchema: {
...settings.config.systemPrompt, ...settings.config.promptSchema,
override, list: newSchemas,
}, },
}, },
}) });
} }}
/> onClose={(e) => {
</div> e.stopPropagation();
)} if (settings.config.promptSchema.list.length === 1) {
</div> showToast("Cannot remove last schema", "error", {
<div> clear: true,
<TitleBlock });
label="Prompt-schema" return;
description="Define the schema context and instructions for the AI to generate a response. You should to provide a carefully crafted prompt so the AI can generate a relevant and accurate response." }
/> const newSchemas = settings.config.promptSchema.list.filter(
<div className=" flex gap-1 -mb-1 mt-4"> (_, i) => i !== index
{settings.config.promptSchema.schemas.map((schema, index) => ( );
<Badge const active = settings.config.promptSchema.active;
key={`schema_${index}`} const newActive = active === index ? active - 1 : active;
size="md" onUpdateSettings({
rounded="md" ...settings,
label={`${schema.title}`} config: {
...settings.config,
promptSchema: {
...settings.config.promptSchema,
list: newSchemas,
active: newActive,
},
},
});
showToast(`Schema ${item.title} has been removed`, "success", {
clear: true,
});
}}
/> />
))} ))}
<Button
text="+"
onClick={() => {
const newSchema = {
title: prompt("Enter new item title"),
content: "",
};
// if cancel is clicked
if (!newSchema.title) return;
const newSchemas = [
...settings.config.promptSchema.list,
newSchema,
];
onUpdateSettings({
...settings,
config: {
...settings.config,
promptSchema: {
...settings.config.promptSchema,
list: newSchemas,
active: newSchemas.length - 1,
},
},
});
showToast(`Schema ${newSchema.title} has been added`, "success", {
clear: true,
});
}}
/>
</div> </div>
<TextArea <TextArea
name="openAiPrompt" name="openAiPrompt"
defaultValue={settings.config.promptSchema.content} value={
// use value instead of defaultValue
settings.config.promptSchema.list[
settings.config.promptSchema.active
].content
}
placeholder="Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed." placeholder="Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed."
onSave={(e) => onSave={
onUpdateSettings({ // fill promptSchema.list[active].content with new content
...settings, (newContent) => {
config: { const newSchemas = settings.config.promptSchema.list.map(
...settings.config, (item, idx) => {
promptSchema: { if (idx === settings.config.promptSchema.active) {
...settings.config.promptSchema, return {
content: e, ...item,
content: newContent,
};
}
return item;
}
);
onUpdateSettings({
...settings,
config: {
...settings.config,
promptSchema: {
...settings.config.promptSchema,
list: newSchemas,
},
}, },
}, });
}) }
} }
code code
initialRows={6} initialRows={6}
@ -151,6 +259,10 @@ export default function FeatureSettings({
settings.config.components[component].description settings.config.components[component].description
} }
inline inline
disabled={settings.config.components[component].isDefault}
badge={settings.config.components[component].isDefault}
badgeLabel="Default"
badgeBg="bg-gray-500"
/> />
</div> </div>
); );

View File

@ -1,12 +1,13 @@
import TitleBlock from "@/components/Generic/Blocks/TitleBlock";
import MetaResponse from "@/models/metaResponse"; import MetaResponse from "@/models/metaResponse";
import Workspace from "@/models/workspace";
import showToast from "@/utils/toast"; import showToast from "@/utils/toast";
import { ChatText, Cube, Heart, UserCircle } from "@phosphor-icons/react"; import { ChatText, Cube, Heart, UserCircle } from "@phosphor-icons/react";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import EnableFeatures from "./EnableFeatures"; import EnableFeatures from "./EnableFeatures";
import FeatureSettings from "./FeatureSettings"; import FeatureSettings from "./FeatureSettings";
import TitleBlock from "@/components/Generic/Blocks/TitleBlock";
export default function MetaResponseSettings({ workspace }) { export default function MetaResponseSettings({ workspace, setWorkspace }) {
const [settings, setSettings] = useState({}); const [settings, setSettings] = useState({});
useEffect(() => { useEffect(() => {
const fetchMetaResponseSettings = async () => { const fetchMetaResponseSettings = async () => {
@ -20,10 +21,47 @@ export default function MetaResponseSettings({ workspace }) {
}, []); }, []);
const handleToggleEnableFeatures = async (feature, enabled) => { const handleToggleEnableFeatures = async (feature, enabled) => {
const updatedFeatureSettings = { let updatedFeatureSettings = {
...settings[feature], ...settings[feature],
isEnabled: enabled, isEnabled: enabled,
}; };
// if enabling a feature, set the systemPrompt content to openAiPrompt and clear openAiPrompt
if (settings[feature].config.systemPrompt.openAiPrompt != "") {
console.log(
"settings[feature].config.systemPrompt.openAiPrompt: ",
settings[feature].config.systemPrompt.openAiPrompt
);
updatedFeatureSettings = {
...updatedFeatureSettings,
config: {
...settings[feature].config,
systemPrompt: {
...settings[feature].config.systemPrompt,
content: settings[feature].config.systemPrompt.openAiPrompt,
openAiPrompt: "",
},
},
};
// if disabling a feature, clear the systemPrompt.openAiPrompt for all other features
Object.keys(settings).map((f) => {
if (f !== feature) {
const featureSettings = settings[f];
if (featureSettings.config.systemPrompt.openAiPrompt !== "") {
const updatedFeatureSettings = {
...featureSettings,
config: {
...featureSettings.config,
systemPrompt: {
...featureSettings.config.systemPrompt,
openAiPrompt: "",
},
},
};
settings[f] = updatedFeatureSettings;
}
}
});
}
const updatedSettings = await MetaResponse.updateMetaResponseSettings( const updatedSettings = await MetaResponse.updateMetaResponseSettings(
workspace.slug, workspace.slug,
@ -33,7 +71,7 @@ export default function MetaResponseSettings({ workspace }) {
} }
); );
console.log("updatedSettings: ", updatedSettings); console.log("updatedSettings: - ", updatedSettings);
setSettings(updatedSettings); setSettings(updatedSettings);
showToast( showToast(
`${feature} has been ${enabled ? "enabled" : "disabled"}`, `${feature} has been ${enabled ? "enabled" : "disabled"}`,
@ -46,18 +84,65 @@ export default function MetaResponseSettings({ workspace }) {
feature, feature,
updatedFeatureSettings updatedFeatureSettings
) => { ) => {
const updatedSettings = await MetaResponse.updateMetaResponseSettings( try {
workspace.slug, const updatedSettings = await MetaResponse.updateMetaResponseSettings(
{ workspace.slug,
...settings, {
[feature]: updatedFeatureSettings, ...settings,
} [feature]: updatedFeatureSettings,
); }
);
console.log("updatedSettings: ", updatedSettings); setSettings(updatedSettings);
setSettings(updatedSettings); } catch (error) {
console.error(
" Error while updating feature settings in MetaResponseSettings: ",
error
);
showToast(`Error: ${error.message}`, "error", { clear: true });
}
}; };
const handleUpdateWorkspaceOpenAiPrompt = async () => {
const openAiPrompt = () => {
let openAiPrompt = "";
Object.keys(settings).map((feature) => {
const featureSettings = settings[feature];
if (featureSettings.isEnabled) {
openAiPrompt += featureSettings.config.systemPrompt.content;
openAiPrompt +=
featureSettings.config.promptSchema.list[
featureSettings.config.promptSchema.active
].content;
}
});
return openAiPrompt;
};
try {
const updatedSettings = await Workspace.update(workspace.slug, {
openAiPrompt: openAiPrompt(),
});
if (!updatedSettings) return;
setWorkspace(updatedSettings.workspace);
} catch (error) {
console.error(
" Error while updating workspace.openAiPrompt in MetaResponseSettings: ",
error
);
showToast(`Error: ${error.message}`, "error", { clear: true });
}
};
useEffect(() => {
if (
workspace.metaResponse &&
Object.keys(settings).length > 0 &&
Object.values(settings).some((feature) => feature.isEnabled)
) {
handleUpdateWorkspaceOpenAiPrompt();
}
}, [settings]);
const mapIcons = { const mapIcons = {
inputs: ChatText, inputs: ChatText,
sentiments: Heart, sentiments: Heart,
@ -66,8 +151,8 @@ export default function MetaResponseSettings({ workspace }) {
// const mapFeatures = { // const mapFeatures = {
// inputs: InputsFeature, // inputs: InputsFeature,
// sentiments: InputsFeature, // sentiments: SentimentsFeature,
// avatars: InputsFeature, // avatars: AvatarsFeature,
// }; // };
return ( return (
@ -75,7 +160,7 @@ export default function MetaResponseSettings({ workspace }) {
<div className="px-4"> <div className="px-4">
<TitleBlock <TitleBlock
label="Meta Response" label="Meta Response"
description="This feature lets you dictate app behavior through AI-generated responses, using a specific schema to structure data. It aligns with specially designed components that interpret this schema, enabling custom configurations for managing these components efficiently." description="This feature lets you dictate app behavior through AI-generated responses, using a specific schema to structure data. It aligns with specially designed components that interpret this schema, enabling custom configurations for managing these components efficiently. runs better with OPENAI GPT-4 or nay advanced LLM model."
labelStyles="text-2xl font-semi-bold text-white" labelStyles="text-2xl font-semi-bold text-white"
Icon={Cube} Icon={Cube}
/> />

View File

@ -44,18 +44,28 @@ function ShowWorkspaceChat() {
useEffect(() => { useEffect(() => {
async function getWorkspace() { async function getWorkspace() {
if (!slug) return; if (!slug) return;
const _workspace = await Workspace.bySlug(slug); try {
if (!_workspace) { const _workspace = await Workspace.bySlug(slug);
setLoading(false); if (!_workspace) {
return; setLoading(false);
} return;
}
const suggestedMessages = await Workspace.getSuggestedMessages(slug); // const metaResponseSettings =
setWorkspace({ // _workspace.metaResponseSettings &&
..._workspace, // JSON.parse(_workspace.metaResponseSettings);
suggestedMessages,
}); const suggestedMessages = await Workspace.getSuggestedMessages(slug);
setLoading(false); setWorkspace({
..._workspace,
suggestedMessages,
// metaResponseSettings,
});
setLoading(false);
} catch (error) {
console.error("Error getting suggested messages for workspace:", error);
}
} }
getWorkspace(); getWorkspace();
}, [slug]); }, [slug]);

View File

@ -28,6 +28,7 @@ const {
determineWorkspacePfpFilepath, determineWorkspacePfpFilepath,
fetchPfp, fetchPfp,
} = require("../utils/files/pfp"); } = require("../utils/files/pfp");
const { WorkspaceMetaResponse } = require("../models/workspaceMetaResponse");
function workspaceEndpoints(app) { function workspaceEndpoints(app) {
if (!app) return; if (!app) return;
@ -89,10 +90,16 @@ function workspaceEndpoints(app) {
} }
if ( if (
!currWorkspace.metaResponse && !currWorkspace.metaResponse &&
!currWorkspace.metaResponseSettings !currWorkspace.metaResponseSettings &&
data.metaResponse
) { ) {
metaResponseDefaultSettings.inputs.config.systemPrompt.openAiPrompt = const metaResponseDefaultSettings = WorkspaceMetaResponse.defaultSettings;
currWorkspace.openAiPrompt || ""; console.log("currWorkspace.openAiPrompt", currWorkspace.openAiPrompt)
Object.keys(metaResponseDefaultSettings).map((feature) => {
metaResponseDefaultSettings[feature].config.systemPrompt.content =
data.openAiPrompt || currWorkspace.openAiPrompt ||
WorkspaceMetaResponse.defaultSystemPrompt;
});
data.metaResponseSettings = JSON.stringify( data.metaResponseSettings = JSON.stringify(
metaResponseDefaultSettings metaResponseDefaultSettings
); );
@ -583,173 +590,4 @@ function workspaceEndpoints(app) {
} }
); );
} }
module.exports = { workspaceEndpoints };
const metaResponseDefaultSettings = {
inputs: {
isEnabled: false,
config: {
systemPrompt: {
isEnabled: false,
content: "",
openAiPrompt: "",
overrideSystemPrompt: false,
suggestionsList: [
{
title: "",
content: "",
},
],
canEdit: ["admin", "manager"],
},
promptSchema: {
content: "## Prompt Guidelines\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```\n\ninput types:\n```json\n{\n \"type\":\"options\",\n \"data\":{\n \"options\":[\n {\n \"label\":\"Restart Router\",\n \"value\":\"restart_router\"\n },\n {\n \"label\":\"Check Service Status\",\n \"value\":\"check_service_status\"\n },\n {\n \"label\":\"Contact Support\",\n \"value\":\"contact_support\"\n }\n ]\n },\n \"settings\":{\n \"allowMultiple\":false,\n \"displayType\":\"buttons\"\n }\n}\n```\n\n```json\n{\n \"type\":\"range\",\n \"data\":{\n \"min\":1,\n \"max\":10,\n \"step\":1\n },\n \"settings\":{\n \"showValue\":true\n }\n}\n```\n\n```json\n{\n \"type\":\"rating\",\n \"data\":{\n \"max\":5,\n \"defaultValue\":3,\n \"icon\":\"star\"\n }\n}\n```\n\n```json\n{\n \"type\":\"date\",\n \"settings\":{\n \"format\":\"YYYY-MM-DD\",\n \"minDate\":\"2021-01-01\",\n \"maxDate\":\"2023-12-31\"\n }\n}\n```",
schemas: [
{
title: "All Input Types",
content: "## Prompt Guidelines\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```\n\ninput types:\n```json\n{\n \"type\":\"options\",\n \"data\":{\n \"options\":[\n {\n \"label\":\"Restart Router\",\n \"value\":\"restart_router\"\n },\n {\n \"label\":\"Check Service Status\",\n \"value\":\"check_service_status\"\n },\n {\n \"label\":\"Contact Support\",\n \"value\":\"contact_support\"\n }\n ]\n },\n \"settings\":{\n \"allowMultiple\":false,\n \"displayType\":\"buttons\"\n }\n}\n```\n\n```json\n{\n \"type\":\"range\",\n \"data\":{\n \"min\":1,\n \"max\":10,\n \"step\":1\n },\n \"settings\":{\n \"showValue\":true\n }\n}\n```\n\n```json\n{\n \"type\":\"rating\",\n \"data\":{\n \"max\":5,\n \"defaultValue\":3,\n \"icon\":\"star\"\n }\n}\n```\n\n```json\n{\n \"type\":\"date\",\n \"settings\":{\n \"format\":\"YYYY-MM-DD\",\n \"minDate\":\"2021-01-01\",\n \"maxDate\":\"2023-12-31\"\n }\n}\n```",
},
{
title: "Suggestions Buttons Type",
content: "## Prompt Guidelines\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```",
},
],
overrideWorkspacePrompt: false,
canEdit: ["admin", "manager"],
},
components: {
dropDownMenu: {
isEnabled: false,
options: [],
description: "Drop Down menu best to select between functional derisions, ie: continue, Repeat or Move to a new sequence.. etc",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/dropdown-menu",
},
optionsList: {
isEnabled: false,
options: [],
description: "Best suited for expansion on a topic",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-list",
},
optionsButtons: {
isEnabled: false,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-buttons",
},
multiSelectCheckboxes: {
isEnabled: false,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/multi-select-checkboxes",
},
},
},
permissions: ["user"],
description: "Traditionally, interaction with AnythingLLM occurs through a text area. Meta Inputs enhance this by offering alternative interaction methods, including option buttons, multi-select checkboxes, sliders, drop-down menus, and date/time selectors. To utilize these components, you'll need to guide the LLM on incorporating them into its responses with a specific schema",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs",
},
sentiments: {
isEnabled: false,
config: {
systemPrompt: {
isEnabled: false,
content: "",
openAiPrompt: "",
overrideSystemPrompt: false,
suggestionsList: [
{
title: "",
content: "",
},
],
canEdit: ["admin", "manager"],
},
promptSchema: {
content: "",
schemas: [
{
title: "",
content: "",
},
],
overrideWorkspacePrompt: false,
canEdit: ["admin", "manager"],
},
components: {
dropDownMenu: {
isEnabled: false,
options: [],
},
optionsList: {
isEnabled: false,
options: [],
},
optionsButtons: {
isEnabled: false,
options: [],
},
multiSelectCheckboxes: {
isEnabled: false,
options: [],
},
},
},
permissions: ["user"],
description: "Activate to enable the AI to analyze and adapt its responses based on the emotional tone of the conversation, enhancing interaction personalization",
infoLink: "https://docs.anythingllm.com/docs/meta-response/sentiments",
},
avatars: {
isEnabled: false,
config: {
systemPrompt: {
isEnabled: false,
content: "",
openAiPrompt: "",
overrideSystemPrompt: false,
suggestionsList: [
{
title: "",
content: "",
},
],
canEdit: ["admin", "manager"],
},
promptSchema: {
content: "",
schemas: [
{
title: "",
content: "",
},
],
overrideWorkspacePrompt: false,
canEdit: ["admin", "manager"],
},
components: {
dropDownMenu: {
isEnabled: false,
options: [],
},
optionsList: {
isEnabled: false,
options: [],
},
optionsButtons: {
isEnabled: false,
options: [],
},
multiSelectCheckboxes: {
isEnabled: false,
options: [],
},
},
},
permissions: ["user"],
description: "Enable avatars to reflect user sentiments, allowing the AI to visually empathize and convey understanding through changes in its profile image based on the meta object's sentiment data.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/avatars",
},
};
module.exports = { workspaceEndpoints };

View File

@ -63,7 +63,211 @@ const WorkspaceMetaResponse = {
console.error(error.message); console.error(error.message);
return { workspace: null, message: error.message }; return { workspace: null, message: error.message };
} }
} },
defaultSystemPrompt: "Given the following conversation, relevant context, and a follow up question, reply with an answer to the current question the user is asking. Return only your response to the question given the above information following the users instructions as needed.\ngive user some options",
defaultSettings: {
inputs: {
isEnabled: true,
config: {
systemPrompt: {
isEnabled: true,
openAiPrompt: "",
overrideSystemPrompt: false,
content: "",
active: 0,
list: [
{
title: "original prompt",
content: "",
},
],
canEdit: ["admin", "manager"],
},
promptSchema: {
active: 0,
list: [
{
title: "All Input Types",
content: "## Prompt Guidelines\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n- Important follow strictly the json schema examples provided below\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```\n\ninput types:\n```json\n{\n \"inputs\": {\n \"type\":\"options\",\n \"data\":{\n \"options\":[\n {\n \"label\":\"Restart Router\",\n \"value\":\"restart_router\"\n },\n {\n \"label\":\"Check Service Status\",\n \"value\":\"check_service_status\"\n },\n {\n \"label\":\"Contact Support\",\n \"value\":\"contact_support\"\n }\n ]\n },\n \"settings\":{\n \"allowMultiple\":false,\n \"displayType\":\"buttons\"\n }\n }\n}\n```\n\n```json\n{\n \"inputs\": {\n \"type\":\"range\",\n \"data\":{\n \"min\":1,\n \"max\":10,\n \"step\":1\n },\n \"settings\":{\n \"showValue\":true\n }\n }\n}\n```\n\n```json\n{\n\"inputs\": {\n \"type\":\"rating\",\n \"data\":{\n \"max\":5,\n \"defaultValue\":3,\n \"icon\":\"star\"\n }\n }\n}\n```\n\n```json\n{\n\"inputs\": {\n \"type\":\"date\",\n \"settings\":{\n \"format\":\"YYYY-MM-DD\",\n \"minDate\":\"2021-01-01\",\n \"maxDate\":\"2023-12-31\"\n }\n}\n}\n```\n---\n",
},
{
title: "Suggestions Buttons Type",
content: "## Prompt Guidelines Suggestions Buttons Type\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n- Important follow strictly the json schema examples provided below\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```",
},
],
overrideWorkspacePrompt: false,
canEdit: ["admin", "manager"],
},
components: {
optionsButtons: {
isEnabled: true,
isDefault: true,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-buttons",
},
optionsList: {
isEnabled: false,
isDefault: false,
options: [],
description: "Best suited for expansion on a topic",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-list",
},
multiSelectCheckboxes: {
isEnabled: false,
isDefault: false,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/multi-select-checkboxes",
},
dropDownMenu: {
isEnabled: false,
isDefault: false,
options: [],
description: "Drop Down menu best to select between functional derisions, ie: continue, Repeat or Move to a new sequence.. etc",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/dropdown-menu",
},
},
},
permissions: ["user"],
description: "Traditionally, interaction with AnythingLLM occurs through a text area. Meta Inputs enhance this by offering alternative interaction methods, including option buttons, multi-select checkboxes, sliders, drop-down menus, and date/time selectors. To utilize these components, you'll need to guide the LLM on incorporating them into its responses with a specific schema",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs",
},
sentiments: {
isEnabled: false,
config: {
systemPrompt: {
isEnabled: false,
openAiPrompt: "",
overrideSystemPrompt: false,
content: "",
active: 0,
list: [
{
title: "original prompt",
content: "",
},
],
canEdit: ["admin", "manager"],
},
promptSchema: {
active: 0,
list: [
{
title: "All Input Types",
content: "## Prompt Guidelines All Input Types\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```\n\ninput types:\n```json\n{\n \"type\":\"options\",\n \"data\":{\n \"options\":[\n {\n \"label\":\"Restart Router\",\n \"value\":\"restart_router\"\n },\n {\n \"label\":\"Check Service Status\",\n \"value\":\"check_service_status\"\n },\n {\n \"label\":\"Contact Support\",\n \"value\":\"contact_support\"\n }\n ]\n },\n \"settings\":{\n \"allowMultiple\":false,\n \"displayType\":\"buttons\"\n }\n}\n```\n\n```json\n{\n \"type\":\"range\",\n \"data\":{\n \"min\":1,\n \"max\":10,\n \"step\":1\n },\n \"settings\":{\n \"showValue\":true\n }\n}\n```\n\n```json\n{\n \"type\":\"rating\",\n \"data\":{\n \"max\":5,\n \"defaultValue\":3,\n \"icon\":\"star\"\n }\n}\n```\n\n```json\n{\n \"type\":\"date\",\n \"settings\":{\n \"format\":\"YYYY-MM-DD\",\n \"minDate\":\"2021-01-01\",\n \"maxDate\":\"2023-12-31\"\n }\n}\n```",
},
{
title: "Suggestions Buttons Type",
content: "## Prompt Guidelines Suggestions Buttons Type\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```",
},
],
overrideWorkspacePrompt: false,
canEdit: ["admin", "manager"],
},
components: {
optionsButtons: {
isEnabled: true,
isDefault: true,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-buttons",
},
optionsList: {
isEnabled: false,
isDefault: false,
options: [],
description: "Best suited for expansion on a topic",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-list",
},
multiSelectCheckboxes: {
isEnabled: false,
isDefault: false,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/multi-select-checkboxes",
},
dropDownMenu: {
isEnabled: false,
isDefault: false,
options: [],
description: "Drop Down menu best to select between functional derisions, ie: continue, Repeat or Move to a new sequence.. etc",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/dropdown-menu",
},
},
},
permissions: ["user"],
description: "Activate to enable the AI to analyze and adapt its responses based on the emotional tone of the conversation, enhancing interaction personalization",
infoLink: "https://docs.anythingllm.com/docs/meta-response/sentiments",
},
avatars: {
isEnabled: false,
config: {
systemPrompt: {
isEnabled: false,
openAiPrompt: "",
overrideSystemPrompt: false,
content: "",
active: 0,
list: [
{
title: "original prompt",
content: "",
},
],
canEdit: ["admin", "manager"],
},
promptSchema: {
active: 0,
list: [
{
title: "All Input Types",
content: "## Prompt Guidelines All Input Types\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\nResponse example:\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```\n\ninput types:\n```json\n{\n \"inputs\": {\n \"type\":\"options\",\n \"data\":{\n \"options\":[\n {\n \"label\":\"Restart Router\",\n \"value\":\"restart_router\"\n },\n {\n \"label\":\"Check Service Status\",\n \"value\":\"check_service_status\"\n },\n {\n \"label\":\"Contact Support\",\n \"value\":\"contact_support\"\n }\n ]\n },\n \"settings\":{\n \"allowMultiple\":false,\n \"displayType\":\"buttons\"\n }\n }\n}\n```\n\n```json\n{\n \"inputs\": {\n \"type\":\"range\",\n \"data\":{\n \"min\":1,\n \"max\":10,\n \"step\":1\n },\n \"settings\":{\n \"showValue\":true\n }\n }\n}\n```\n\n```json\n{\n\"inputs\": {\n \"type\":\"rating\",\n \"data\":{\n \"max\":5,\n \"defaultValue\":3,\n \"icon\":\"star\"\n }\n }\n}\n```\n\n```json\n{\n\"inputs\": {\n \"type\":\"date\",\n \"settings\":{\n \"format\":\"YYYY-MM-DD\",\n \"minDate\":\"2021-01-01\",\n \"maxDate\":\"2023-12-31\"\n }\n}\n}\n```",
},
{
title: "Suggestions Buttons Type",
content: "## Prompt Guidelines Suggestions Buttons Type\n- you are a helpful assistant, you will be provided a question to create a list of four elements\n- when requested to return structured data return them in a JSON object code block , don't introduce them or label them, just return them at the end of your response.\n- When presenting choices or detailed information, encapsulate the data in JSON format, aiming for a user-friendly interaction through:\n\t- type options: you will use this if options are a better way to seak users interaction, include displayTypess: buttons, list,checkbox, or dropdown based on the context.\n\t- type range: you will use this if the user is required to input a numeric between a certain range.\n\t- type rating: you will use this if the user should insert a rating, uswaly between one and five.\n\t- type date: you will use this if the user should insert a date.\n- if asked to return options return them as structured data, only when asked.\n- always return response as normal in markdown first then associate the data structure object below.\n- make your response rich in markdown.\n- if you find that your response at any time contain options follow the instructions above.\n---\n### Response Example\n#### Discover More\n**Fascinating Topic**\nExplore intriguing facts and details about your chosen subject, enhancing your understanding and curiosity.\n\n```json\n{\n \"inputs\": {\n \"type\": \"options\",\n \"data\": {\n \"options\": [\n {\n \"label\": \"Restart Router\",\n \"value\": \"restart router\"\n },\n {\n \"label\": \"Check Service Status\",\n \"value\": \"check service status\"\n },\n ... \n ],\n \"label\":\"Select Server \",\n \"description\":\"list of servers as described\"\n \n },\n \"settings\": {\n \"allowMultiple\": false,\n \"displayType\": \"chose one, buttons/list/dropdown\"\n }\n },\n \"sentiment\": \"happy\",\n \"style\": \"text\"\n}\n```",
},
],
overrideWorkspacePrompt: false,
canEdit: ["admin", "manager"],
},
components: {
optionsButtons: {
isEnabled: true,
isDefault: true,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-buttons",
},
optionsList: {
isEnabled: false,
isDefault: false,
options: [],
description: "Best suited for expansion on a topic",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/options-list",
},
multiSelectCheckboxes: {
isEnabled: false,
isDefault: false,
options: [],
description: "Chat will provide answers with the LLM's general knowledge and document context that is found.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/multi-select-checkboxes",
},
dropDownMenu: {
isEnabled: false,
isDefault: false,
options: [],
description: "Drop Down menu best to select between functional derisions, ie: continue, Repeat or Move to a new sequence.. etc",
infoLink: "https://docs.anythingllm.com/docs/meta-response/inputs/dropdown-menu",
},
},
},
permissions: ["user"],
description: "Enable avatars to reflect user sentiments, allowing the AI to visually empathize and convey understanding through changes in its profile image based on the meta object's sentiment data.",
infoLink: "https://docs.anythingllm.com/docs/meta-response/avatars",
},
},
}; };
module.exports = { WorkspaceMetaResponse }; module.exports = { WorkspaceMetaResponse };