Typed decisions
Choice, score, and yes/no decision kinds and how to pass options.
strike-1 always returns one of a fixed set of options you define. The SDK maps three kinds to the HTTP API.
Choice
Pick exactly one label from a list (routing, classification, policy branches).
Python
import strikeflow as strike
teams = ["billing", "tech", "sales"]
result = strike.decide(
"Which team should handle this ticket?",
teams,
messages=[{"role": "user", "content": "I was charged twice for invoice 4411."}],
)
assert result.kind == "choice"
assert result.answer in teamsUse strike.Choice(["billing", "tech", "sales"], instructions="Prefer billing for payment issues.") when you want a reusable Decision object.
Yes / no
Pass "yes_no", None, or omit options for a boolean-style decision.
Python
import strikeflow as strike
result = strike.decide(
"Should a human take over?",
"yes_no",
context="Customer is furious after a third outage this week.",
)
assert result.answer in ("yes", "no")
assert result.yes is (result.answer == "yes")Score
Ordered levels from lowest to highest. Pass an int (default 1..5) or an explicit list of labels.
Python
import strikeflow as strike
result = strike.decide(
"How urgent is this incident?",
5,
context="Production checkout is down for all users.",
)
assert result.kind == "score"
# result.score is the expected level on the scale (weighted by probabilities)Custom labels:
Python
levels = ["low", "medium", "high", "critical"]
result = strike.decide("Severity?", levels, context="Single user cannot log in.")Validation rules (client-side)
- At least two unique options.
- Score scales must have 2 to 10 levels.
Violations raise ValueError before any network call.