Open History to see the last commit
1/**
2 * The corpus this example reranks.
3 *
4 * These are *objects*, not strings, on purpose: `rerank()` is generic over the
5 * document element type. Object documents are serialized with `JSON.stringify`
6 * before they go to the provider, and the original object comes back on
7 * `ranking[n].document` — fully typed, so the UI can read `.title` off a result
8 * without a cast or an id lookup.
9 *
10 * The array order below is deliberately unhelpful. It is roughly "newest
11 * article first", which is what a plain CMS listing gives you, and it is a poor
12 * answer to every query in `EXAMPLE_QUERIES`. That contrast is the whole point
13 * of the demo: the left column is this order, the right column is what the
14 * rerank model does with it.
15 */
16export interface SupportDoc {
17 id: string
18 title: string
19 body: string
20}
21
22export const SUPPORT_DOCS: Array<SupportDoc> = [
23 {
24 id: 'shipping-zones',
25 title: 'Shipping zones and delivery estimates',
26 body: 'Orders ship from the closest fulfilment centre. Domestic delivery takes two to five business days; international delivery takes seven to twenty-one business days and may be held by customs.',
27 },
28 {
29 id: 'password-reset',
30 title: 'Resetting your password',
31 body: 'Use "Forgot password" on the sign-in screen. The reset link is valid for one hour. If it expires, request a new one — old links cannot be reused.',
32 },
33 {
34 id: 'gift-cards',
35 title: 'Buying and redeeming gift cards',
36 body: 'Gift cards are delivered by email and never expire. Redeem one by entering its code at checkout. Gift card balances cannot be transferred back to a bank account.',
37 },
38 {
39 id: 'cancel-subscription',
40 title: 'Cancelling your subscription',
41 body: 'Open Settings → Billing → Cancel plan. Cancellation takes effect at the end of the current billing period, so you keep access until then. You are not charged again after cancelling.',
42 },
43 {
44 id: 'two-factor',
45 title: 'Turning on two-factor authentication',
46 body: 'Settings → Security → Two-factor. We support authenticator apps and hardware keys. Save your recovery codes somewhere safe — support cannot regenerate them for you.',
47 },
48 {
49 id: 'refund-window',
50 title: 'Refund window and how refunds are paid',
51 body: 'Ask for a refund within thirty days of a charge. Approved refunds go back to the original payment method and usually clear within five to ten business days.',
52 },
53 {
54 id: 'seat-management',
55 title: 'Adding and removing team seats',
56 body: 'Workspace owners can add or remove seats at any time. Adding a seat is billed pro rata immediately; removing a seat credits the unused time to your next invoice.',
57 },
58 {
59 id: 'downgrade-plan',
60 title: 'Downgrading instead of cancelling',
61 body: 'If you want to stop paying but keep your data, downgrade to the free tier rather than cancelling. Downgrades apply at the next renewal and your projects stay read-only rather than being deleted.',
62 },
63 {
64 id: 'export-data',
65 title: 'Exporting your data',
66 body: 'Settings → Data → Export produces a ZIP archive of your projects as JSON. Exports are generated in the background; you get an email with a download link valid for 24 hours.',
67 },
68 {
69 id: 'api-rate-limits',
70 title: 'API rate limits',
71 body: 'The API allows 600 requests per minute per key. Exceeding it returns HTTP 429 with a Retry-After header. Rate limits are per key, not per workspace.',
72 },
73]
74
75/** Prompts shown as one-click chips above the query box. */
76export const EXAMPLE_QUERIES = [
77 'how do I stop being billed every month?',
78 'I want my money back for a charge',
79 'I lost access to my account',
80 'can I keep my projects without paying?',
81]