openai-api
Advanced tools
Comparing version 1.0.4 to 1.0.5
14
index.js
@@ -11,2 +11,6 @@ "use strict"; | ||
__safe_cast = (number) => { | ||
return number ? Number(number) : null; | ||
} | ||
__send_request = (opts) => { | ||
@@ -22,6 +26,6 @@ const url = config.completionURL(opts.engine); | ||
prompt: opts.prompt, | ||
max_tokens: opts.maxTokens, | ||
temperature: opts.temperature, | ||
top_p: opts.topP, | ||
n: 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, | ||
@@ -53,2 +57,2 @@ stop: opts.stop | ||
module.exports = OpenAI; | ||
module.exports = OpenAI; |
{ | ||
"name": "openai-api", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "A tiny client module for the openAI API", | ||
@@ -11,3 +11,5 @@ "main": "index.js", | ||
"openai", | ||
"gpt-3" | ||
"gpt-3", | ||
"open", | ||
"ai" | ||
], | ||
@@ -17,4 +19,4 @@ "author": "Nikita Jerschow", | ||
"repository": { | ||
"type" : "git", | ||
"url" : "https://github.com/Njerschow/openai-api" | ||
"type": "git", | ||
"url": "https://github.com/Njerschow/openai-api" | ||
}, | ||
@@ -25,4 +27,4 @@ "dependencies": { | ||
"devDependencies": { | ||
"mocha": "^8.0.1" | ||
"mocha": "^8.1.1" | ||
} | ||
} |
@@ -17,3 +17,4 @@ const api_key = process.env.OPENAI_TEST_API_KEY; | ||
prompt: "this is a test", | ||
maxTokens: 5 | ||
maxTokens: 5, | ||
temperature: 0.9 | ||
}).then((result) => { | ||
@@ -20,0 +21,0 @@ assert.ok(result); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4557
98