Skip to main content

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"])

# Note: another optional way to create Deepkeep client is using a token instead of access_key and secret_key
# client = Deepkeep(token="<Access Token>", base_url=base_url)

Setup

  1. If you don't have Python installed, install it from Python.org.

  2. Clone this repository.

  3. Navigate into the project directory:

    $ cd deepkeep-quickstart-python
    
  4. Create a new virtual environment:

    • macOS:

      $ python -m venv venv
      $ . venv/bin/activate
      
    • Windows:

      > python -m venv venv
      > .\venv\Scripts\activate
      
  5. Install the requirements:

    $ pip install -r requirements.txt
    
  6. 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!

Release files for deepkeep 1.2.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for deepkeep 1.2.13
File Size Uploaded
deepkeep-1.2.13.tar.gz 15.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for deepkeep 1.2.13
File Interpreter ABI Platform
deepkeep-1.2.13-py3-none-any.whl Python 3 none any Details

Total release size: 43.2 kB

Release files / deepkeep-1.2.13.tar.gz

Download URL deepkeep-1.2.13.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9c15d2c6f3f2b16ada9e2ffdd88dfbe5f913472daf14f240a9dbf7e47ef05c92
BLAKE2b-256 checksum
How to use checksums
0983ff2d72545a3991000fd826f11ac754d83c331ce423a2282c367223cf29f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.9 Darwin/24.0.0

Release files / deepkeep-1.2.13-py3-none-any.whl

Download URL deepkeep-1.2.13-py3-none-any.whl
Size 28.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fd1c9e627634df873acf44ea962c18b07f5c1d829534f0ccd88d079ac450818
BLAKE2b-256 checksum
How to use checksums
4343133635eb3a377ed5ed9d0074b01ea8755f53e2e4a9b829e2fa135076043c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.11.9 Darwin/24.0.0

Release history Release notifications | RSS feed

This release

1.2.13 This release

2 release files

1.2.10

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page