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

openai

Package Overview
Dependencies
Maintainers
4
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openai - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

.github/workflows/test.yml

9

base.ts

@@ -7,3 +7,3 @@ /* tslint:disable */

*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*

@@ -17,6 +17,7 @@ *

import { Configuration } from "./configuration";
import type { Configuration } from './configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';

@@ -69,6 +70,6 @@ export const BASE_PATH = "https://api.openai.com/v1".replace(/\/+$/, "");

export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}

@@ -7,3 +7,3 @@ /* tslint:disable */

*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*

@@ -17,5 +17,6 @@ *

import { Configuration } from "./configuration";
import { RequiredError, RequestArgs } from "./base";
import { AxiosInstance, AxiosResponse } from 'axios';
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
import { RequiredError } from "./base";

@@ -89,2 +90,3 @@ /**

function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") {

@@ -91,0 +93,0 @@ if (Array.isArray(parameter)) {

@@ -7,3 +7,3 @@ /* tslint:disable */

*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*

@@ -10,0 +10,0 @@ *

@@ -12,4 +12,4 @@ /**

*/
import { Configuration } from "./configuration";
import { AxiosInstance, AxiosRequestConfig } from 'axios';
import type { Configuration } from './configuration';
import type { AxiosInstance, AxiosRequestConfig } from 'axios';
export declare const BASE_PATH: string;

@@ -54,4 +54,3 @@ /**

field: string;
name: "RequiredError";
constructor(field: string, msg?: string);
}

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

exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
// Some imports not used depending on template conditions
// @ts-ignore
const axios_1 = require("axios");

@@ -21,0 +19,0 @@ exports.BASE_PATH = "https://api.openai.com/v1".replace(/\/+$/, "");

@@ -12,5 +12,5 @@ /**

*/
import { Configuration } from "./configuration";
import { RequestArgs } from "./base";
import { AxiosInstance, AxiosResponse } from 'axios';
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
/**

@@ -17,0 +17,0 @@ *

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

function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
if (parameter == null)
return;
if (typeof parameter === "object") {

@@ -96,0 +98,0 @@ if (Array.isArray(parameter)) {

@@ -7,3 +7,3 @@ /* tslint:disable */

*
* The version of the OpenAPI document: 1.1.0
* The version of the OpenAPI document: 1.2.0
*

@@ -10,0 +10,0 @@ *

{
"name": "openai",
"version": "3.1.0",
"version": "3.2.0",
"description": "Node.js library for the OpenAI API",

@@ -5,0 +5,0 @@ "repository": {

@@ -26,3 +26,3 @@ # OpenAI Node.js Library

const completion = await openai.createCompletion({
model: "text-davinci-002",
model: "text-davinci-003",
prompt: "Hello world",

@@ -43,3 +43,3 @@ });

{
model: "text-davinci-002",
model: "text-davinci-003",
prompt: "Hello world",

@@ -63,3 +63,3 @@ },

const completion = await openai.createCompletion({
model: "text-davinci-002",
model: "text-davinci-003",
prompt: "Hello world",

@@ -78,2 +78,6 @@ });

### Streaming completions
Streaming completions (`stream=true`) are not natively supported in this package yet, but [a workaround exists](https://github.com/openai/openai-node/issues/18#issuecomment-1369996933) if needed.
## Upgrade guide

@@ -85,3 +89,4 @@

- The function signature of `createCompletion(engineId, params)` changed to `createCompletion(params)`. The value previously passed in as the `engineId` argument should now be passed in as `model` in the params object (e.g. `createCompletion({ model: "text-davinci-002, ... })`)
- The function signature of `createCompletion(engineId, params)` changed to `createCompletion(params)`. The value previously passed in as the `engineId` argument should now be passed in as `model` in the params object (e.g. `createCompletion({ model: "text-davinci-003", ... })`)
- Replace any `createCompletionFromModel(params)` calls with `createCompletion(params)`

@@ -88,0 +93,0 @@ ## Thanks

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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