jiggy-ai / jiggybase

python client for JiggyBase
Apache License 2.0
8 stars 4 forks source link

JiggyBase

JiggyBase is a Python library for interacting with the JiggyBase service at https://jiggy.ai.

Use it to manage your JiggyBase organization and collections, including uploading documents into a collection.

Requirements

Installation

pip install jiggybase

Client Usage

To start using JiggyBase in your Python code, you first need to import it:

import jiggybase

After importing, you need to create a JiggyBase client object:

jb = jiggybase.JiggyBase()

Assuming you already created a collection 'my-collection', you can add files to the collection as follows:

collection = jb.collection('my-collection')

collection.upsert_file('/path/to/my/doc')

The document is now available in the collection and can be accessed by the collection's ChatGPT plugin, via chat.jiggy.ai, or via the associated chat API endpoint.

JiggyBase Client

These are the top level methods of th JiggyBase client, primarily used for getting the user's organizations or all collections across all organizations.

Organization

Organizations in JiggyBase are a mechanism for separating different customers within the JiggyBase service. Users can be a member of mutiple unrelated organizations. A new user who subscribes to a JiggyBase service tier has their own oganization that they control as administrator of the organization. Users can also be invited to an organization by existing members of the organization.

For an Org object (e.g., my_org = jb.get_org("<org_name>")), you have access to the following methods:

Collection

A collection is a group of documents that can be used to augment ChatGPT language models with your personalized information by using information from your collection to inform ChatGPT responses. A collection can be exposed as a ChatGPT Plugin, via the JiggyBase ChatCompletion API, or via chat.jiggy.ai. You have full control over who can access to your collection.

For a Collection object (e.g., my_collection = jb.collection("<collection_name>")), you have access to the following methods:

Organization User Management

An organization supports multiple roles for members, including 'admin', 'member', and 'viewer'. A viwer role can access the data in the collection for chat purposes. A member can upload new documents to the collection.

Organization Prompt Management

JiggyBase supports user-customized prompts for the JiggyBase ChatCompletion API. The following methods are provided to manage the customized prompts.

jiggybase_upload

This utility is installed via pip and allows you to upload files or directories to your JiggyBase collection using command-line arguments. It's included in the jiggybase/examples directory.

Usage

jiggybase_upload [--org <organization>] [--collection <collection>] [--dir <directory>] [--file <file>]

If neither --file nor --dir options are provided, the script will automatically process other arguments as a file or directory.