functai for TypeScript - v0.1.0
    Preparing search index...

    Class Prediction<O, A>

    Everything one call produced. answer is the value a call returns.

    Type Parameters

    • O = Rec
    • A = unknown
    Index
    • Type Parameters

      • O = Rec
      • A = unknown

      Parameters

      • outputs: O
      • answerName: string
      • callId: string
      • turn: Turn
      • response: Response | null
      • responses: readonly Response[]
      • repairs: readonly unknown[] = []

      Returns Prediction<O, A>

    answerName: string
    callId: string

    The call log's id of this call: rate it with rate(prediction, "right").

    first: Prediction<Rec, unknown> | null = null

    A first model was unsure and another answered: the first one's prediction (escalateTo).

    outputs: O

    Every output, by name.

    probabilities: Record<string, Record<string, number>> = {}

    The probabilities the model measured for its own answers, by output ({ result: { billing: 0.93, shipping: 0.05 } }); empty when it measures none: only TypeSafe (typesafe:jev-latest) and servers that score tokens do (a model's own words about its confidence are not one).

    repairs: readonly unknown[]
    response: Response | null
    responses: readonly Response[]
    turn: Turn

    The lmcc turn: inputs, every model step and tool result, outputs.

    • get confidence(): number | null

      The probability the model gave its own answer, the lowest over the outputs it measured; null when it measured none.

      Returns number | null

    • get usage(): Record<string, number>

      Tokens, summed over every reply: inputTokens, outputTokens, totalTokens, …

      Returns Record<string, number>