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

@singlestore/ai

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@singlestore/ai - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

2

dist/index.d.ts
import { ChatCompletionMessageParam } from 'openai/resources/chat/completions';
import { OpenAI } from 'openai';
type ChatCompletionStream = AsyncIterable<string>;
type ChatCompletionStream = AsyncGenerator<string>;
type ChatCompletionMessage = ChatCompletionMessageParam;

@@ -6,0 +6,0 @@ interface ChatCompletionCreateOptions<T = any> {

@@ -134,27 +134,25 @@ "use strict";

}));
const isStreamResponse = (_response) => !!(_options == null ? void 0 : _options.stream);
if (isStreamResponse(response)) {
function asyncIterableFromStream(stream) {
return __asyncGenerator(this, null, function* () {
var _a2;
if (typeof response === "object" && response && "choices" in response) {
return ((_b = response.choices[0]) == null ? void 0 : _b.message.content) || "";
}
return function() {
return __asyncGenerator(this, null, function* () {
var _a2;
try {
for (var iter = __forAwait(response), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
const chunk = temp.value;
yield ((_a2 = chunk.choices[0]) == null ? void 0 : _a2.delta.content) || "";
}
} catch (temp) {
error = [temp];
} finally {
try {
for (var iter = __forAwait(stream), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
const chunk = temp.value;
yield ((_a2 = chunk.choices[0]) == null ? void 0 : _a2.delta.content) || "";
}
} catch (temp) {
error = [temp];
more && (temp = iter.return) && (yield new __await(temp.call(iter)));
} finally {
try {
more && (temp = iter.return) && (yield new __await(temp.call(iter)));
} finally {
if (error)
throw error[0];
}
if (error)
throw error[0];
}
});
}
return asyncIterableFromStream(response);
}
return ((_b = response.choices[0]) == null ? void 0 : _b.message.content) || "";
}
});
}();
});

@@ -161,0 +159,0 @@ }

{
"name": "@singlestore/ai",
"version": "0.0.9",
"version": "0.0.10",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "sideEffects": false,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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