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

openai-api

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openai-api - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

20

index.js

@@ -8,14 +8,14 @@ "use strict";

constructor(api_key) {
this.__api_key = api_key;
this._api_key = api_key;
}
__safe_cast = (number) => {
_safe_cast = (number) => {
return number ? Number(number) : null;
}
__send_request = (opts) => {
_send_request = (opts) => {
const url = config.completionURL(opts.engine);
const reqOpts = {
headers: {
'Authorization': `Bearer ${this.__api_key}`,
'Authorization': `Bearer ${this._api_key}`,
'Content-Type': 'application/json'

@@ -26,6 +26,6 @@ }

prompt: opts.prompt,
max_tokens: this.__safe_cast(opts.maxTokens),
temperature: this.__safe_cast(opts.temperature),
top_p: this.__safe_cast(opts.topP),
n: this.__safe_cast(opts.n),
max_tokens: this._safe_cast(opts.maxTokens),
temperature: this._safe_cast(opts.temperature),
top_p: this._safe_cast(opts.topP),
n: this._safe_cast(opts.n),
stream: opts.stream,

@@ -38,3 +38,3 @@ stop: opts.stop

complete = function (opts) {
return this.__send_request(opts);
return this._send_request(opts);
}

@@ -46,3 +46,3 @@

headers: {
'Authorization': `Bearer ${this.__api_key}`,
'Authorization': `Bearer ${this._api_key}`,
'Content-Type': 'application/json'

@@ -49,0 +49,0 @@ }

{
"name": "openai-api",
"version": "1.0.7",
"version": "1.0.8",
"description": "A tiny client module for the openAI API",

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

@@ -33,3 +33,3 @@ # openai-api

stream: false,
stop: ['\n', "testing"]
stop: ['\n', "testing"]in
});

@@ -36,0 +36,0 @@

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