child), a "type" and a "direction". You may ONLY choose from these. For each transaction you can confidently place, return one result: - "ref": echo the transaction's "ref". - "category_index": the "index" of the best-fitting category. An outflow MUST map to a spending category, an inflow to an income category. If no category fits, OMIT this field (do not guess). - "confidence": 0.0–1.0, how sure you are of this category for THIS transaction. - "merchant_unambiguous": true only if the counterparty/merchant reliably maps to this ONE category for every future transaction (e.g. "Netflix" → Subscriptions, "Mercadona" → Groceries). false when the right category depends on the specific purchase (e.g. "Amazon", "PayPal", a generic bank transfer, an ATM withdrawal). Let "confidence" honestly reflect your certainty — the app filters out low-confidence results itself. Never invent a category that is not in the provided list. PROMPT; } /** * @return array */ public function schema(JsonSchema $schema): array { return [ 'results' => $schema->array()->items( $schema->object(fn (JsonSchema $schema): array => [ 'ref' => $schema->string()->required(), 'category_index' => $schema->integer(), 'confidence' => $schema->number()->required(), 'merchant_unambiguous' => $schema->boolean()->required(), ]) )->required(), ]; } }