1.0.15 • Published 1 year ago

openai-assistants v1.0.15

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Usage

import { AIHelper } from 'openai-assistants'

var client = new AIHelper('YOUR API KEY');

//Creation of assistant with no extra tools
client.CreateAssistant('My assistant name', 'my assitant description', 'reply every question in french', false, false)
.then(myAssistantId => { console.log('my newly created assistant is:', myAssistantId) })
.catch(err => console.error(err));

//Creation of assistant with code interpreter and local files
client.CreateAssistant('My assistant name', 'my assitant description', 'reply every question in french', true, false, ["./my_local_path_file1.txt", "./my_local_path_file2.txt"])
.then(myAssistantId => { console.log('my newly created assistant id is:', myAssistantId) })
.catch(err => console.error(err));

//create thread
client.CreateThread('someMessage')
.then(myThreadId => { console.log('my newly created thread id is:', myThreadId) })
.catch(err => console.error(err));

//run prompt on thread
client.CreateRun("some thread ID", "some assistnat ID", "refer to user as John", [{ role: 'user', content: 'some optional extra message to send before the run' }])
.then(myThreadId => { console.log('my newly created thread id is:', myThreadId) })
.catch(err => console.error(err));

client.GetAssistantId("some partial or full name of assistant")
.then(myAssistantId => { console.log('my assistant id is:', myAssistantId) })
.catch(err => console.error(err));
1.0.15

1 year ago

1.0.14

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago