Skip to main content

autogen-openaiext-client

This Autogen client is to help interface quickly with non-OpenAI LLMs through the OpenAI API.

See here for more information on using with custom LLMs.

This repository simply include clients you can use to initialize your LLMs easily - since the Autogen >v0.4 supports the non-OpenAI LLMs within the autogen_ext package itself with a really nice and clean changes from jackgerrits here.

=======

Install

pip install autogen-openaiext-client

Usage

from autogen_openaiext_client import GeminiChatCompletionClient
import asyncio

# Initialize the client
client = GeminiChatCompletionClient(model="gemini-1.5-flash", api_key=os.environ["GEMINI_API_KEY"])

# use the client like any other autogen client. For example:
result = asyncio.run(
    client.create(
        [UserMessage(content="What is the capital of France?", source="user")]
    )
)
print(result.content)
# Paris

Currently, Gemini, TogetherAI and Groq clients are supported through the GeminiChatCompletionClient, TogetherAIChatCompletionClient and GroqChatCompletionClient respectively.

Install Magentic-One and run python examples/magentic_coder_example.py for a sample usage with other autogen-based frameworks.

Known Issues

  1. Tool calling in Gemini through OpenAI API runs into issues.

Contributing

  1. Adding a new model to existing external providers
    1. For example, adding a new model to GeminiChatCompletionClient includes modifying the GeminiInfo class in info.py and adding the new model to _MODEL_CAPABILITIES and _MODEL_TOKEN_LIMITS dictionaries.
  2. Adding a new external provider
    1. Add a new client class in client.py, relevant ProviderInfo class in info.py and add it to __init__.py for easy import.

Disclaimer

This is a community project for Autogen. Feel free to contribute via issues and PRs and I will try my best to get to it every 3 days.

Metadata

Release files for autogen-openaiext-client 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autogen-openaiext-client 0.0.3
File Size Uploaded
autogen_openaiext_client-0.0.3.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autogen-openaiext-client 0.0.3
File Interpreter ABI Platform
autogen_openaiext_client-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 14.2 kB

Release files / autogen_openaiext_client-0.0.3.tar.gz

Download URL autogen_openaiext_client-0.0.3.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8dcd7ca43f41d8362f2930deeb96c33aacbb5b9a7b366c5ef02e191d5ec8441c
BLAKE2b-256 checksum
How to use checksums
4609929af370ec810f2cc653fb9ffe41a9e18bcc5c2c9a4ed4540f2c43a2bb41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 23, 2025.

Transparency log

Release files / autogen_openaiext_client-0.0.3-py3-none-any.whl

Download URL autogen_openaiext_client-0.0.3-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f275fe960de3aef97a9022b7a5899900883728985c9d36494ef2828acbb6153
BLAKE2b-256 checksum
How to use checksums
6fc5a8d744502d05cb8a31ee1bc8e3a7b71a05e837c863f53310f6ea3ffe5bd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 23, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page