Skip to main content

A library of connectors for popular AI platforms

Project description

LLM Connectors

A Python library providing connectors for popular AI platforms including ChatGPT, Copilot, Gemini, and DeepSeek.

Installation

pip install llm-connectors

Usage

ChatGPT

from llm_connectors import ChatGPTConnector

# Initialize the connector
chatgpt = ChatGPTConnector(api_key="your-openai-api-key")

# Chat example
messages = [
    {"role": "user", "content": "Hello, how are you?"}
]
response = await chatgpt.chat(messages)
print(response["content"])

# Text generation example
text = await chatgpt.generate_text("Write a poem about AI")
print(text)

# Get embeddings
embeddings = await chatgpt.get_embeddings("Hello, world!")
print(embeddings)

Gemini

from llm_connectors import GeminiConnector

# Initialize the connector
gemini = GeminiConnector(api_key="your-google-api-key")

# Chat example
messages = [
    {"role": "user", "content": "Hello, how are you?"}
]
response = await gemini.chat(messages)
print(response["content"])

# Text generation example
text = await gemini.generate_text("Write a poem about AI")
print(text)

# Get embeddings
embeddings = await gemini.get_embeddings("Hello, world!")
print(embeddings)

Copilot and DeepSeek

Note: These connectors are currently placeholders and will be implemented when their respective APIs become available.

Features

  • Unified interface for multiple AI platforms
  • Async support for better performance
  • Consistent API across different providers
  • Support for chat, text generation, and embeddings
  • Type hints for better IDE support

Requirements

  • Python 3.8+
  • OpenAI API key (for ChatGPT)
  • Google API key (for Gemini)
  • Microsoft API key (for Copilot, when available)
  • DeepSeek API key (when available)

License

MIT License

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

llm_connectors-0.1.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.

llm_connectors-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file llm_connectors-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for llm_connectors-0.1.0.tar.gz
Algorithm Hash digest
SHA256 637df2b03e4eac72959ecc7978c8243ae5bd2d30dd831d8657b33568a24ddd4b
MD5 7321832c1b3eaf55e819042829d6e922
BLAKE2b-256 55093143e0612c4806db013de05abb54ca4b8185f740d15fea03796502714df2

See more details on using hashes here.

File details

Details for the file llm_connectors-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llm_connectors-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for llm_connectors-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 950bf53e8f9d3a2eff730af7652704aba72f6bb45fe48bc3e22286b87f041e18
MD5 b4dd12a37fea9179bdc5842993798179
BLAKE2b-256 21b3e3ae2a1dc9cc3237d35d76370dcbb745fbfeaa48938719a8db2ba2549042

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