Skip to main content

Access Shuttle AI's API via an easy-to-use Python wrapper. Dashboard: https://shuttleai.app Discord: https://discord.gg/shuttleai

Project description

The Official Python library for the ShuttleAI API

pypi Downloads Downloads/Month Python Versions

The ShuttleAI Python library provides easy access to the ShuttleAI REST API for Python 3.9+ applications. It includes type definitions for all request parameters and response fields, offering both synchronous and asynchronous clients powered by httpx and aiohttp, respectively.

We prioritize performance optimizations across the library. Beyond using orjson for near-instant JSON processing, we implement various techniques to reduce overhead and enhance speed, ensuring efficient and swift API interactions. These optimizations include minimizing built-in library usage, leveraging reusable aiohttp client sessions, and incorporating several small adjustments to streamline operations.

Installation

pip install shuttleai

From Source

This client uses poetry as a dependency and virtual environment manager.

You can install poetry with

pip install poetry

poetry will set up a virtual environment and install dependencies with the following command:

poetry install

Run examples

You can run the examples in the examples/ directory using poetry run or by entering the virtual environment using poetry shell.

Using poetry run

cd examples
poetry run python chat_no_streaming.py

Using poetry shell

poetry shell
cd examples

>> python chat_no_streaming.py

API Key Setup

To use the ShuttleAI API, you need to have an API key. You can get a FREE API key by signing up at shuttleai.app and heading to the key management page.

After you have an API key, you can set it as an environment variable:

Windows

setx SHUTTLEAI_API_KEY "<your_api_key>"

macOS/Linux

export SHUTTLEAI_API_KEY=<your_api_key>

Contribution

We welcome and appreciate contributions to the ShuttleAI API Python SDK. Please see the contribution guide for more information. Benefits may apply! :smile:

Scripts

Formatting/Checks

  • poetry run ruff check shuttleai - Check for code formatting issues
  • poetry run black shuttleai --diff --color - Check for code formatting issues
  • poetry run black shuttleai - Format code
  • poetry run mypy shuttleai - Check for type errors

Tools

  • poetry run clean - Clean up the project directory
  • poetry run key - Display your default API key (if set by environment variable)
  • poetry run contributors - Display contributors

Interactive Chatbot

  • poetry run shuttleai - Run the interactive chatbot

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

shuttleai-0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

shuttleai-0-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file shuttleai-0.tar.gz.

File metadata

  • Download URL: shuttleai-0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11

File hashes

Hashes for shuttleai-0.tar.gz
Algorithm Hash digest
SHA256 cb86cbc8695f0801346a91ef0b2f328d22d7826e90529dc3b4ae9e8ac5adb8c7
MD5 e4f9557c4f4d806b3ee48c2c5f4107c4
BLAKE2b-256 9244461ccb4d4fb7717932e7f0d50a411bb564c63390e3368eb0dae0af494983

See more details on using hashes here.

File details

Details for the file shuttleai-0-py3-none-any.whl.

File metadata

  • Download URL: shuttleai-0-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/11

File hashes

Hashes for shuttleai-0-py3-none-any.whl
Algorithm Hash digest
SHA256 6302728f1df7d4b6f5a4c86377b1982732485c1a6cff5e6956eb66810f5dc9c5
MD5 2a4a5dfbe258eda8513243b2c3bd3a41
BLAKE2b-256 4949830582b3c83a0d2ed7a6a5894c94d84f084cf4f821264502fceaecb76436

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