docs/get_field()

get_field()

After the checklist completes and agent.on_task_complete fires, use call.get_field() to retrieve collected values by their key. This is where you write results to your CRM, database, or EHR.

signature
def get_field(field_key: str) -> str | int | dict | None
example.py
@agent.on_task_complete("schedule_appointment")
def on_appointment_scheduled(call: guava.Call):
    appointment_time = call.get_field("appointment_time")
    patient_name = call.get_field("patient_name")
    # Write to your CRM / EHR
    save_appointment(patient_name, appointment_time)
    call.hangup()

Return types by field type

The type of the value returned by get_field() depends on the field's field_type:

field_typeReturned value
textstr
datedict with keys year, month, day (all int)
integerint
multiple_choicestr (guaranteed to be one of the values in choices or returned by choice_generator)
calendar_slotISO-8601 datetime string (e.g. "2022-12-25T16:30")

Tip: You can call get_field() at any point after the field has been collected — not just in on_task_complete. Use it in mid-call callbacks to personalize subsequent steps.

Questions? hi@goguava.ai