Skip to content

Commit

Permalink
Merge branch 'feat/getuser' of https://github.com/weni-ai/vtex-webapp
Browse files Browse the repository at this point in the history
…into staging
  • Loading branch information
acnormun committed Feb 5, 2025
2 parents 22be73a + cf14345 commit 75e4193
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"agent": {
"details": {
"title": "Intelligent agents",
"description": "Enhance intelligent agents by enabling control over conversation flows based on user intentions. Customize language, tone, and behavior to give the agent a unique identity and improve communication quality. See the demonstration of the exchange and return agent interaction on the side.",
"description": "Enhance intelligent agents by enabling control over conversation flows based on user intentions. With the Starter Plan, customize language, tone, and behavior to give the agent a unique identity and improve communication quality. See the demonstration of the exchange and return agent interaction on the side.",
"skills": {
"title": "Agent Skills",
"analyze": "Analyze the context",
Expand Down
48 changes: 45 additions & 3 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@
},
"agent_gallery": {
"title": "Galería de agentes",
"added": "Agente agregado",
"added": "Agente agregado con éxito.",
"features": {
"abandoned_cart": {
"title": "Agente de recuperación de carrito",
"description": "Aumenta tus ventas recordando a los clientes los artículos que dejaron en el carrito.",
"description": "Recupera ventas recordando a los clientes los artículos que dejaron en el carrito.",
"disclaimer": "Este agente mejora la tasa de conversión, retiene clientes e impulsa la finalización de compras.",
"preferences": {
"restriction": "Restricciones de mensajes",
Expand Down Expand Up @@ -100,6 +100,48 @@
"title": "Configurando tu Weni App",
"description": "Estamos finalizando la configuración para garantizar una experiencia fluida."
},
"agent": {
"details": {
"title": "Agentes inteligentes",
"description": "Mejora los agentes inteligentes permitiendo el control de los flujos de conversación según las intenciones del usuario. Con el Plan Starter, personaliza el idioma, el tono y el comportamiento para darle al agente una identidad única y mejorar la calidad de la comunicación. Observa la demostración de la interacción del agente de cambios y devoluciones al lado.",
"skills": {
"title": "Habilidades del agente",
"analyze": "Analizar el contexto",
"comprehend": "Comprender demandas complejas",
"provide": "Ofrecer respuestas personalizadas"
},
"example": {
"description": "Demostración del agente de cambios y devoluciones"
}
},
"setup": {
"title": "Configura la personalidad de tu agente",
"forms": {
"name": "Nombre",
"occupation": {
"title": "Ocupación (opcional)",
"default": "Asistente inteligente"
},
"objective": {
"title": "Objetivo (opcional)",
"default": "Tu objetivo es responder preguntas de los clientes, informar el estado de los pedidos, proporcionar información sobre productos y facilitar compras. Tus principales funciones son: compras por WhatsApp y preguntas frecuentes."
},
"knowledge": {
"title": "Fuente de conocimiento",
"context": "Proporciona el contenido que tu agente utilizará para responder preguntas."
},
"error": {
"empty_input": "Completa esta información.",
"valid_url": "Ingresa una URL válida."
}
},
"buttons": {
"create_agent": "Crear agente"
}
},
"error": "No se pudo configurar el agente. Inténtalo nuevamente más tarde.",
"success": "Agente registrado con éxito."
},
"integration": {
"title": "Integra un canal de soporte",
"description": "Elige el canal que deseas utilizar y sigue los pasos para agregarlo.",
Expand All @@ -123,4 +165,4 @@
"description": "Inténtalo de nuevo o vuelve más tarde si el problema persiste.",
"button": "Intentar de nuevo"
}
}
}
2 changes: 1 addition & 1 deletion src/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"agent": {
"details": {
"title": "Agentes inteligentes",
"description": "Aprimore seus agentes permitindo o controle sobre fluxos de conversa com base nas intenções do usuário. Personalize o idioma, tom e comportamento para criar uma identidade única e melhorar a comunicação. Confira a demonstração do agente de trocas e devoluções ao lado.",
"description": "Aprimore agentes inteligentes permitindo o controle sobre fluxos de conversa com base nas intenções do usuário. Com o Plano Starter, personalize o idioma, tom e comportamento para dar ao agente uma identidade única e melhorar a qualidade da comunicação. Veja a demonstração da interação do agente de trocas e devoluções ao lado.",
"skills": {
"title": "Habilidades do agente",
"analyze": "Analisar contexto",
Expand Down
9 changes: 4 additions & 5 deletions src/pages/agent/AgentBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
} from '@vtex/shoreline';
import { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { agentLoading, getAgent, selectProject } from '../../store/projectSlice';
import { agentLoading, getAgent, loadingSetup, selectProject } from '../../store/projectSlice';
import { isAgentIntegrated, isWhatsAppIntegrated } from '../../store/userSlice';
import { useAgentBuilderSetup } from '../setup/useAgentBuilderSetup';
import { useUserSetup } from '../setup/useUserSetup';
Expand All @@ -47,7 +47,7 @@ export function AgentBuilder() {
const [errors, setErrors] = useState<{ [key in keyof FormState]?: string }>({});
const project = useSelector(selectProject);
const isWppIntegrated = useSelector(isWhatsAppIntegrated);
const isSetupLoading = false;
const isSetupLoading = useSelector(loadingSetup);
const isAgentLoading = useSelector(agentLoading)
const agentIntegrated = useSelector(isAgentIntegrated)
const { buildAgent } = useAgentBuilderSetup();
Expand All @@ -59,9 +59,9 @@ export function AgentBuilder() {
}, [initializeUser]);

const isValidURL = (url: string) => {
const urlPattern = /^[^\s]+\.com([/?#].*)?$/i;
const urlPattern = /^(https?:\/\/)?([\w-]+\.)+[\w-]{2,}([/?#].*)?$/i;
return urlPattern.test(url);
};
};

const validateForm = () => {
const newErrors: { [key in keyof FormState]?: string } = {
Expand All @@ -84,7 +84,6 @@ export function AgentBuilder() {
const payload = Object.fromEntries(
Object.entries(form).filter(([_, value]) => value.trim())
);
console.log('funfou')
buildAgent(payload, project);
}
};
Expand Down

0 comments on commit 75e4193

Please sign in to comment.