1.0.2 • Published 5 months ago

openai-schemas v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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.

EndpointSchema
assistantscreateAssistantFile
assistantscreateAssistant
assistantsdeleteAssistantFile
assistantsdeleteAssistant
assistantsfileObject
assistantsgetAssistantFile
assistantsgetAssistant
assistantslistAssistantFiles
assistantslistAssistants
assistantsmodifyAssistant
assistantsobject
audiocreateSpeech
audiocreateTranscription
audiocreateTranslation
chatcreate
chatobject
chatstreaming
embeddingscreate
embeddingsobject
filescreate
filesdelete
fileslist
filesobject
filesretrieveContents
filesretrieve
fineTuningcancel
fineTuningcreate
fineTuningeventObject
fineTuninglistEvents
fineTuninglist
fineTuningobject
fineTuningretrieve
imagescreateEdit
imagescreate
imagescreateVariation
imagesobject
messagescreateMessage
messagesfileObject
messagesgetMessageFile
messagesgetMessage
messageslistMessageFiles
messageslistMessages
messagesmodifyMessage
messagesobject
modelsdelete
modelslist
modelsobject
modelsretrieve
moderationscreate
moderationsobject
runscancelRun
runscreateRun
runscreateThreadAndRun
runsgetRun
runsgetRunStep
runslistRuns
runslistRunSteps
runsmodifyRun
runsobject
runsstepObject
runssubmitToolOutputs
threadscreateThread
threadsdeleteThread
threadsgetThread
threadsmodifyThread
threadsobject