Legal & Professional Services

Deposition & Hearing Scheduling

Coordinate deposition and hearing scheduling across multiple parties and counsel by phone, eliminating email chains and calendar confusion.

Why this matters

Streamline client intake, scheduling, document collection, and billing follow-up for law firms and professional services organizations. This example shows you how to automate deposition & hearing scheduling 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 DepositionSchedulerBot(guava.CallController):
    def __init__(self, witness_name: str, case_name: str, case_number: str,
                 requesting_firm: str, available_slots: list[str]):
        super().__init__()
        self.set_persona(
            organization_name=f"{requesting_firm} Legal Calendar",
            agent_name="Avery",
        )
        self.set_task(
            objective=f"Schedule deposition of {witness_name} in case {case_name} ({case_number})",
            checklist=[
                f"Identify yourself to {witness_name} or their counsel regarding deposition scheduling for {case_name}.",
                guava.Field(
                    key="speaking_with",
                    field_type="choice",
                    description="Speaking with witness directly or their counsel?",
                    choices=["witness directly", "witness's attorney", "paralegal"],
                ),
                guava.Field(
                    key="preferred_slot",
                    field_type="calendar_slot",
                    description="Preferred deposition date and time",
                    choice_generator=lambda: available_slots,
                ),
                guava.Field(
                    key="location_preference",
                    field_type="choice",
                    description="Preferred deposition format",
                    choices=["in-person at our office", "in-person at your office",
                             "remote via Zoom", "court reporter's office"],
                ),
                guava.Field(
                    key="interpreter_needed",
                    field_type="bool",
                    description="Will an interpreter be required?",
                ),
                guava.Field(
                    key="counsel_contact",
                    field_type="text",
                    description="Counsel's name and email for notice of deposition",
                    required=False,
                ),
                "Confirm scheduled time and advise that formal notice will follow.",
            ],
            on_complete=lambda fields: print(f"Deposition scheduled for {witness_name}: {fields.get('preferred_slot')}"),
        )

guava.dial(
    controller=DepositionSchedulerBot,
    controller_args={"witness_name": "Dr. Patricia Simmons",
                     "case_name": "Martinez v. Westfield Medical Group",
                     "case_number": "CV-2024-10847",
                     "requesting_firm": "Morrison & Hayes LLP",
                     "available_slots": ["Dec 3 at 9am", "Dec 5 at 1pm", "Dec 10 at 10am", "Dec 12 at 2pm"]},
    to=os.environ["WITNESS_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 DepositionSchedulerBot(guava.CallController):
    def __init__(self, witness_name: str, case_name: str, case_number: str,
                 requesting_firm: str, available_slots: list[str]):
        super().__init__()
        self.set_persona(
            organization_name=f"{requesting_firm} Legal Calendar",
            agent_name="Avery",
        )
        self.set_task(
            objective=f"Schedule deposition of {witness_name} in case {case_name} ({case_number})",
            checklist=[
                f"Identify yourself to {witness_name} or their counsel regarding deposition scheduling for {case_name}.",
                guava.Field(
                    key="speaking_with",
                    field_type="choice",
                    description="Speaking with witness directly or their counsel?",
                    choices=["witness directly", "witness's attorney", "paralegal"],
                ),
                guava.Field(
                    key="preferred_slot",
                    field_type="calendar_slot",
                    description="Preferred deposition date and time",
                    choice_generator=lambda: available_slots,
                ),
                guava.Field(
                    key="location_preference",
                    field_type="choice",
                    description="Preferred deposition format",
                    choices=["in-person at our office", "in-person at your office",
                             "remote via Zoom", "court reporter's office"],
                ),
                guava.Field(
                    key="interpreter_needed",
                    field_type="bool",
                    description="Will an interpreter be required?",
                ),
                guava.Field(
                    key="counsel_contact",
                    field_type="text",
                    description="Counsel's name and email for notice of deposition",
                    required=False,
                ),
                "Confirm scheduled time and advise that formal notice will follow.",
            ],
            on_complete=lambda fields: print(f"Deposition scheduled for {witness_name}: {fields.get('preferred_slot')}"),
        )

guava.dial(
    controller=DepositionSchedulerBot,
    controller_args={"witness_name": "Dr. Patricia Simmons",
                     "case_name": "Martinez v. Westfield Medical Group",
                     "case_number": "CV-2024-10847",
                     "requesting_firm": "Morrison & Hayes LLP",
                     "available_slots": ["Dec 3 at 9am", "Dec 5 at 1pm", "Dec 10 at 10am", "Dec 12 at 2pm"]},
    to=os.environ["WITNESS_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