Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into NEXUS-1291
  • Loading branch information
MarcusviniciusLsantos committed May 22, 2024
2 parents 04feae0 + a01036e commit 7eabf38
Show file tree
Hide file tree
Showing 14 changed files with 686 additions and 416 deletions.
50 changes: 40 additions & 10 deletions src/api/nexusaiAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const request = {
(err) => {
Sentry.captureException(err);

if (get(err, 'config.hideGenericErrorAlert')) {
throw err;
}

if (err.response.status === 500 || err.response.status === 408) {
store.state.alert = {
text:
Expand Down Expand Up @@ -164,10 +168,21 @@ export default {
);
},

createIntelligenceContentBaseText({ contentBaseUuid, text }) {
return request.$http.post(`api/${contentBaseUuid}/content-bases-text/`, {
text,
});
createIntelligenceContentBaseText({
contentBaseUuid,
text,
hideGenericErrorAlert = false,
}) {
return request.$http.post(
`api/${contentBaseUuid}/content-bases-text/`,
{
text,
},
{
routerName: 'contentBase-text-create',
hideGenericErrorAlert,
},
);
},

listIntelligenceContentBaseTexts({ contentBaseUuid }) {
Expand All @@ -178,12 +193,17 @@ export default {
contentBaseUuid,
contentBaseTextUuid,
text,
hideGenericErrorAlert = false,
}) {
return request.$http.put(
`api/${contentBaseUuid}/content-bases-text/${contentBaseTextUuid}/`,
{
text,
},
{
routerName: 'contentBase-text-edit',
hideGenericErrorAlert,
},
);
},

Expand Down Expand Up @@ -243,10 +263,17 @@ export default {
edit({ projectUuid, values }) {
const { model, ...others } = values;

return request.$http.patch(`api/${projectUuid}/llm/`, {
model,
setup: others,
});
return request.$http.patch(
`api/${projectUuid}/llm/`,
{
model,
setup: others,
},
{
routerName: 'brain-tunings-edit',
hideGenericErrorAlert: true,
},
);
},

advanced: {
Expand All @@ -268,12 +295,15 @@ export default {
},

edit({ projectUuid, data }) {
return request.$http.put(`api/${projectUuid}/customization/`, data);
return request.$http.put(`api/${projectUuid}/customization/`, data, {
routerName: 'brain-customization-edit',
hideGenericErrorAlert: true,
});
},

delete({ projectUuid, id }) {
return request.$http.delete(
`api/${projectUuid}/customization?id=${id}`,
`api/${projectUuid}/customization/?id=${id}`,
);
},
},
Expand Down
40 changes: 40 additions & 0 deletions src/components/QuickTest/QuickTestWarn.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<template>
<section class="quick-test-warn">
<UnnnicIcon
:icon="icon"
scheme="inherit"
size="sm"
/>

<UnnnicIntelligenceText
family="secondary"
size="body-gt"
color="inherit"
>
{{ text }}
</UnnnicIntelligenceText>
</section>
</template>

<script>
export default {
props: {
icon: String,
text: String,
},
};
</script>

<style lang="scss" scoped>
@import '~@weni/unnnic-system/src/assets/scss/unnnic.scss';
.quick-test-warn {
display: flex;
align-items: center;
column-gap: $unnnic-spacing-xs;
background-color: $unnnic-color-aux-yellow-100;
color: $unnnic-color-aux-yellow-700;
padding: $unnnic-spacing-ant;
border-radius: $unnnic-border-radius-sm;
}
</style>
5 changes: 5 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
}
},
"router": {
"modal_save_changes_error": {
"title": "Error saving changes",
"description": "An error occurred while saving changes to the {tabs} tab. Try saving again.|An error occurred while saving changes to the {tabs} tabs. Try saving again."
},
"warn": {
"brain_is_deactivated": "Brain is deactivated.",
"click_here": "click here",
Expand Down Expand Up @@ -134,6 +138,7 @@
"active_to_see": "Activate Brain to see the agent preview",
"active_to_see_description": "Brain can be activated from the advanced options in the Tunings tab",
"placeholder": "Send a message to test your intelligent agent",
"save_changes_to_test_the_agent": "Save the changes to test the agent",
"field_changed_to_value": "Parameter {field} changed to {value}",
"flow_started": "Flow {name} started",
"flow_finished": "Flow finished"
Expand Down
5 changes: 5 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
}
},
"router": {
"modal_save_changes_error": {
"title": "Error al guardar los cambios",
"description": "Se ha producido un error al guardar los cambios en la pestaña {tabs}. Intente guardar de nuevo.|Se ha producido un error al guardar los cambios en las pestañas {tabs}. Intente guardar de nuevo."
},
"warn": {
"brain_is_deactivated": "Brain está desactivado.",
"click_here": "haz clic aquí",
Expand Down Expand Up @@ -134,6 +138,7 @@
"active_to_see": "Activar Brain para ver la vista previa del agente",
"active_to_see_description": "Activar Brain se puede hacer dentro de las opciones avanzadas en la pestaña Configuración",
"placeholder": "Envíe un mensaje para probar su agente inteligente",
"save_changes_to_test_the_agent": "Guarde los cambios para probar el agente",
"field_changed_to_value": "Parámetro {field} cambiada a {value}",
"flow_started": "Flujo {name} iniciado",
"flow_finished": "Flujo finalizado"
Expand Down
5 changes: 5 additions & 0 deletions src/locales/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
}
},
"router": {
"modal_save_changes_error": {
"title": "Erro ao salvar as alterações",
"description": "Ocorreu um erro ao salvar as alterações na aba {tabs}. Tente salvar novamente.|Ocorreu um erro ao salvar as alterações nas abas {tabs}. Tente salvar novamente."
},
"warn": {
"brain_is_deactivated": "O Brain está desativado.",
"click_here": "clique aqui",
Expand Down Expand Up @@ -134,6 +138,7 @@
"active_to_see": "Ative o Brain para ver o preview do agente",
"active_to_see_description": "A ativação do Brain pode ser feita dentro das opções avançadas na aba Ajustes",
"placeholder": "Envie uma mensagem para testar seu agente inteligente",
"save_changes_to_test_the_agent": "Salve as alterações para testar o agente",
"field_changed_to_value": "Parâmetro {field} alterado para {value}",
"flow_started": "Fluxo {name} iniciado",
"flow_finished": "Fluxo finalizado"
Expand Down
Loading

0 comments on commit 7eabf38

Please sign in to comment.