gpt-api
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

与 gpt 通信,带记忆功能

how to install

pnpm i gpt-api

how to use

import {createGptChat,config,createAudioTranscriptions} from 'gpt-api'
// config is global config,can set apiKey and proxy

// this api follow terminal agent
const gpt = createGptChat({
  apiKey: 'your key',
  baseUrl: 'official or your proxy url',
  model: "gpt-3.5-turbo",
})
/** @returns {string} */
const response =  await gpt.sendMessage('say you question')

gpt.reset() // restart memory

// create audio transcription
createAudioTranscriptions({
  filePath: './xxx.mp3',
  output: './audio.txt'
})
// default return text

Readme

Keywords

none

Package Sidebar

Install

npm i gpt-api

Weekly Downloads

1

Version

1.1.3

License

ISC

Unpacked Size

18 kB

Total Files

5

Last publish

Collaborators

  • meiyiyi