Socket
Socket
Sign inDemoInstall

dialoqbase

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dialoqbase

A client library for Dialoqbase


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

dialoqbase-js

This is a JavaScript library for the Dialoqbase API. It is a simple wrapper around the API, providing a more convenient way to interact with it.

Getting Started

First of all, you need to install the library:

npm install dialoqbase

Then you're ready to use it:

import { createClient } from 'dialoqbase';

const dialoqbase = createClient(
    'http://localhost:3000',
    'your-api-key'
)

Usage

Creating a new bot

const {data, error} = await dialoqbase.bot.create({
    name: "Test Bot 2",
    model: "claude-3-opus-20240229",
    embedding: "nomic-ai/nomic-embed-text-v1.5"
})

Adding file based sources

const formData = new FormData();

formData.append("file", pdfFile, "test.pdf")
formData.append("file", mp3File, "test.mp3")

const {data, error} = await dialoqbase.bot.source.addFile(botId, formData)

Adding text based sources

const {data, error} = await dialoqbase.bot.source.add(botId, [
    {
        content: "https://n4ze3m.com",
        type: "website",
    },
    {
        content: "https://www.youtube.com/watch?v=BLmsVvcUxmY",
        type: "youtube",
        options: {
            youtube_mode: "transcript"
        }
    },
    {
        content: "Hello World!",
        type: "text",
    },
])

Chatting with the bot (streaming)

const chat = await dialoqbase.bot.chat(botId, {
    message: "Hello tell me a joke",
    stream: true,
    history: []
})

for await (const message of chat) {
    console.log(message.bot.text)
}

Chatting with the bot (non-streaming)

const response = await dialoqbase.bot.chat(botId, {
    message: "Hello tell me a joke",
    stream: false,
    history: []
})

console.log(response.bot.text)

Deleting a bot

const {data, error} = await dialoqbase.bot.delete(botId)

License

MIT

FAQs

Package last updated on 17 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc