@izzai/one-js
v1.1.2
Published
One package for typescript and node projects.
Downloads
30
Readme
One JS
This is the official Typescript SDK for One.
Installation
npm install @izzai/one-apiInitialization
import { One } from '@izzai/one-api'
const one = new One('YOUR_INSTANCE_ID', {
email: 'YOUR_EMAIL',
apiKey: 'YOUR_API_KEY',
})OR
import { One } from '@izzai/one-api'
const one = new One('YOUR_INSTANCE_ID', 'JWT_TOKEN')If you are using JWT token, make sure to check for the expiration time and refresh it as needed.
Usage
Chat
const chat = await one.chat.chat('Hi there')Datasources
const datasources = await one.datasource.list()GPTs
const gpts = await one.gpt.list()Agents
const agents = await one.agent.list()