Skip to main content

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

  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!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepkeep-0.4.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

deepkeep-0.4.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file deepkeep-0.4.0.tar.gz.

File metadata

  • Download URL: deepkeep-0.4.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-44-generic

File hashes

Hashes for deepkeep-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7690cb6dd3a184e4054cc7b4f9c80c071139ebacef7b5d2342f900265abf9643
MD5 7c72b93c63376a498c32ffa91f211907
BLAKE2b-256 232d8ad75a5ecd88d1e6c00a0eecf9e9c62cb24908f3a7627d8f64f56d469d6d

See more details on using hashes here.

File details

Details for the file deepkeep-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: deepkeep-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-44-generic

File hashes

Hashes for deepkeep-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25e1fd379938c1a27395d6c324d5862c15638452bf84c9492932f8c6f0211b41
MD5 ea094a399cb1f338dbda5c78149f3e02
BLAKE2b-256 e43441133ccd2cff14b1b60e7664f5e7ab664d6dcfb7a26758472b2daa72327b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page