Documentation
¶
Overview ¶
Package solving is the solution of tasks from paper by AI: a model sees the task's crop, as app cut it from the photo of the page, with the tasks on it it is to solve, each by its number and its statement as the reading of the statement gave them, solves each, and gives its answer — a number, or the label of an option the page prints — or none when the task has no one answer of these kinds. The program holds the answer to the rules of a key and compares the reading of the work with it (module-kit's paper); the model never judges the learner's work. It is the capability task_solving of spec's admission table, and serves a task whose statement is no formula the solver takes.
Index ¶
- Constants
- Variables
- func Answered(answers map[int]*paperv1.Answer) (string, error)
- func Fingerprint() string
- func Instructions() string
- func Read(answer string, asked []Task) (map[int]*paperv1.Answer, error)
- func RequestOf(crop provider.Image, width, height int, tasks []Task) provider.Request
- type Task
Constants ¶
const ( KindNumber = "number" KindChoice = "choice" KindNone = "none" )
The kinds of an answer, as the schema names them.
const MaxOutputTokens = 16000
MaxOutputTokens is the most a call may write, thinking included: the bound of the runner's calls, as for every call of the library that reasons.
const Version = 2
Version is the version of the prompt. A change to a word a model reads is a new version, and the entry of the list that admitted the prompt admits it no longer. TestFrozenV2 holds it.
Variables ¶
var Schema = map[string]any{ "type": "object", "additionalProperties": false, "required": []string{"answers"}, "properties": schemaProperties, }
Schema is the answer every model returns.
Functions ¶
func Answered ¶
Answered is the answer of a model that gives the Answer of each task by its number, or none for nil, as Read takes it back: what the runner's stub answers by the truth of a case.
func Fingerprint ¶
func Fingerprint() string
Fingerprint names the prompt: the SHA-256 of every word a model reads besides the crop — the instructions, the label, the text and the schema, whose names the model reads too. An entry of the list of admitted models holds it (admission.Entry).
func Read ¶
Read takes a model's answer apart as strictly as the schema, into the Answer of each task asked, by its number, nil for the kind none. An answer of a task not asked, or two of one, is off the schema; a task asked with no answer has none. The fields of the other kind are not read. Whether an answer holds to the rules of a key module-kit says (paper.Breach): an answer that breaks one is no key, and no failure of the call.
func RequestOf ¶
RequestOf is what the solution asks of a model about a task's crop, as provider.Photo gives it, of width × height px: the instructions, the crop after its label, its size and the tasks to solve, which are data, a model's reading of the page. The model, its effort and how many tokens it may write the caller sets.