Skip to content

This is a collection json schema objects for validating openai endpoints requests and responses. This library also contains tools for scraping new schemas from the official api docs on openai.com when they are updated.

Notifications You must be signed in to change notification settings

mirnes-cajlakovic/openai-schemas

Repository files navigation

openai-schemas

npm version js-standard-style

This is a collection json schema objects for validating openai endpoints requests and responses. This library also contains tools for scraping new schemas from the official api docs on openai.com when they are updated.

Installation

To install the package, use the following command:

npm install openai-schemas

Usage

This package can be used in several ways to access the create function within the chat schema. Below are the methods to require or import this function:

Method 1

Using destructuring at the top level:

const { create } = require('openai-schemas').schemas.chat;
console.log(create);
Method 2

Destructuring one level deeper:

const { chat: { create } } = require('openai-schemas').schemas;
console.log(create);
Method 3

Destructuring with full path:

const { schemas: { chat: { create } } } = require('openai-schemas');
console.log(create);

Reference

Below is a table of available json schemas. To see a full list, see the schemas/ directory.

Endpoint Schema
assistants createAssistantFile
assistants createAssistant
assistants deleteAssistantFile
assistants deleteAssistant
assistants fileObject
assistants getAssistantFile
assistants getAssistant
assistants listAssistantFiles
assistants listAssistants
assistants modifyAssistant
assistants object
audio createSpeech
audio createTranscription
audio createTranslation
chat create
chat object
chat streaming
embeddings create
embeddings object
files create
files delete
files list
files object
files retrieveContents
files retrieve
fineTuning cancel
fineTuning create
fineTuning eventObject
fineTuning listEvents
fineTuning list
fineTuning object
fineTuning retrieve
images createEdit
images create
images createVariation
images object
messages createMessage
messages fileObject
messages getMessageFile
messages getMessage
messages listMessageFiles
messages listMessages
messages modifyMessage
messages object
models delete
models list
models object
models retrieve
moderations create
moderations object
runs cancelRun
runs createRun
runs createThreadAndRun
runs getRun
runs getRunStep
runs listRuns
runs listRunSteps
runs modifyRun
runs object
runs stepObject
runs submitToolOutputs
threads createThread
threads deleteThread
threads getThread
threads modifyThread
threads object

About

This is a collection json schema objects for validating openai endpoints requests and responses. This library also contains tools for scraping new schemas from the official api docs on openai.com when they are updated.

Topics

Resources

Stars

Watchers

Forks