The official Python library for the Deepkeep API
Project description
Deepkeep API Quickstart - Python
Welcome to the official repository for quick start applications utilizing the Deepkeep's SDK. Our SDK is designed to streamline interactions with ML models like LLMs and Object detection, providing an intuitive Python interface for managing models, datasets, users, and processing pipelines to provied ML security security and trust assessments or provied a firewall for ML Models incrissing trust and security rubustness. This repository is your starting point to dive into leveraging our advanced AI and machine learning trust and security capabilities across various endpoints, including model management, user authentication, conversational AI, and customized content moderation pipelines.
Basic request
To send your first API request with the Deepkeep Python SDK, make sure you have the right dependencies installed and then run the following code:
host_id = "DEEPKEEP_HOST_ID"
access_key = "DEEPKEEP_ACCESS_KEY"
secret_key = "DEEPKEEP_SECRET_KEY"
base_url = "DEEPKEEP_BASE_URL"
user_id = access_key
dk_client = Deepkeep(access_key=access_key, secret_key=secret_key, base_url=base_url)
# Create a new conversaion
conversation_id = dk_client.conversation.create(user_id=user_id, host_id=host_id)["id"]
# Convers with the assistant
content = "<MESSAGE>"
assistant_response = dk_client.message.create(host_id=host_id, conversation_id=conversation_id, content=content)
print(assistant_response["content"])
# Converse Debug Mode
content = "<MESSAGE>"
assistant_response = dk_client.message.create(monitor=host_id, conversation_id=conversation_id, content=content, verbose=True)
print(assistant_response["content"])
print(assistant_response["statistics"])
Setup
-
If you don't have Python installed, install it from Python.org.
-
Clone this repository.
-
Navigate into the project directory:
$ cd deepkeep-quickstart-python
-
Create a new virtual environment:
-
macOS:
$ python -m venv venv $ . venv/bin/activate
-
Windows:
> python -m venv venv > .\venv\Scripts\activate
-
-
Install the requirements:
$ pip install -r requirements.txt
-
Run the notebooks:
Install JupyterLab with pip:
pip install jupyterlab
Once installed, launch JupyterLab with:
jupyter lab
You should now be able to access the notebooks from your browser at the following URL: http://localhost:8888/lab!
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
File details
Details for the file deepkeep-0.3.0.tar.gz
.
File metadata
- Download URL: deepkeep-0.3.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-28-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b59c0a66c74f2de1950769cdd124fd34be94a5e3f0b3dcbdc7e1bbd129d0cbc |
|
MD5 | 10d4bdffb267b5adc2745bb427ef2ddb |
|
BLAKE2b-256 | 23c6ce08182931d19b5c688142715ffc0a7b0c4bdf589743908fb74c86de62bd |
File details
Details for the file deepkeep-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: deepkeep-0.3.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-28-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce5fee0742b37d0e4edffab3f48232d21f3bdaec04126f2a7c1342ecd61c8eda |
|
MD5 | d6e9dbe4bf8978c86aca9f2bcd8d8cce |
|
BLAKE2b-256 | 127c179682ce6ab5963f0975500e6a95345925c70ea74ce70ab54432becc877f |