Skip to content

Commit 0eebdd1

Browse files
Merge pull request #308 from SmythOS/Responsive-Embodiment-Tabs-86evbh920
test sidebar should have dynamic headers with width and drop down button
2 parents 68d5f41 + 3e3bbf6 commit 0eebdd1

File tree

5 files changed

+1012
-182
lines changed

5 files changed

+1012
-182
lines changed

packages/app/src/builder-ui/pages/builder/agent-settings.ts

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,54 @@ export async function openPostmanEmbodiment() {
905905
);
906906
}
907907

908+
export async function openVoiceEmbodiment() {
909+
Observability.observeInteraction('voice_embodiment_click', {
910+
position: 'top right of builder inside dropdown',
911+
});
912+
const { dev: testDomain, scheme } = builderStore.getState().agentDomains;
913+
const wrapContent = (content) => `<div id="voice-embodiment-wrapper">${content}</div>`;
914+
915+
if (!testDomain) {
916+
const content = wrapContent(
917+
'<div class="p-4">Agent domain is not set. Cannot provide Voice features</div>',
918+
);
919+
openEmbodimentDialog(
920+
content,
921+
{},
922+
EMBODIMENT_DESCRIPTIONS.voice.title,
923+
EMBODIMENT_DESCRIPTIONS.voice.tooltipTitle,
924+
);
925+
return;
926+
}
927+
928+
const voiceUrl = testDomain ? `${scheme}://${testDomain}/emb/voice` : '';
929+
930+
const content = wrapContent(`<div class="emb-instructions p-4 flex-row">
931+
<div id="talk-to-agent-wrapper">
932+
<div class="flex items-center justify-between">
933+
<label class="block text-sm font-medium text-gray-700 mb-1">Talk to Agent</label>
934+
<a href="${voiceUrl}" target="_blank" rel="noopener noreferrer">
935+
<div class="text-[#3C89F9] text-[13px] font-medium cursor-pointer flex items-center gap-1">Start Voice Chat
936+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
937+
<path d="M6.74674 2.3335H5.34389C3.49341 2.3335 2.33301 3.64376 2.33301 5.49802V10.5023C2.33301 12.3566 3.48775 13.6668 5.34389 13.6668H10.6542C12.5109 13.6668 13.6663 12.3566 13.6663 10.5023V9.4061" stroke="#3C89F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
938+
<path d="M13.6668 5.38279V2.3335M13.6668 2.3335H10.6176M13.6668 2.3335L8.91309 7.08723" stroke="#3C89F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
939+
</svg>
940+
</div>
941+
</a>
942+
</div>
943+
<p class="text-gray-700 font-normal">Starts a live voice session with the agent.</p>
944+
</div>
945+
</div>`);
946+
947+
const actions = {};
948+
openEmbodimentDialog(
949+
content,
950+
actions,
951+
EMBODIMENT_DESCRIPTIONS.voice.title,
952+
EMBODIMENT_DESCRIPTIONS.voice.tooltipTitle,
953+
);
954+
}
955+
908956
export async function openAlexaEmbodiment() {
909957
Observability.observeInteraction('alexa_embodiment_click', {
910958
position: 'top right of builder inside dropdown',
@@ -925,7 +973,6 @@ export async function openAlexaEmbodiment() {
925973
return;
926974
}
927975

928-
const voiceUrl = testDomain ? `${scheme}://${testDomain}/emb/voice` : '';
929976
const testUrl = testDomain ? `${scheme}://${testDomain}/alexa` : '';
930977
const prodUrl = prodDomain ? `${scheme}://${prodDomain}/alexa` : 'Agent is not deployed yet';
931978

@@ -989,21 +1036,6 @@ export async function openAlexaEmbodiment() {
9891036
</button>`;
9901037

9911038
const content = wrapContent(`<div class="emb-instructions p-4 flex-row">
992-
<div id="talk-to-agent-wrapper">
993-
<div class="flex items-center justify-between">
994-
<label class="block text-sm font-medium text-gray-700 mb-1">Talk to Agent</label>
995-
<a href="${voiceUrl}" target="_blank" rel="noopener noreferrer">
996-
<div class="text-[#3C89F9] text-[13px] font-medium cursor-pointer flex items-center gap-1">Start Voice Chat
997-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
998-
<path d="M6.74674 2.3335H5.34389C3.49341 2.3335 2.33301 3.64376 2.33301 5.49802V10.5023C2.33301 12.3566 3.48775 13.6668 5.34389 13.6668H10.6542C12.5109 13.6668 13.6663 12.3566 13.6663 10.5023V9.4061" stroke="#3C89F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
999-
<path d="M13.6668 5.38279V2.3335M13.6668 2.3335H10.6176M13.6668 2.3335L8.91309 7.08723" stroke="#3C89F9" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1000-
</svg>
1001-
</div>
1002-
</a>
1003-
</div>
1004-
<p class="text-gray-700 font-normal">Starts a live voice session with the agent.</p>
1005-
</div>
1006-
<hr class="my-4"/>
10071039
<div class="mb-4">
10081040
<label class="block text-sm font-medium text-gray-700 mb-1">Alexa Integration</label>
10091041
<p class="text-gray-700 font-normal">Publish as an Alexa Skill or deploy across managed Echo devices</p>
@@ -1618,9 +1650,10 @@ setEmbodimentHandlers({
16181650
openEmbodimentDialog,
16191651
openChatGPTEmbodiment,
16201652
openPostmanEmbodiment,
1653+
openVoiceEmbodiment,
1654+
openAlexaEmbodiment,
16211655
openChatbotEmbodiment,
16221656
openAPIEmbodiment,
16231657
openFormPreviewEmbodiment,
1624-
openAlexaEmbodiment,
16251658
openMCPEmbodiment,
16261659
});

0 commit comments

Comments
 (0)