Skip to content

SmythOS Studio: Open-Source Visual AI Agent Builder and deployable runtime stack from SmythOS. Start with an intuitive drag-and-drop workspace, extend with custom code, and deploy your agents anywhere — local, cloud, or edge — with full governance and control.

Agent Deployments show common modals (#120)

ali-inkcod193678110a2
diff --git a/packages/app/src/react/features/embodiments/embodiment-configs.tsx b/packages/app/src/react/features/embodiments/embodiment-configs.tsx
index d9841e69..482bc383 100644
--- a/packages/app/src/react/features/embodiments/embodiment-configs.tsx
+++ b/packages/app/src/react/features/embodiments/embodiment-configs.tsx
@@ -5,8 +5,9 @@ import { EMBODIMENT_TYPE } from '../../shared/enums';
import ChatBotDialog from '../agent-settings/dialogs/ChatBot';
import ChatGptDialog from '../agent-settings/dialogs/ChatGpt';
import FormPreviewDialog from '../agent-settings/dialogs/FormPreview';
-import ChatbotCodeSnippetModal from '../agent-settings/modals/chatbotCode.modal';
+import ChatbotEmbodimentModal from './chatbot-embodiment-modal';
import FormEmbodimentModal from './form-embodiment-modal';
+import GptEmbodimentModal from './gpt-embodiment-modal';
export const AlwaysAvailableEmbodiments = [
'API',
@@ -166,14 +167,13 @@ export const getFormPreviewDialog = (
activeAgent={agent}
agentId={agentId}
currentData={currentData}
- refreshEmbodiments={() => refreshEmbodiments()}
style={{}}
/>
);
};
export const getCodeSnippetModal = (
- embodimentType: EMBODIMENT_TYPE.FORM | EMBODIMENT_TYPE.CHAT_BOT,
+ embodimentType: EMBODIMENT_TYPE.FORM | EMBODIMENT_TYPE.CHAT_BOT | EMBODIMENT_TYPE.CHAT_GPT,
isOpen: boolean,
closeModal: () => void,
agent,
@@ -188,7 +188,7 @@ export const getCodeSnippetModal = (
if (embodimentType === EMBODIMENT_TYPE.CHAT_BOT) {
return createPortal(
- <ChatbotCodeSnippetModal
+ <ChatbotEmbodimentModal
onClose={closeModal}
domain={agent?.domain?.[0]?.name}
embodimentData={embodimentsData?.find(
@@ -199,6 +199,10 @@ export const getCodeSnippetModal = (
);
}
+ if (embodimentType === EMBODIMENT_TYPE.CHAT_GPT) {
+ return createPortal(<GptEmbodimentModal onClose={closeModal} />, document.body);
+ }
+
if (embodimentType === EMBODIMENT_TYPE.FORM) {
return createPortal(
<FormEmbodimentModal
diff --git a/packages/app/src/react/features/embodiments/embodiment-helper.ts b/packages/app/src/react/features/embodiments/embodiment-helper.ts
index 1fad0473..103ae86a 100644
--- a/packages/app/src/react/features/embodiments/embodiment-helper.ts
+++ b/packages/app/src/react/features/embodiments/embodiment-helper.ts
@@ -161,7 +161,9 @@ export function structureAgentSetting(
// Add code snippet modal for chat bot (preload when it should be visible)
// Note: iframe-based components are conditionally rendered to allow reload as requested
if (
- (key === EMBODIMENT_TYPE.CHAT_BOT || key === EMBODIMENT_TYPE.FORM) &&
+ (key === EMBODIMENT_TYPE.CHAT_BOT ||
+ key === EMBODIMENT_TYPE.FORM ||
+ key === EMBODIMENT_TYPE.CHAT_GPT) &&
shouldCodeSnippetVisible(key, agentData)
) {
result.codeSnippetComponent = getCodeSnippetModal(
@@ -188,7 +190,9 @@ const shouldCodeSnippetVisible = (
},
) => {
return (
- (embodimentType === EMBODIMENT_TYPE.CHAT_BOT || embodimentType === EMBODIMENT_TYPE.FORM) &&
+ (embodimentType === EMBODIMENT_TYPE.CHAT_BOT ||
+ embodimentType === EMBODIMENT_TYPE.FORM ||
+ embodimentType === EMBODIMENT_TYPE.CHAT_GPT) &&
agentData?.agentDeployed &&
agentData.canUseEmbodiments
);