Use built-in helpers from conv.utils to extract structured data from user input.
conv.utils
property provides helper methods for extracting and validating information from the most recent user input during a conversation. These helpers are LLM-powered and return typed objects you can store in conv.state
or use in your logic.
extract_address
addresses
: Optional list of Address
objects to match against. Street name must be specified for each address.country
: Optional country code to filter on (default "US"
).Address
instance with available fields populated. Some fields may be None
if not provided.ExtractionError
if parsing fails.extract_city
city_spellings
: Optional list of spelled-out city names to match.states
: Optional list of states to filter on.country
: Optional country code to filter on (default "US"
).Address
instance where the city
field is populated; other fields may be None
.ExtractionError
if parsing fails.Address
typeAddress
type:
conv
object — full list of conversation methods and attributes.