- {Object.keys(settings.config.components).map((component, index) => {
- const componentLabel = component
- .split(/(?=[A-Z])/)
- .map((s) => s.charAt(0).toUpperCase() + s.slice(1))
- .join(" ");
- const _componentLabel = settings.config.components[component]
- .isEnabled
- ? `${componentLabel} (Enabled)`
- : `Enable ${componentLabel}`;
- const handleComponentUpdate = (enabled) => {
+
+
+
+ {settings.config.systemPrompt.isEnabled && (
+
+
+ onUpdateSettings({
+ ...settings,
+ config: {
+ ...settings.config,
+ systemPrompt: {
+ ...settings.config.systemPrompt,
+ content: newContent,
+ },
+ },
+ })
+ }
+ code
+ initialRows={6}
+ />
+
+ onUpdateSettings({
+ ...settings,
+ config: {
+ ...settings.config,
+ systemPrompt: {
+ ...settings.config.systemPrompt,
+ override,
+ },
+ },
+ })
+ }
+ />
+
+ )}
+
+
+
+
+ {settings.config.promptSchema.schemas.map((schema, index) => (
+
+ ))}
+
+
+
+
+
+ {Object.keys(settings.config.components).map((component, index) => {
+ const componentLabel = component
+ .split(/(?=[A-Z])/)
+ .map((s) => s.charAt(0).toUpperCase() + s.slice(1))
+ .join(" ");
+ const _componentLabel = settings.config.components[component]
+ .isEnabled
+ ? `${componentLabel} (Enabled)`
+ : `Enable ${componentLabel}`;
+ const handleComponentUpdate = (enabled) => {
+ onUpdateSettings({
+ ...settings,
+ config: {
+ ...settings.config,
+ components: {
+ ...settings.config.components,
+ [component]: {
+ ...settings.config.components[component],
+ isEnabled: enabled,
+ },
+ },
+ },
+ });
+ showToast(
+ `${componentLabel} has been ${
+ enabled ? "enabled" : "disabled"
+ }`,
+ "success",
+ { clear: true }
+ );
+ };
+ return (
+
+
+
);
- };
- return (
-
-
-
- );
- })}
+ })}
+
);
diff --git a/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx b/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx
index 599f8688..87f7ff2d 100644
--- a/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx
+++ b/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx
@@ -75,8 +75,8 @@ export default function MetaResponseSettings({ workspace }) {
diff --git a/server/endpoints/workspaces.js b/server/endpoints/workspaces.js
index 07a0acb5..87b72345 100644
--- a/server/endpoints/workspaces.js
+++ b/server/endpoints/workspaces.js
@@ -602,11 +602,15 @@ const metaResponseDefaultSettings = {
canEdit: ["admin", "manager"],
},
promptSchema: {
- content: "",
- suggestionsList: [
+ 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: "",
- content: "",
+ 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,
@@ -662,7 +666,7 @@ const metaResponseDefaultSettings = {
},
promptSchema: {
content: "",
- suggestionsList: [
+ schemas: [
{
title: "",
content: "",
@@ -713,7 +717,7 @@ const metaResponseDefaultSettings = {
},
promptSchema: {
content: "",
- suggestionsList: [
+ schemas: [
{
title: "",
content: "",