Client for Jiggy AI JiggyBase, including ChatGPT Retriever Plugins
Project description
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
- Python 3.6 or above
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()
Client methods
Here are the available JiggyBase
client methods:
orgs()
- Returns a list ofOrg
objects the user is a member of.get_org(name_or_id: str)
- Returns theOrg
object matching the given name or ID.api_keys()
- Returns a list of the user'sApiKey
objects.authenticated_user()
- Returns the authenticated user'sUser
object.collections()
- Returns a list of allCollection
objects in all organizations the user is a member of.collection(name: str)
- Returns theCollection
object matching the given name.
Organization methods
For an Org
object (e.g., my_org = jb.get_org("<org_name>")
), you have access to the following methods:
-
collections()
- Returns a list ofCollection
objects within the organization. -
collection(name: str)
- Returns theCollection
object matching the given name. -
update([name: Optional[str] = None, description: Optional[str] = None])
- Updates the organization's name or description.
Collection methods
For a Collection
object (e.g., my_collection = jb.collection("<collection_name>")
), you have access to the following methods:
(adapt the usage code for each method accordingly)
set_description(self, description: str)
- Updates the description of the collection.set_oauth_verification_token(self, openai_verification_token: str)
- Sets the OpenAI verification token for the collection's plugin.plugin_oauth_config()
- Retrieves the OAuth configuration for the collection's plugin.delete()
- Deletes the collection permanently.get_chat_config()
- Retrieves the chat configuration for the collection.update_chat_config(model: str, prompt_task_id: int)
- Updates the chat configuration for the collection.upsert_file(file_path: str[, mimetype: str = None])
- Uploads a file to the collection.upsert(documents: List[Document])
- Adds a list ofDocument
objects to the collection.query(queries: Union[str, List[str], Query][, top_k : int = 10])
- Queries the collection and returns aQueryResponse
object.get_doc(id: str)
- Retrieves a document by its ID.get_chunks([start: int = 0, limit: int = 10, reverse: bool = True])
- Iterates through the chunks in a collection.delete_docs([ids: Optional[List[str]] = None, document_metadata_filter: Optional[DocumentMetadataFilter] = None, delete_all: Optional[bool] = False])
- Deletes items in the collection by document IDs, metadata filter, or deletes all documents.
Organization User Management
members()
- Returns a list ofOrgMember
objects within the organization.add_member(email: str, role: OrgRole)
- Adds a new member to the organization with the given email and role.delete_member(email: str)
- Deletes a member from the organization using the given email.
Organization Prompt Management
prompt_tasks([name=None, version=None])
- Returns a list ofPromptTask
objects, optionally filtering by name and version.create_prompt_task(name: str, version: int, prompts: List[PromptMessage][, type: Optional[PromptTaskType] = None, description: Optional[str] = None])
- Creates a newPromptTask
object with the specified parameters.update_prompt_task(name: str, prompts: List[PromptMessage])
- Updates the specified prompt task's prompts.get_prompt_task(prompt_task_id: int)
- Retrieves aPromptTask
object using the given prompt_task_id.delete_prompt_task(prompt_task_id: int)
- Deletes aPromptTask
object using the given prompt_task_id.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for jiggybase-0.0.19-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5b5a435990ed6f2e90f64947bfd22e673dd73bb94281a3a5e66b0b337073c38 |
|
MD5 | 9475c153523ebfc7eeb8b6453b6b8dab |
|
BLAKE2b-256 | 2d828729a4c5c695081a152e7fb30bb588a5d2ad9819688ad7c66f46a96e1122 |