// Primer mensaje
const res1 = await fetch('https://api.thaliq.com/api/agent/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'tq_live_xxx',
},
body: JSON.stringify({ message: 'Hola, necesito ayuda' }),
});
const data1 = await res1.json();
const conversationId = data1.data.conversationId;
// Segundo mensaje (con contexto)
const res2 = await fetch('https://api.thaliq.com/api/agent/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'tq_live_xxx',
},
body: JSON.stringify({
message: '¿Cuanto cuesta el plan Growth?',
conversationId,
}),
});