mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-09 04:20:42 +00:00
Revert "typescript bindings maintenance (#2363)"
As discussed on Discord, this PR was not ready to be merged. CI fails on
it.
This reverts commit a602f7fde7
.
Signed-off-by: Jared Van Bortel <jared@nomic.ai>
This commit is contained in:
@@ -131,8 +131,7 @@ bool PromptWorker::ResponseCallback(int32_t token_id, const std::string token)
|
||||
// Transform native data into JS data, passing it to the provided
|
||||
// `jsCallback` -- the TSFN's JavaScript function.
|
||||
auto token_id = Napi::Number::New(env, value->tokenId);
|
||||
auto token = Napi::Uint8Array::New(env, value->token.size());
|
||||
memcpy(token.Data(), value->token.data(), value->token.size());
|
||||
auto token = Napi::String::New(env, value->token);
|
||||
auto jsResult = jsCallback.Call({token_id, token}).ToBoolean();
|
||||
promise.set_value(jsResult);
|
||||
}
|
||||
|
Reference in New Issue
Block a user