Skip to main content

Ownlayer Python SDK

Project description

Ownlayer Python SDK

Python SDK to integrate Ownlayer

Usage

Install SDK

pip install ownlayer

Change openai import to use Ownlayer wrapper

- import openai
+ from ownlayer.openai import openai


def some_AI_func:
    # use AI as you did before
    return openai.chat.completions.create(
        ...
    )

Be sure to have add OWNLAYER_API_KEY to your .env file:

OWNLAYER_API_KEY=ey...xxx

Running examples

First you'll need to install the SDK of your choice (or all of them)

poetry install --extras "openai" # needed to use openai
poetry install --extras "anthropic" # needed to use anthropic

The "examples" folder holds demos of how to use this SDK. In order to run one from root folder run:

python -m examples.<path-to-example>

E.g. to run openai/chat_completion.py example, run:

python -m examples.openai.chat_completion

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

ownlayer-0.2.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

ownlayer-0.2.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file ownlayer-0.2.0.tar.gz.

File metadata

  • Download URL: ownlayer-0.2.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for ownlayer-0.2.0.tar.gz
Algorithm Hash digest
SHA256 56f408d04ac5086306bcc51b35d59c68f52128f5507c5682279892e11edf7884
MD5 bdd1ec3e5989eba6774b324cf92b500d
BLAKE2b-256 c60b5cea6b38b17e659fd76faa38a9288fa0241f60e24b74f69c7598478a0a25

See more details on using hashes here.

File details

Details for the file ownlayer-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ownlayer-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for ownlayer-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 189c6b5b06128e8ee6104efd593503410e9d280c85ff41f90f62b426c5083403
MD5 f3f18989edd6ce8556a2786c2b46d6e7
BLAKE2b-256 ac625250811a52dc6f47086560c4b03c95b728976349865d9a3397e1b4469298

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