Skip to content

Instantly share code, notes, and snippets.

@mpmisko
Created June 4, 2023 19:59
Show Gist options
  • Select an option

  • Save mpmisko/6068fb43884e12d8602079e9dc898294 to your computer and use it in GitHub Desktop.

Select an option

Save mpmisko/6068fb43884e12d8602079e9dc898294 to your computer and use it in GitHub Desktop.
Client for the MediMind backend.
const io = require('socket.io-client');
const socket = io('http://0.0.0.0:8080');
const conversation = {
metadata: {
'id': '1234567890',
'fingerprint': '1234567890',
'source': 'www.reddit.com',
'timestamp': '2018-01-01T00:00:00.000Z',
},
conversation: ['What is the optimal salt intake?'],
settings: {
instruction_type: 1
}
};
socket.on('articles', (data) => {
console.log('articles');
console.log(data);
});
socket.on('llm_response', (data) => {
console.log('llm_response');
console.log(data);
});
socket.on('error_pubmed', (data) => {
console.log('pubmed error');
console.log(data);
});
socket.on('error_llm', (data) => {
console.log('error_llm');
console.log(data);
});
socket.emit('message', JSON.stringify(conversation));
setTimeout(() => {
socket.close();
}, 100000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment