Skip to main content

A module that enables seamless interaction with multiple free-tier language model (LLM) providers.

Project description

APIShift

Overview

APIShift is a Python package that enables seamless interaction with multiple free-tier language model (LLM) providers.

Installation

pip install APIShift

Quick Start

from APIShift import Conversation
from APIShift import GeminiProvider, OpenRouterProvider

# Initialize providers with API keys
gemini_keys = ['your_gemini_api_key1', 'your_gemini_api_key2']
openrouter_keys = ['your_openrouter_api_key1', 'your_openrouter_api_key2']

# Create a conversation with multiple providers
conversation = Conversation([
    GeminiProvider(gemini_keys),
    OpenRouterProvider(openrouter_keys)
])

# Send messages
response = conversation.send_message("Hello, how are you?")
print(response)

Using FAISS for Context Retrieval

APIShift now supports using FAISS for context retrieval. This allows you to add messages to a FAISS index and retrieve contextually relevant messages during a conversation.

Example

from APIShift import Conversation
from APIShift import GeminiProvider, OpenRouterProvider

# Initialize providers with API keys
gemini_keys = ['your_gemini_api_key1', 'your_gemini_api_key2']
openrouter_keys = ['your_openrouter_api_key1', 'your_openrouter_api_key2']

# Create a conversation with multiple providers
conversation = Conversation([
    GeminiProvider(gemini_keys),
    OpenRouterProvider(openrouter_keys)
])

# Add messages to FAISS index
conversation.add_to_faiss("Hello, how are you?")
conversation.add_to_faiss("What is the weather like today?")

# Send messages and retrieve context
response = conversation.send_message("Tell me about the weather.")
print(response)

More details coming soon...

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

apishift-1.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

apishift-1.0.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file apishift-1.0.0.tar.gz.

File metadata

  • Download URL: apishift-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for apishift-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1a2b6598739728a597ffa406f83d920e28fc1b38f4842e3ef036b05596caf3b8
MD5 a1da8edcb76b999405dc8a7557b7df89
BLAKE2b-256 bcfbc9f04221c38e241ed7fecc7ef18dc643b88c6505ee6341b31642b80b5b9b

See more details on using hashes here.

File details

Details for the file apishift-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: apishift-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for apishift-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00dc3f0b11188644fa93c0f5fd3ab37308d1e3f7ceb9d4feb051ce0f9a287bb4
MD5 83f8027ea6116b9c7b41f0e17c647873
BLAKE2b-256 43fa5bbe854ca50b0023d357d6bf2df603b986deab449b132d9ba9ee5d42f234

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