backend: separate App and server, add websocket endpoint, accept data directory command argument. initialize sqlalchemy database and models in new module. frontend: create backend class for managing ws connection, move ui to chat_screen, create scaffold chat and agent classes.
This commit is contained in:
1 parent
1e82796db1
commit
44f0b3589c
19 files changed
+936
-122
No files matched your search
@@ -0,0 +1,29 @@
|
||||
const WebSocket = require('ws');
|
||||
|
||||
const ws = new WebSocket('ws://localhost:5000/ws');
|
||||
|
||||
ws.on('open', function open() {
|
||||
const packet = JSON.stringify({ username: "test-user", password: "123456" });
|
||||
ws.send(packet);
|
||||
|
||||
runTest();
|
||||
});
|
||||
|
||||
ws.on('message', function incoming(data) {
|
||||
const jsonResponse = JSON.parse(data);
|
||||
console.log(jsonResponse);
|
||||
});
|
||||
|
||||
function runTest() {
|
||||
const message = {
|
||||
action: 'create-agent',
|
||||
body: {
|
||||
name: 'First Agent',
|
||||
description: 'First agent does nothing',
|
||||
kind: 'simple',
|
||||
data: {}
|
||||
},
|
||||
};
|
||||
|
||||
ws.send(JSON.stringify(message)); // Send the create-agent message
|
||||
}
|
||||
Reference in new issue
Block a user