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()let options = CartesianOptions(
title: "FreshMart Assistant",
starters: ["Plan 3 vegetarian dinners for a family of 4", "Find whole milk and add the cheapest gallon to my cart"],
strings: CartesianStrings(
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."
).heading("What's on your ", emphasis: "grocery", after: " list?")
)const options = {
title: "FreshMart Assistant",
starters: ["Plan 3 vegetarian dinners for a family of 4", "Find whole milk and add the cheapest gallon to my cart"],
strings: {
heading: { before: "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.",
},
};| Builder call | What it changes |
|---|---|
heading(before, emphasis, after) | The welcome heading. emphasis is set in the emphasis font (serif italic by default). |
subtitle | The line under the welcome heading |
placeholder | Composer placeholder |
disclaimer | The small print under the composer |
cartName | How the cart is named in confirmations ("Added 2 items to your basket") |
signedOut | Shown 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()kotlinSome status messages, such as offline banners and error titles, are not configurable yet. They will move into CartesianStrings before 1.0.