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.3.0.tar.gz (5.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.3.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ownlayer-0.3.0.tar.gz
  • Upload date:
  • Size: 5.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.3.0.tar.gz
Algorithm Hash digest
SHA256 369f022fb917a188c0157730e51ac09d63be8a509d8b646842ca9effcf02763b
MD5 d429bca7a622b2599f7b3dde8aef58aa
BLAKE2b-256 ca23ed40cf4b22e0b8b79e6071808f5f58ce9ebdbbc1ba0e5567a4ddcb7443b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ownlayer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72482ed6b8e76d7c26d91391d61c90b308429a414f0af2d859126f8cd319eb36
MD5 c5f79418b876303fcfb709ff698ca709
BLAKE2b-256 9dd6c6869e97747adf738e5740566d58e26c0ef1b86ea992da7de4e1cfc40df6

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