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

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.post2.tar.gz (10.6 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.post2-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file switchai-0.1.post2.tar.gz.

File metadata

  • Download URL: switchai-0.1.post2.tar.gz
  • Upload date:
  • Size: 10.6 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.post2.tar.gz
Algorithm Hash digest
SHA256 69afeeecb314ca9efc41f4dc52a6a83e0c733aa35854827c24960a6298332aef
MD5 8ec13796e0cf379ce3647afc3b3147af
BLAKE2b-256 6f77b15c611c8c8b9b4ae4c6c4ca73c4d19f26b9027b54eec909aba7125fcbce

See more details on using hashes here.

File details

Details for the file switchai-0.1.post2-py3-none-any.whl.

File metadata

  • Download URL: switchai-0.1.post2-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 1dd67523d1a5a5a0c87dd047d2ce999ee34c81695a90378d7cc3d84dd995196d
MD5 0ee07819a8139e1dfc98b3d2e4e81cdc
BLAKE2b-256 2bf604d7a5325506ab7e5784862d9b58d359affc02fc7a6089fa456795b43ddb

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