1.4.0 • Published 4 months ago

openai-chat v1.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

AI chat (from openai.com)

Example Usage

import { ChatChannel } from './index.js'

const TOKEN = 'sk-...'
const options = {
  name: 'marv', //bot's name
  context: 2, //Recommended value. Corresponds to 4 messages of context
  prompt: 'You are Marv. Marv likes banter and can be quite rude'
}

const channel = new ChatChannel(TOKEN, options)

// Here used in conjunction with a simple CLI-making module `basic-repl`

import {repl} from 'basic-repl'

const name = process.argv[2] || 'user'

repl('['+name+'] ', input => {
	return channel.get(input, name).then(res => console.log(res))
})

//It's possible to give the bot some system messages, to, for example, clarify information or give new instructions on how to behave
//Note that system messages, just like user messages, are temporary and eventually fall out of the context window
repl('[system] ', input => channel.system(input))

More info: https://openai.com

Pricing: https://openai.com/api/pricing (gpt-3.5-turbo-instruct)

This software is provided as a wrapper / tool for OpenAI's API. We do not claim responsibility for anything outputs it produces, or any charges it incurs on yourself.

1.4.0

4 months ago

1.3.2

4 months ago

1.3.1

10 months ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago