Logistics & Supply Chain

Proof of Delivery Disputes

Investigate and resolve proof-of-delivery disputes by collecting statements from both the consignee and driver, creating a documented record for resolution.

Why this matters

Keep freight moving with automated delivery confirmation, carrier check-ins, claims intake, and compliance data collection. This example shows you how to automate proof of delivery disputes 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 PODDisputeBot(guava.CallController):
    def __init__(self, contact_name: str, dispute_id: str, delivery_date: str,
                 shipment_description: str, contact_type: str):
        super().__init__()
        self.set_persona(
            organization_name="Apex Logistics Resolution Center",
            agent_name="Kim",
        )
        self.set_task(
            objective=f"Investigate POD dispute {dispute_id} with {contact_name} ({contact_type})",
            checklist=[
                f"Introduce yourself to {contact_name} regarding dispute {dispute_id} for delivery on {delivery_date}.",
                guava.Field(
                    key="received_shipment",
                    field_type="bool",
                    description=f"Did {contact_name} {'receive' if contact_type == 'consignee' else 'deliver'} the shipment?",
                ),
                guava.Field(
                    key="delivery_location_confirmed",
                    field_type="text",
                    description="Exact location where delivery was made or claimed to be made",
                ),
                guava.Field(
                    key="who_signed",
                    field_type="text",
                    description="Name and title of person who signed (or claims to have signed)",
                    required=False,
                ),
                guava.Field(
                    key="cctv_available",
                    field_type="bool",
                    description="Is there security camera footage available at the delivery location?",
                ),
                guava.Field(
                    key="statement_for_record",
                    field_type="text",
                    description="Official statement for the dispute record",
                ),
                "Provide dispute case number and 5-7 business day resolution timeline.",
            ],
            on_complete=lambda fields: print(f"POD dispute statement collected: {dispute_id} — {contact_type}"),
        )

guava.dial(
    controller=PODDisputeBot,
    controller_args={"contact_name": "Receiving Manager, Westfield Distribution",
                     "dispute_id": "POD-2024-4421", "delivery_date": "November 12",
                     "shipment_description": "2 pallets of electronics components",
                     "contact_type": "consignee"},
    to=os.environ["CONTACT_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 PODDisputeBot(guava.CallController):
    def __init__(self, contact_name: str, dispute_id: str, delivery_date: str,
                 shipment_description: str, contact_type: str):
        super().__init__()
        self.set_persona(
            organization_name="Apex Logistics Resolution Center",
            agent_name="Kim",
        )
        self.set_task(
            objective=f"Investigate POD dispute {dispute_id} with {contact_name} ({contact_type})",
            checklist=[
                f"Introduce yourself to {contact_name} regarding dispute {dispute_id} for delivery on {delivery_date}.",
                guava.Field(
                    key="received_shipment",
                    field_type="bool",
                    description=f"Did {contact_name} {'receive' if contact_type == 'consignee' else 'deliver'} the shipment?",
                ),
                guava.Field(
                    key="delivery_location_confirmed",
                    field_type="text",
                    description="Exact location where delivery was made or claimed to be made",
                ),
                guava.Field(
                    key="who_signed",
                    field_type="text",
                    description="Name and title of person who signed (or claims to have signed)",
                    required=False,
                ),
                guava.Field(
                    key="cctv_available",
                    field_type="bool",
                    description="Is there security camera footage available at the delivery location?",
                ),
                guava.Field(
                    key="statement_for_record",
                    field_type="text",
                    description="Official statement for the dispute record",
                ),
                "Provide dispute case number and 5-7 business day resolution timeline.",
            ],
            on_complete=lambda fields: print(f"POD dispute statement collected: {dispute_id} — {contact_type}"),
        )

guava.dial(
    controller=PODDisputeBot,
    controller_args={"contact_name": "Receiving Manager, Westfield Distribution",
                     "dispute_id": "POD-2024-4421", "delivery_date": "November 12",
                     "shipment_description": "2 pallets of electronics components",
                     "contact_type": "consignee"},
    to=os.environ["CONTACT_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