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.5 to 1.2.6

6

index.js

@@ -6,2 +6,4 @@ "use strict";

const DEFAULT_ENGINE = "davinci";
class OpenAI {

@@ -35,3 +37,3 @@ constructor(api_key) {

complete(opts) {
const url = config.completionURL(opts.engine);
const url = config.completionURL(opts.engine || DEFAULT_ENGINE);
delete opts.engine;

@@ -48,3 +50,3 @@

search(opts) {
const url = config.searchURL(opts.engine)
const url = config.searchURL(opts.engine || DEFAULT_ENGINE)
delete opts.engine;

@@ -51,0 +53,0 @@ return this._send_request(url, 'post', opts);

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

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

@@ -76,2 +76,14 @@ require('dotenv').config();

it('should use the davinci engine by default', async function () {
const result = await openai.complete({
prompt: "this is a test",
maxTokens: 5,
temperature: 0.9,
frequencyPenalty: 0,
bestOf: 1,
stop: ["\n", "engine test"]
});
expect(result).to.be.ok;
});
it('should return a default value from the encode function', async function () {

@@ -78,0 +90,0 @@ const result = await openai.encode('this is a string')

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