First commit.

This commit is contained in:
2025-11-18 11:02:39 +01:00
parent e57266f93d
commit d4c4ccfc18
16 changed files with 874 additions and 1 deletions

33
index.js Normal file
View File

@@ -0,0 +1,33 @@
import ChatModel from "./python_bindings.js";
const chat = new ChatModel({ "model":"something" });
//await chat.setProperty( "model", "something");
await chat.setProperty( "tokenizer", 123 );
const modelResponse = await chat.getModelPath();
console.log(modelResponse); // { model: "something" }
const tokenizerResponse = await chat.getTokenizer();
console.log(tokenizerResponse); // { model: 123 }
let response = await chat.increment({ by: 5 });
console.log("Incremented counter:", response.counter);
response = await chat.increment({ by: 2 });
console.log("Incremented counter:", response.counter);
response = await chat.increment({ by: 2 });
console.log("Incremented counter:", response.counter);
chat.onMessage( function( data ) {
console.log( data );
} );
chat.testStream();
chat.end();