Cartesiandocs

Customize

Copy and strings

Rename the assistant and change every piece of copy, including the welcome heading, placeholder and disclaimer.

val options = CartesianOptions.Builder()
    .title("FreshMart Assistant")             // header, Ask button, "Ask … anything"
    .starters(listOf(
        "Plan 3 vegetarian dinners for a family of 4",
        "Find whole milk and add the cheapest gallon to my cart",
    ))
    .strings(
        CartesianStrings.Builder()
            .heading("What's on your ", emphasis = "grocery", after = " list?")
            .subtitle("Tell me what you're cooking. I'll find it, compare it and fill your cart.")
            .placeholder("Ask about any product")
            .disclaimer("Answers can be wrong. Check prices and ingredients before you buy.")
            .cartName("basket")
            .signedOut("Sign in to FreshMart to use the assistant.")
            .build(),
    )
    .build()
Builder callWhat it changes
heading(before, emphasis, after)The welcome heading. emphasis is set in the emphasis font (serif italic by default).
subtitleThe line under the welcome heading
placeholderComposer placeholder
disclaimerThe small print under the composer
cartNameHow the cart is named in confirmations ("Added 2 items to your basket")
signedOutShown when the shopper isn't signed in and you haven't handled onSignInRequired

Anything you don't set uses the copy for your vertical, Grocery or Apparel.

Localisation

CartesianStrings takes plain strings, so you can load them from your own resources:

CartesianStrings.Builder()
    .placeholder(context.getString(R.string.assistant_placeholder))
    .build()
kotlin

Some status messages, such as offline banners and error titles, are not configurable yet. They will move into CartesianStrings before 1.0.