@fugood/llama.node 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/darwin/arm64/llama-node.node +0 -0
- package/bin/darwin/x64/llama-node.node +0 -0
- package/bin/linux/arm64/llama-node.node +0 -0
- package/bin/linux/x64/llama-node.node +0 -0
- package/bin/linux-cuda/arm64/llama-node.node +0 -0
- package/bin/linux-cuda/x64/llama-node.node +0 -0
- package/bin/linux-vulkan/arm64/llama-node.node +0 -0
- package/bin/linux-vulkan/x64/llama-node.node +0 -0
- package/bin/win32/arm64/llama-node.node +0 -0
- package/bin/win32/arm64/node.lib +0 -0
- package/bin/win32/x64/llama-node.node +0 -0
- package/bin/win32/x64/node.lib +0 -0
- package/bin/win32-vulkan/arm64/llama-node.node +0 -0
- package/bin/win32-vulkan/arm64/node.lib +0 -0
- package/bin/win32-vulkan/x64/llama-node.node +0 -0
- package/bin/win32-vulkan/x64/node.lib +0 -0
- package/lib/binding.ts +2 -0
- package/package.json +1 -1
- package/src/LlamaCompletionWorker.cpp +8 -8
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/win32/arm64/node.lib
CHANGED
|
Binary file
|
|
Binary file
|
package/bin/win32/x64/node.lib
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/binding.ts
CHANGED
package/package.json
CHANGED
|
@@ -551,16 +551,16 @@ void LlamaCompletionWorker::OnOK() {
|
|
|
551
551
|
Napi::String::New(env, _result.text.c_str()));
|
|
552
552
|
|
|
553
553
|
Napi::Array tool_calls = Napi::Array::New(Napi::AsyncWorker::Env());
|
|
554
|
-
std::string
|
|
555
|
-
std::string
|
|
554
|
+
std::string reasoning_content = "";
|
|
555
|
+
std::string content;
|
|
556
556
|
if (!_stop) {
|
|
557
557
|
try {
|
|
558
558
|
common_chat_msg message = common_chat_parse(_result.text, static_cast<common_chat_format>(_chat_format));
|
|
559
559
|
if (!message.reasoning_content.empty()) {
|
|
560
|
-
reasoning_content =
|
|
560
|
+
reasoning_content = message.reasoning_content;
|
|
561
561
|
}
|
|
562
562
|
if (!message.content.empty()) {
|
|
563
|
-
content =
|
|
563
|
+
content = message.content;
|
|
564
564
|
}
|
|
565
565
|
for (size_t i = 0; i < message.tool_calls.size(); i++) {
|
|
566
566
|
const auto &tc = message.tool_calls[i];
|
|
@@ -582,11 +582,11 @@ void LlamaCompletionWorker::OnOK() {
|
|
|
582
582
|
if (tool_calls.Length() > 0) {
|
|
583
583
|
result.Set("tool_calls", tool_calls);
|
|
584
584
|
}
|
|
585
|
-
if (reasoning_content) {
|
|
586
|
-
result.Set("reasoning_content", Napi::String::New(env, reasoning_content
|
|
585
|
+
if (!reasoning_content.empty()) {
|
|
586
|
+
result.Set("reasoning_content", Napi::String::New(env, reasoning_content.c_str()));
|
|
587
587
|
}
|
|
588
|
-
if (content) {
|
|
589
|
-
result.Set("content", Napi::String::New(env, content
|
|
588
|
+
if (!content.empty()) {
|
|
589
|
+
result.Set("content", Napi::String::New(env, content.c_str()));
|
|
590
590
|
}
|
|
591
591
|
|
|
592
592
|
auto ctx = _sess->context();
|