| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Agentic.Questions
Contents
Description
Questions for a System One model such as Jev: a step asks Questions
about its input.
Synopsis
- data Questions a = Questions {}
- yesNo :: Text -> Questions YesNo
- choice :: Options a => Text -> Questions (Choice a)
- score :: Options a => Text -> Questions (Score a)
- data Probability
- probability :: Probability -> Double
- toProbability :: Double -> Probability
- basisPoints :: Probability -> Int
- fromBasisPoints :: Int -> Probability
- newtype YesNo = YesNo {
- yes :: Probability
- data Choice a = Choice {
- chosen :: a
- probabilities :: [(a, Probability)]
- confidence :: Probability
- data Score a = Score {
- position :: Double
- probabilities :: [(a, Probability)]
- confidence :: Probability
- data QuestionSpec
- data Answer
- data JudgeRequest = JudgeRequest {
- input :: Value
- questions :: [QuestionSpec]
- decodeAnswers :: Questions a -> [Answer] -> Either Text a
Questions
One or more questions about the same input, sent as one request. Combine them applicatively:
judge (Review <$> funny <*> groan)
yesNo :: Text -> Questions YesNo Source #
Jev's Noul primitive: how likely is it that the answer is yes?
score :: Options a => Text -> Questions (Score a) Source #
Place the input on an Options type's levels, lowest first.
Answers
data Probability Source #
A probability, held as basis points (0–10000) so that results replay and
compare exactly. Write literals directly: 0.9 :: Probability.
Instances
probability :: Probability -> Double Source #
toProbability :: Double -> Probability Source #
Convert a provider's probability, rounding once (half to even).
basisPoints :: Probability -> Int Source #
fromBasisPoints :: Int -> Probability Source #
Jev's Noul: the probability that the answer is yes.
Constructors
| YesNo | |
Fields
| |
Constructors
| Choice | |
Fields
| |
Constructors
| Score | |
Fields
| |
Wire types
data QuestionSpec Source #
Constructors
| AskYesNo Text | |
| AskChoice Text [(Text, Maybe Text)] | Option labels with their descriptions. |
| AskScore Text [(Text, Maybe Text)] | Levels in order, lowest first. |
Instances
| Eq QuestionSpec Source # | |
Defined in Agentic.Questions | |
| Ord QuestionSpec Source # | |
Defined in Agentic.Questions Methods compare :: QuestionSpec -> QuestionSpec -> Ordering # (<) :: QuestionSpec -> QuestionSpec -> Bool # (<=) :: QuestionSpec -> QuestionSpec -> Bool # (>) :: QuestionSpec -> QuestionSpec -> Bool # (>=) :: QuestionSpec -> QuestionSpec -> Bool # max :: QuestionSpec -> QuestionSpec -> QuestionSpec # min :: QuestionSpec -> QuestionSpec -> QuestionSpec # | |
| Show QuestionSpec Source # | |
Defined in Agentic.Questions Methods showsPrec :: Int -> QuestionSpec -> ShowS # show :: QuestionSpec -> String # showList :: [QuestionSpec] -> ShowS # | |
Constructors
| YesNoAnswer Probability | |
| ChoiceAnswer Text [(Text, Probability)] Probability | The chosen label, every label's probability, and the confidence. |
| ScoreAnswer Double [(Int, Probability)] Probability | The position, each level's probability (by index), and the confidence. |
data JudgeRequest Source #
What a System One provider receives: the encoded input and the questions.
Constructors
| JudgeRequest | |
Fields
| |
Instances
| Eq JudgeRequest Source # | |
Defined in Agentic.Questions | |
| Ord JudgeRequest Source # | |
Defined in Agentic.Questions Methods compare :: JudgeRequest -> JudgeRequest -> Ordering # (<) :: JudgeRequest -> JudgeRequest -> Bool # (<=) :: JudgeRequest -> JudgeRequest -> Bool # (>) :: JudgeRequest -> JudgeRequest -> Bool # (>=) :: JudgeRequest -> JudgeRequest -> Bool # max :: JudgeRequest -> JudgeRequest -> JudgeRequest # min :: JudgeRequest -> JudgeRequest -> JudgeRequest # | |
| Show JudgeRequest Source # | |
Defined in Agentic.Questions Methods showsPrec :: Int -> JudgeRequest -> ShowS # show :: JudgeRequest -> String # showList :: [JudgeRequest] -> ShowS # | |