Skip to main content

autogen-ext-email is a Python package that provides an agent capable of generating images, attaching files, drafting reports, and sendind emails to multiple recipients or specific users based on their queries. This feature is highly beneficial for customer management and email marketing, enhancing automation and improving efficiency.

Installation

To install the package from the GitHub repository, use the following command:

pip install autogen-ext-email

Example

from autogen_ext_email import EmailAgent,EmailConfig
from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_agentchat.teams import RoundRobinGroupChat
from autogen_agentchat.base import TaskResult
from autogen_agentchat.conditions import TextMentionTermination
import asyncio
model_client = OpenAIChatCompletionClient(
        api_key=api_key,
        parallel_tool_calls=False,
    )
# img_base_url and img_api_key is from https://www.aliyun.com/product/bailian, or you can change your image generating method by yourself.
e_agent = EmailAgent(name='email_agent', 
                     model_client=model_client,
                     email_config=EmailConfig(
                         email='masquerlin@gmail.com', 
                         password='xxxxxxxxxxxx', server='smtp.gmail.com', 
                         port=587),
                     img_base_url=img_base_url,
                     img_api_key=img_api_key)

async def main():
    text_termination = TextMentionTermination("TERMINATE")
    team = RoundRobinGroupChat([e_agent], termination_condition=text_termination)
    async for message in team.run_stream(task="generate an report about autogen and send it to 'masquerlin@gmail.com'"): 
        if isinstance(message, TaskResult):
            print("Stop Reason:", message.stop_reason)
        elif 'PASS_TOUSER' in message.content:
            print(message)
asyncio.run(main())

Usage

See example.py for a simple example of how to use this agent. Note, this example requires the OpenAI client, so please install the relevant extension.

License

This project is licensed under the MIT License.

Metadata

Release files for autogen-ext-email 0.1.1

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-ext-email 0.1.1
File Size Uploaded
autogen_ext_email-0.1.1.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autogen-ext-email 0.1.1
File Interpreter ABI Platform
autogen_ext_email-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / autogen_ext_email-0.1.1.tar.gz

Download URL autogen_ext_email-0.1.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6fe4661997dce0426f17b7d7c5c75c3421cf5bd5ca738cafc36c5f17d9c79cb2
BLAKE2b-256 checksum
How to use checksums
3b8cc99359ec005ade03313a1045111022e49c93bffe5755d24d0be8611b2aad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / autogen_ext_email-0.1.1-py3-none-any.whl

Download URL autogen_ext_email-0.1.1-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
559cf2d069a2c1b48af9a323df32ad2b90e83c79cc7bb8b05ac87ea958c1d25c
BLAKE2b-256 checksum
How to use checksums
c546144b7b3e5b04409887024dc950a7534c13a7840ff00764ddaf80dd1fc274
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

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