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.2.3 to 1.2.4

5

index.js

@@ -56,2 +56,7 @@ "use strict";

classification(opts) {
const url = config.classificationsUrl();
return this._send_request(url, "post", opts);
}
engines() {

@@ -58,0 +63,0 @@ const url = config.enginesUrl();

2

package.json
{
"name": "openai-api",
"version": "1.2.3",
"version": "1.2.4",
"description": "A tiny client module for the openAI API",

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

@@ -103,2 +103,22 @@ # openai-api

### Classification API call
```js
(async () => {
const gptResponse = await openai.classification({
"examples": [
["A happy moment", "Positive"],
["I am sad.", "Negative"],
["I am feeling awesome", "Positive"]
],
"labels": ["Positive", "Negative", "Neutral"],
"query": "It is a raining day :(",
"search_model": "ada",
"model": "curie"
});
console.log(gptResponse.data);
})();
```
### Engines API call

@@ -105,0 +125,0 @@

@@ -51,2 +51,17 @@ require('dotenv').config();

it("should handle classification", async function () {
const result = await openai.classification({
examples: [
["A happy moment", "Positive"],
["I am sad.", "Negative"],
["I am feeling awesome", "Positive"],
],
labels: ["Positive", "Negative", "Neutral"],
query: "It is a raining day :(",
search_model: "ada",
model: "curie",
});
expect(result).to.be.ok;
});
it('should handle engines', async function () {

@@ -53,0 +68,0 @@ const result = await openai.engines();

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