Utilities & Energy

Smart Meter Enrollment

Contact customers in smart meter deployment zones to explain benefits, address privacy concerns, and schedule installation appointments.

Why this matters

Keep customers informed and engaged with automated outage updates, smart meter enrollment, conservation alerts, and satisfaction surveys. This example shows you how to automate smart meter enrollment calls end-to-end with Guava's SDK — no telephony plumbing, no prompt engineering, just Python.

How to set persona & task
Working with Fields and Say items
Handling callbacks
Running the agent
Step 01

Installation

Install from Guava's private PyPI index. A public package is coming soon — the install command will simplify to pip install guava.

terminal
# Step 1: Install Guava
pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com

# Public PyPI package coming soon — the install command will simplify to:
# pip install guava

# Step 2: Set your credentials
export GUAVA_API_KEY="..."
export GUAVA_AGENT_NUMBER="..."
Step 02

How it's built

Every Guava agent is a Python class. Walk through the key sections below, then grab the complete file at the end.

01

Imports

Import the Guava SDK and any helpers you need. guava.CallController is the base class for every voice agent.

example.py
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os
02

Agent setup

set_persona() defines how the agent presents itself. set_task() gives it its mission in plain English. The checklist drives the conversation — Guava works through it top-to-bottom, collecting Field values and speaking Say items as it goes.

example.py
class SmartMeterEnrollmentBot(guava.CallController):
    def __init__(self, account_name: str, account_number: str, deployment_zone: str):
        super().__init__()
        self.set_persona(
            organization_name="Metro Power & Light",
            agent_name="Riley",
        )
        self.set_task(
            objective=f"Enroll {account_name} in smart meter program and schedule installation",
            checklist=[
                f"Greet {account_name} and explain the smart meter program is coming to their area.",
                guava.Say("Benefits: real-time usage insights, faster outage detection, no estimated bills."),
                guava.Field(
                    key="has_questions",
                    field_type="bool",
                    description="Does the customer have questions before scheduling?",
                ),
                guava.Field(
                    key="primary_concern",
                    field_type="choice",
                    description="Any specific concerns?",
                    choices=["none", "privacy / data sharing", "health / RF exposure", "rate impacts",
                             "installation disruption"],
                    required=False,
                ),
                guava.Field(
                    key="accepts_smart_meter",
                    field_type="bool",
                    description="Does the customer agree to smart meter installation?",
                ),
                guava.Field(
                    key="installation_slot",
                    field_type="calendar_slot",
                    description="Preferred installation window",
                    required=False,
                    choice_generator=lambda: ["Tue 8am-12pm", "Tue 1pm-5pm", "Thu 8am-12pm", "Sat 8am-12pm"],
                ),
                "Confirm installation details and explain the 30-minute service interruption.",
            ],
            on_complete=lambda fields: print(f"Smart meter enrollment: {account_name} — accepted: {fields.get('accepts_smart_meter')}"),
        )

guava.dial(
    controller=SmartMeterEnrollmentBot,
    controller_args={"account_name": "Sandra Kim", "account_number": "MPL-887421",
                     "deployment_zone": "North Valley Zone 3"},
    to=os.environ["ACCOUNT_PHONE"],
    agent_number=os.environ["GUAVA_AGENT_NUMBER"],
    api_key=os.environ["GUAVA_API_KEY"],
)

Platform performance

<1s

Response time

99.99%

Uptime SLA

13+

Industries served

Step 03

Full example

The complete file — copy it, save it as example.py, and run it.

example.py
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os

class SmartMeterEnrollmentBot(guava.CallController):
    def __init__(self, account_name: str, account_number: str, deployment_zone: str):
        super().__init__()
        self.set_persona(
            organization_name="Metro Power & Light",
            agent_name="Riley",
        )
        self.set_task(
            objective=f"Enroll {account_name} in smart meter program and schedule installation",
            checklist=[
                f"Greet {account_name} and explain the smart meter program is coming to their area.",
                guava.Say("Benefits: real-time usage insights, faster outage detection, no estimated bills."),
                guava.Field(
                    key="has_questions",
                    field_type="bool",
                    description="Does the customer have questions before scheduling?",
                ),
                guava.Field(
                    key="primary_concern",
                    field_type="choice",
                    description="Any specific concerns?",
                    choices=["none", "privacy / data sharing", "health / RF exposure", "rate impacts",
                             "installation disruption"],
                    required=False,
                ),
                guava.Field(
                    key="accepts_smart_meter",
                    field_type="bool",
                    description="Does the customer agree to smart meter installation?",
                ),
                guava.Field(
                    key="installation_slot",
                    field_type="calendar_slot",
                    description="Preferred installation window",
                    required=False,
                    choice_generator=lambda: ["Tue 8am-12pm", "Tue 1pm-5pm", "Thu 8am-12pm", "Sat 8am-12pm"],
                ),
                "Confirm installation details and explain the 30-minute service interruption.",
            ],
            on_complete=lambda fields: print(f"Smart meter enrollment: {account_name} — accepted: {fields.get('accepts_smart_meter')}"),
        )

guava.dial(
    controller=SmartMeterEnrollmentBot,
    controller_args={"account_name": "Sandra Kim", "account_number": "MPL-887421",
                     "deployment_zone": "North Valley Zone 3"},
    to=os.environ["ACCOUNT_PHONE"],
    agent_number=os.environ["GUAVA_AGENT_NUMBER"],
    api_key=os.environ["GUAVA_API_KEY"],
)
Step 04

Run it

Start the agent. It will connect to Guava's infrastructure and begin accepting calls on your assigned number.

terminal
python example.py
Get Started