openai-api
Advanced tools
Comparing version 1.0.14 to 1.0.15
{ | ||
"name": "openai-api", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "A tiny client module for the openAI API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,33 +20,29 @@ # openai-api | ||
```js | ||
const OpenAI = require('openai-api'); | ||
const OPEN_AI_API_KEY = #################### | ||
const openai = new OpenAI(OPEN_AI_API_KEY); | ||
(async () => { | ||
await const gptResponse = openai.complete({ | ||
engine: 'davinci', | ||
prompt: 'this is a test', | ||
maxTokens: 5, | ||
temperature: 0.9, | ||
topP: 1, | ||
presencePenalty: 0, | ||
frequencyPenalty: 0, | ||
bestOf: 1, | ||
n: 1, | ||
stream: false, | ||
stop: ['\n', "testing"] | ||
}); | ||
console.log(gptResponse.data); | ||
const gptResponse = await openai.complete({ | ||
engine: 'davinci', | ||
prompt: 'this is a test', | ||
maxTokens: 5, | ||
temperature: 0.9, | ||
topP: 1, | ||
presencePenalty: 0, | ||
frequencyPenalty: 0, | ||
bestOf: 1, | ||
n: 1, | ||
stream: false, | ||
stop: ['\n', "testing"] | ||
}); | ||
console.log(gptResponse.data); | ||
})(); | ||
(async () => { | ||
await const gptResponse = openai.search({ | ||
engine: 'davinci', | ||
documents: ["White House", "hospital", "school"], | ||
query: "the president" | ||
}); | ||
console.log(gptResponse.data); | ||
const gptResponse = await openai.search({ | ||
engine: 'davinci', | ||
documents: ["White House", "hospital", "school"], | ||
query: "the president" | ||
}); | ||
console.log(gptResponse.data); | ||
})(); | ||
``` |
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
5423
48