Logistics & Supply Chain

Damaged Goods Claims Intake

Collect structured damage reports from consignees immediately upon discovery, creating a timestamped record that satisfies carrier liability requirements.

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 damaged goods claims intake 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 DamagedGoodsBot(guava.CallController):
    def __init__(self, claimant_name: str, bill_of_lading: str):
        super().__init__()
        self.set_persona(
            organization_name="Apex Logistics Claims",
            agent_name="Casey",
        )
        self.set_task(
            objective=f"Intake damaged goods claim for {claimant_name}, BOL {bill_of_lading}",
            checklist=[
                f"Express concern to {claimant_name} and explain you'll document everything for their claim.",
                guava.Field(
                    key="damage_discovered_when",
                    field_type="choice",
                    description="When was the damage discovered?",
                    choices=["at delivery — noted on BOL", "after driver left", "during unloading", "at inspection days later"],
                ),
                guava.Field(
                    key="items_damaged",
                    field_type="text",
                    description="Description of damaged items and quantity",
                ),
                guava.Field(
                    key="damage_type",
                    field_type="choice",
                    description="Type of damage",
                    choices=["crushed/impact", "water/moisture", "theft/missing", "contamination", "temperature", "other"],
                ),
                guava.Field(
                    key="estimated_value",
                    field_type="currency",
                    description="Estimated value of damaged goods",
                ),
                guava.Field(
                    key="photos_available",
                    field_type="bool",
                    description="Are photos available to attach to the claim?",
                ),
                guava.Field(
                    key="email_for_claim",
                    field_type="email",
                    description="Email to send claim number and next steps",
                ),
                "Provide claim number and estimated processing timeline of 5-7 business days.",
            ],
            on_complete=lambda fields: print(f"Damage claim created for BOL {bill_of_lading}: {fields}"),
        )

guava.listen(
    controller=DamagedGoodsBot,
    controller_args={"claimant_name": "caller", "bill_of_lading": "TBD from caller"},
    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 DamagedGoodsBot(guava.CallController):
    def __init__(self, claimant_name: str, bill_of_lading: str):
        super().__init__()
        self.set_persona(
            organization_name="Apex Logistics Claims",
            agent_name="Casey",
        )
        self.set_task(
            objective=f"Intake damaged goods claim for {claimant_name}, BOL {bill_of_lading}",
            checklist=[
                f"Express concern to {claimant_name} and explain you'll document everything for their claim.",
                guava.Field(
                    key="damage_discovered_when",
                    field_type="choice",
                    description="When was the damage discovered?",
                    choices=["at delivery — noted on BOL", "after driver left", "during unloading", "at inspection days later"],
                ),
                guava.Field(
                    key="items_damaged",
                    field_type="text",
                    description="Description of damaged items and quantity",
                ),
                guava.Field(
                    key="damage_type",
                    field_type="choice",
                    description="Type of damage",
                    choices=["crushed/impact", "water/moisture", "theft/missing", "contamination", "temperature", "other"],
                ),
                guava.Field(
                    key="estimated_value",
                    field_type="currency",
                    description="Estimated value of damaged goods",
                ),
                guava.Field(
                    key="photos_available",
                    field_type="bool",
                    description="Are photos available to attach to the claim?",
                ),
                guava.Field(
                    key="email_for_claim",
                    field_type="email",
                    description="Email to send claim number and next steps",
                ),
                "Provide claim number and estimated processing timeline of 5-7 business days.",
            ],
            on_complete=lambda fields: print(f"Damage claim created for BOL {bill_of_lading}: {fields}"),
        )

guava.listen(
    controller=DamagedGoodsBot,
    controller_args={"claimant_name": "caller", "bill_of_lading": "TBD from caller"},
    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