Overview
This python package is only useful for a custom cloud deployment of dsRAG
Usage
pip install dsrag-sdk
Setup
You can set the base url that the sdk connects to by running the following:
from dsrag_sdk.main import set_base_url
set_base_url("http://0.0.0.0:8000")
Knowledge bases
from dsrag_sdk.knowledge_bases import create_knowledge_base, list_knowledge_bases, get_knowledge_base, delete_knowledge_base, update_knowledge_base
Create knowledge base
kb = create_knowledge_base(title="sdk_test_kb", supp_id="test-supp-id")
List knowledge bases
knowledge_bases = list_knowledge_bases()
List with supp_id filter
knowledge_bases = list_knowledge_bases(supp_id="test-supp-id")
Get a knowledge base by id
knowledge_base = get_knowledge_base(knowledge_base_id="test-kb-id")
Update a knowledge base
knowledge_base = update_knowledge_base(knowledge_base_id="test-kb-id", title="updated-title", supp_id="updated-supp-id")
Delete a knowledge base
response = delete_knowledge_base(knowledge_base_id="test-kb-id")
Documents
from dsrag_sdk.documents import create_document_via_text, list_documents, get_document, delete_document
Add a document via text
kb_id = "test-kb-id"
document_text = "This is some test text for document upload"
document = create_document_via_text(kb_id, document_text)
List documents
documents = list_documents(kb_id)
List documents with supp_id filter
documents = list_documents(knowledge_base_id="test-kb-id", supp_id="test-supp-id")
Get document by id
document = get_document(knowledge_base_id="test-kb-id", document_id="test-document-id")
Delete a document
response = delete_document(knowledge_base_id="test-kb-id", document_id="test-document-id")
Chat
from dsrag_sdk.chat import create_chat_thread, list_chat_threads, update_chat_thread, get_chat_thread, delete_chat_thread, get_chat_response, list_thread_interactions
Create a chat thread
response = create_chat_thread(knowledge_base_ids=[kb_id])
List chat threads
chat_threads = list_chat_threads()
Filter with supp_id
chat_threads = list_chat_threads(supp_id="test-supp-id")
Get chat thread by id
chat_thread = get_chat_threads(thread_id="test-thread-id")
Get a chat response
response = get_chat_response(thread_id="test-thread-id", input="What is AGI?")
Update a chat thread
chat_thread = update_chat_thread(thread_id="test-thread-id", knowledge_base_ids=[kb_id_1, kn_id_2], supp_id="updated-supp-id", model="gpt-4o-mini")
Delete a chat thread
response = delete_chat_thread(thread_id="test-thread-id")
Metadata
Release files for dsrag-sdk 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dsrag_sdk-0.0.8.tar.gz | 8.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dsrag_sdk-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.1 kB
Release files / dsrag_sdk-0.0.8.tar.gz
| Download URL | dsrag_sdk-0.0.8.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd8c29fcd83eb6d5568e234bf7164b912b28a9e050d13484156ccbd51ccf44ad
|
|
BLAKE2b-256 checksum How to use checksums |
64ad2cc5bb925e25a9485f57d0ec79cdada52385dca7eead529960f16960db84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.12
|
Release files / dsrag_sdk-0.0.8-py3-none-any.whl
| Download URL | dsrag_sdk-0.0.8-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f86d17c474e97ec74694f0980cbeb512077647d1bfbb0f8489b69ecab211f3b0
|
|
BLAKE2b-256 checksum How to use checksums |
55a6431180b9a21859be1fc9c42918277407edbab53d060161853b39e700369e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.9.12
|
Security for dsrag-sdk 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.