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

# 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!

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-1.2.11.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepkeep-1.2.11-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepkeep-1.2.11.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.9 Darwin/24.0.0

File hashes

Hashes for deepkeep-1.2.11.tar.gz
Algorithm Hash digest
SHA256 19c04c7ad7819c106f1ad264993e94215ee2627a633ecec8343dcac1be6779d4
MD5 df6716508fe6d74345c32c8e3640f2e1
BLAKE2b-256 5010140711d091dc28fff5568258546e23ae949b188ff8a6b504884d38fae1c3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deepkeep-1.2.11-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.9 Darwin/24.0.0

File hashes

Hashes for deepkeep-1.2.11-py3-none-any.whl
Algorithm Hash digest
SHA256 243dd2d2af20559de15caae8684e097f9405a58c09a61d04f5f675eddeb0865e
MD5 0c37acc9b6c6eef961a5b850780d8de4
BLAKE2b-256 3c97fb660b9f1af02d8f16997b47262f0689935cfd33bdfdcbdecc13f5be6afc

See more details on using hashes here.

Supported by

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