Cite.Screen (Cite v0.1.0)

Copy Markdown View Source

Round 1, minus the client call: every detect asked of every passage, a window of passages per request, and the replies folded into scores. Pure. Internal.

Summary

Functions

One request: the window under the source's as, and every detect asked of every passage in it, keyed "<passage id>:<detect>".

Folds judged windows into the run. It sets screen, the scores per passage and detect, adds one Cite.Error per failed window, and adds each reply's usage and model to the run's. A failed window leaves its passages without a row.

Types

outcome()

@type outcome() :: {[Cite.Passage.t()], {:ok, map()} | {:error, term()}}

screen()

@type screen() :: %{required(String.t()) => %{required(atom()) => number()}}

Functions

request(run, window)

@spec request(Cite.Run.t(), [Cite.Passage.t()]) :: map()

One request: the window under the source's as, and every detect asked of every passage in it, keyed "<passage id>:<detect>".

resolve(run, outcomes)

@spec resolve(Cite.Run.t(), [outcome()]) :: Cite.Run.t()

Folds judged windows into the run. It sets screen, the scores per passage and detect, adds one Cite.Error per failed window, and adds each reply's usage and model to the run's. A failed window leaves its passages without a row.