### Configure Environment Variables Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Copy the example environment file and populate it with your API credentials. ```bash cp .env.example .env ``` -------------------------------- ### Install Dependencies Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Install the required Python packages listed in the requirements file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Run the Agent Server Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Start the Flask server to begin listening for incoming email webhooks. ```bash python main.py ``` -------------------------------- ### Build and Run with Docker Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Commands to build the Docker image and run the container with environment variables loaded from a .env file. ```bash docker build -t anima-agent . docker run -p 5000:5000 --env-file .env anima-agent ``` -------------------------------- ### Clone the Repository Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Use git to clone the agent template repository to your local machine. ```bash git clone https://github.com/anima-labs/agent-template.git cd agent-template ``` -------------------------------- ### Environment Configuration File Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md The .env file requires your Anima and OpenAI API keys, organization ID, and agent name. ```env ANIMA_API_KEY=mk_your_key_here OPENAI_API_KEY=sk-your_key_here ANIMA_ORG_ID=org_your_org_id AGENT_NAME=my-agent ``` -------------------------------- ### Configure SYSTEM_PROMPT environment variable Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Set the AI personality by defining the SYSTEM_PROMPT environment variable. ```env SYSTEM_PROMPT=You are a customer support agent for Acme Corp. Be helpful and reference our docs at docs.acme.com when relevant. ``` -------------------------------- ### Integrate Anthropic Claude LLM Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Replace the default OpenAI call in generate_reply() with the Anthropic Claude API. ```python # Example: Anthropic Claude from anthropic import Anthropic client = Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{"role": "user", "content": prompt}], ) ``` -------------------------------- ### Extend agent capabilities with SMS and phone provisioning Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Use the Anima SDK to send SMS messages or provision phone numbers for your agent. ```python # Send SMS from anima.types import SendSmsInput client.messages.send_sms( SendSmsInput(agentId=agent_id, to="+15551234567", body="Hello via SMS!") ) # Provision a phone number from anima.types import ProvisionPhoneInput client.agents.provision_phone( ProvisionPhoneInput(agentId=agent_id, countryCode="US") ) ``` -------------------------------- ### Register Webhook via SDK Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Use the Anima Python SDK to programmatically register a webhook URL for receiving message events. ```python from anima import Anima from anima.types import CreateWebhookInput, WebhookEvent client = Anima(api_key="mk_your_key") client.webhooks.create( CreateWebhookInput( url="https://your-server.com/webhook", events=[WebhookEvent.MESSAGE_RECEIVED], description="AI agent email handler", ) ) ``` -------------------------------- ### Handle multiple event types in webhook Source: https://github.com/anima-labs-ai/agent-template/blob/main/README.md Extend the Flask webhook handler to process different event types such as message receipt, sending, or delivery failure. ```python @app.route("/webhook", methods=["POST"]) def webhook(): payload = request.get_json() event = payload.get("event", "") if event == "message.received": handle_incoming_email(payload) elif event == "message.sent": log_sent_message(payload) elif event == "message.failed": handle_delivery_failure(payload) return jsonify({"ok": True}) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.