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

openai-text-completions

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openai-text-completions - npm Package Compare versions

Comparing version

to
1.0.7

14

index.js

@@ -30,7 +30,13 @@ #!/usr/bin/env node

// Function for checking if the API key has been set
function checkAPIKey() {
if (apiKey === 'YOUR_API_KEY') {
console.error('API key has not been set. Use the "key" command to set the API key.');
} else {
async function checkAPIKey() {
try {
const response = await axios.get(`${baseURL}/v1/models`, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
}
});
console.log('API key is set.');
} catch (error) {
console.error('API key has not been set or is invalid. Use the "key" command to set the API key.');
}

@@ -37,0 +43,0 @@ }

{
"name": "openai-text-completions",
"version": "1.0.6",
"version": "1.0.7",
"description": "A global npm package for generating text completions using the OpenAI API",

@@ -5,0 +5,0 @@ "main": "index.js",