Skip to main content

AI Rulebook prompt guide

@slip/sdk/ai uses AI SDK structured output. The model emits a semantic team-stat expression and complete integer bands. It never emits trusted fixture IDs, stat keys, fees, deadlines, stakes, or settlement values. Consumer labels are immutable input. The compiler validates their count, uniqueness, and 48-byte on-chain limit, then installs the caller’s exact strings instead of trusting model-written display copy. For three-way result markets, Slip derives the away/draw/home roles and mechanically constructs the only valid (-∞, 0), [0, 1), [1, ∞) partition. The compiler derives canonical TxLINE keys and rejects gaps, overlaps, missing outcomes, duplicate labels, player props, ambiguous periods, and unsupported statistics. For a validated both-teams-to-score expression (Min(home goals, away goals)) split at one, Slip also derives No and Yes from the two band roles. Model-written labels cannot reverse the market. Compilation is fixture-aware rather than phrase-only. The authenticated TxLINE lookup supplies the teams, competition, kickoff, fixture ID, and current game state alongside the room’s question and exact ordered poll labels. Context can disambiguate references such as “home”, “away”, or the team names, but it cannot expand the proof contract: event-order markets such as “who scores first” remain unsupported until Slip has an on-chain ordered-event expression and corresponding TxLINE Merkle proof verifier. Use examples that vary meaning rather than phrases:
  • binary: both teams score, with No and Yes;
  • three outcomes: home win, draw, away win;
  • five outcomes: total goals or corners split into five complete bands;
  • periods: first-half or second-half cards and corners;
  • rejection: player shots, possession, or incomplete ranges.
Run the provider test against each configured Groq model:
These commands are credential- and network-dependent. Each run selects exactly one model and fails without falling back to the other. Do not replace either call with fixed model output. Qwen runs in Groq JSON Object mode with reasoning disabled and a bounded output budget; GPT-OSS uses Groq constrained JSON Schema. Both responses pass the same local Zod schema and deterministic protocol validator. A missing, malformed, or Groq-rejected JSON response gets at most one regeneration inside the original total deadline. It never falls back to another model.

Failure contract

The SDK throws MarketRuleCompilationError with a stable code and retryable flag. The web API maps those errors without exposing provider messages, request bodies, response bodies, or credentials. The UI renders the public code and retry guidance in an accessible alert. Rejected and failed compilations clear any previous Rulebook, so no stale market can be signed.