New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

llm-prompt-stream

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llm-prompt-stream - npm Package Compare versions

Comparing version

to
1.0.1

test/mock.ts

7

package.json
{
"name": "llm-prompt-stream",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -19,3 +19,6 @@ "scripts": {

"main": "dist/index.js",
"module": "dist/index.mjs"
"module": "dist/index.mjs",
"dependencies": {
"openai": "^4.86.1"
}
}

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

import OpenAI from "openai";
export const streamPrompt = (completion: any) => {

@@ -46,1 +48,11 @@ let buffer = "";

};
export const setUpCompletionForStream = async (env: any) => {
const openai = new OpenAI({ apiKey: env.OPENAI_API_KEY });
const completion = await openai.chat.completions.create({
stream: true,
messages: [],
model: "gpt-4o-mini",
});
return completion;
};

@@ -10,3 +10,4 @@ {

"sourceMap": true,
"strict": true
"strict": true,
"moduleResolution": "node"
},

@@ -16,2 +17,1 @@ "include": ["src"],

}