Last active
June 3, 2025 13:24
-
-
Save jcnevado/716aa45379ffee5245a9e1d961948c3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var endpointUrl = 'wss://p2nfln7noe.execute-api.us-east-1.amazonaws.com/api/'; | |
var ws = new WebSocket(endpointUrl); | |
ws.onmessage = function(data) { | |
var event = JSON.parse(data); | |
if (event.type == 'SEARCH_RAG_START') { | |
//MOSTRAR LOADING | |
console.log("Message received..." + event.data); | |
} | |
if (event.type == 'SEARCH_RAG_RESULT') { | |
//MOSTRAR RESULTADOS | |
console.log("Message received..." + event.data); | |
} | |
if (event.type == 'SEARCH_RAG_ERR') { | |
//MOSTRAR RESULTADOS con error | |
console.log("Message received..." + event.data); | |
} | |
}; | |
//Consultar búsqueda | |
let event = { | |
"type": "SEARCH_RAG", | |
"prompt": "nota resumen sobre el clásico peruano", | |
"model": "claude-3-5-sonnet-20241022", | |
"outputformat": "libre" | |
} | |
ws.send(JSON.stringify(event)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment