Skip to main content

A unified library for interacting with various AI APIs through a standardized interface.

Project description

SwitchAI

SwitchAI is a lightweight and flexible library that provides a standardized interface for interacting with various AI APIs like OpenAI, Anthropic, Mistral, and more. With SwitchAI, you can easily switch between AI providers or use multiple APIs simultaneously, all with a simple and consistent interface.

Installation

Install with pip:

pip install switchai  

Getting Started

Here’s an example of how to use SwitchAI:

from switchai import SwitchAI  

# Initialize the client with your chosen AI model or provider  
client = SwitchAI("gpt-4o")  

# Send a chat message to the AI  
response = client.chat(  
    messages=[  
        {"role": "user", "content": "Hello, how are you?"}  
    ]  
)

Documentation

For full documentation, visit SwitchAI Documentation.

Contributing

Contributions are always welcome! If you'd like to help enhance SwitchAI, feel free to make a contribution.

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

switchai-0.1.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

switchai-0.1.3-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file switchai-0.1.3.tar.gz.

File metadata

  • Download URL: switchai-0.1.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for switchai-0.1.3.tar.gz
Algorithm Hash digest
SHA256 580ff264080cf152874a6f32321bb2c1d1b157eb12004273ea3a1a4d61f9e8ab
MD5 e4ada851f57247bca9b2aa2e26e808a9
BLAKE2b-256 ee5253cc384e2f42585d8853d7755e03eee9063699c7cb7aa47c8c9e80b135ba

See more details on using hashes here.

File details

Details for the file switchai-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: switchai-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for switchai-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 199659a55e00b6a4b309a49206f462cf583ee3bdcf5d12d8139a7e6e0bf0b5d1
MD5 6d51a741508fd47e8144042150a2a35d
BLAKE2b-256 d57a26c020365f831bdd780b69329ebcc0e3ff3e2ab69de7454dfacc3b828e4a

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