Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ollama

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ollama - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

29

dist/index.js

@@ -61,16 +61,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const chunk = _c;
const res = JSON.parse(chunk.toString());
if (res.done) {
return yield __await({
model: res.model,
createdAt: new Date(res.created_at),
context: res.context,
totalDuration: res.total_duration,
loadDuration: res.load_duration,
promptEvalCount: res.prompt_eval_count,
evalCount: res.eval_count,
evalDuration: res.eval_duration
});
const messages = chunk.toString().split("\n").filter(s => s.length !== 0);
for (const message of messages) {
const res = JSON.parse(message);
if (res.done) {
return yield __await({
model: res.model,
createdAt: new Date(res.created_at),
context: res.context,
totalDuration: res.total_duration,
loadDuration: res.load_duration,
promptEvalCount: res.prompt_eval_count,
evalCount: res.eval_count,
evalDuration: res.eval_duration
});
}
yield yield __await(res.response);
}
yield yield __await(res.response);
}

@@ -77,0 +80,0 @@ finally {

{
"type": "module",
"name": "ollama",
"version": "0.1.0",
"version": "0.1.1",
"description": "Interface with an ollama instance over HTTP.",

@@ -6,0 +6,0 @@ "main": "dist/index.js",

@@ -1,2 +0,2 @@

# node-ollama
# ollama
Interface with an ollama instance over HTTP.

@@ -3,0 +3,0 @@

@@ -45,18 +45,22 @@ import * as utils from "./utils.js";

for await (const chunk of response.body) {
const res: GenerateResponse | GenerateResponseEnd = JSON.parse(chunk.toString());
const messages = chunk.toString().split("\n").filter(s => s.length !== 0);
if (res.done) {
return {
model: res.model,
createdAt: new Date(res.created_at),
context: res.context,
totalDuration: res.total_duration,
loadDuration: res.load_duration,
promptEvalCount: res.prompt_eval_count,
evalCount: res.eval_count,
evalDuration: res.eval_duration
};
for (const message of messages) {
const res: GenerateResponse | GenerateResponseEnd = JSON.parse(message);
if (res.done) {
return {
model: res.model,
createdAt: new Date(res.created_at),
context: res.context,
totalDuration: res.total_duration,
loadDuration: res.load_duration,
promptEvalCount: res.prompt_eval_count,
evalCount: res.eval_count,
evalDuration: res.eval_duration
};
}
yield res.response;
}
yield res.response;
}

@@ -63,0 +67,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc