Building an Ask from one or more questions, and the type that computes its answers.
Attributes
Members list
Type members
Types
The positionally exact answer tuple for a tuple of questions.
The positionally exact answer tuple for a tuple of questions.
Tuple.InverseMap is what does the work: given (Question[A], Question[B]) it reduces to (A, B). It only reduces because every Question.* constructor returns the opaque Question[X] itself, uniformly and with an explicit return type.
Attributes
Value members
Concrete methods
Ask several questions together.
Ask several questions together.
Ask(urgency, team, frustration) // or Ask((urgency, team, frustration))
One method rather than an overload per arity: Scala tuples the arguments for you. It does not clash with the single-question overload below, whose erased signature differs by the evidence parameter.
IsMappedBy is what rejects a tuple holding something that is not a question.
There is no arity limit of ours. Jev documents none either -- it caps Choice options and Score levels, not how many questions a request carries, and its own examples batch more than a dozen, since one request is markedly cheaper and faster than several. OpenAI Decisions caps a request at 200 questions, which its protocol checks before sending.
In practice Scala's tuple-literal syntax stops at 22, which is also the largest result a caller can unpack with val (a, b, ...) =. Beyond that, build the tuple with *: and pass it here.
Attributes
Ask a single question.
Ask a single question.
Needed separately because one argument cannot be tupled into a 1-tuple.
Attributes
Positional question keys.
Positional question keys.
Zero padded so that lexicographic order matches positional order for the first hundred questions (q100 sorts before q11), which keeps the encoded request readable and its golden tests stable. Padded by hand rather than with f"q$i%02d", because Scala.js implements java.util.Formatter only partially.