|
1 |
| -poetry run acp generate-agent-models examples/marketing-campaign/deploy/sendgrid.json --output-dir examples/marketing-campaign/src/marketing_campaign --model-file-name sendgrid.py |
| 1 | +# Marketing Campaign Manager |
| 2 | + |
| 3 | +The Marketing Campaign Manager is a demonstration AI agent developed with LangGraph, designed to assist in composing and sending emails for a marketing campaign. |
| 4 | + |
| 5 | +It performs the following actions: |
| 6 | +* It gathers necessary campaign details from the user through a chat. |
| 7 | +* Compose an email leveraging the [Email Composer Agent](../mailcomposer/) as a remote ACP agent. |
| 8 | +* It leverages the [IO Mapper Agent](https://github.com/agntcy/iomapper-agnt) to adapt Email Composer Agent output to Email Reviewer Agent. |
| 9 | +* Reviews the email leveraging the [Email Reviewer Agent](../email_reviewer/) as a remote ACP agent. |
| 10 | +* Send the email to the configured recipient through Twilio sendgrid leveraging the [API Bridge Agent](https://github.com/agntcy/api-bridge-agnt) |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +Before running the application, ensure you have the following: |
| 15 | + |
| 16 | +- **Azure OpenAI API Key** |
| 17 | +- **Python 3.9 or higher** |
| 18 | +- **Poetry** |
| 19 | + |
| 20 | +## Running the Marketing Campaign Manager |
| 21 | + |
| 22 | +### Preliminary step: Deploying API Bridge Agent |
| 23 | + |
| 24 | +Run the API Bridge Agent configured with sendgrid. See [instructions](https://docs.agntcy.org/pages/syntactic_sdk/api_bridge_agent.html#an-example-with-sendgrid-api) |
| 25 | + |
| 26 | + |
| 27 | +### Running the agent directly |
| 28 | +* Deploy agentic dependencies first: |
| 29 | + * Run Email Composer Agent through the Agent Workflow Server. See [instructions](../mailcomposer/README.md#running-the-email-agent-using-agent-workflow-server). |
| 30 | + * Run Email Reviewer Agent through the Agent Workflow Server. See [instructions](../email_reviewer/README.md#running-the-email-agent-using-agent-workflow-server). |
| 31 | +* Install python dependencies |
| 32 | + ``` |
| 33 | + poetry install |
| 34 | + ``` |
| 35 | +* Run the agent |
| 36 | + ``` |
| 37 | + export AZURE_OPENAI_MODEL=gpt-4o-mini |
| 38 | + export AZURE_OPENAI_API_KEY=***YOUR_OPENAI_API_KEY*** |
| 39 | + export AZURE_OPENAI_ENDPOINT=***YOUR_OPENAI_ENDPOINT*** |
| 40 | + export OPENAI_API_VERSION=2024-07-01-preview |
| 41 | + export SENDGRID_API_KEY=***YOUR_SENDGRID_API_KEY*** |
| 42 | + export MAILCOMPOSER_HOST=***URL TO EMAIL COMPOSER WORKFLOW SERVER e.g. http://0.0.0.0:10100*** |
| 43 | + export EMAIL_REVIEWER_HOST=***URL TO EMAIL REVIEWER WORKFLOW SERVER e.g. http://0.0.0.0:10100*** |
| 44 | + export MAILCOMPOSER_AGENT_ID==***EMAIL COMPOSER ID** |
| 45 | + export EMAIL_REVIEWER_AGENT_ID=***EMAIL REVIEWER ID** |
| 46 | + export SENDGRID_HOST=***URL TO API BRIDGE AGENT*** |
| 47 | + |
| 48 | + poetry run python src/marketing_campaign/__main__.py |
| 49 | + ``` |
| 50 | +
|
| 51 | +## Running the Email Agent using Agent Workflow Server |
| 52 | +
|
| 53 | +* Create an environment variable file with the variables described above |
| 54 | + ```commandline |
| 55 | + echo " |
| 56 | + AZURE_OPENAI_MODEL=gpt-4o-mini |
| 57 | + ... |
| 58 | + ... |
| 59 | + " > deploy/.mcm.env |
| 60 | + ``` |
| 61 | +* Make sure that the workflow server manager cli (`wfsm`) is added to your path |
| 62 | +* Start the workflow server |
| 63 | + ``` |
| 64 | + cd deploy; |
| 65 | + wfsm deploy -m ./mailcomposer.json -e ./.mcm.env |
| 66 | + ``` |
2 | 67 |
|
3 |
| -poetry run acp generate-agent-models examples/mailcomposer/deploy/mailcomposer.json --output-dir examples/marketing-campaign/src/marketing_campaign --model-file-name mailcomposer.py |
4 | 68 |
|
5 |
| -poetry run acp generate-agent-models examples/email_reviewer/deploy/email_reviewer.json --output-dir examples/marketing-campaign/src/marketing_campaign --model-file-name email_reviewer.py |
|
0 commit comments