tutorstub

package
v0.1.92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tutorstub is the stub of tutor in api's dev mode: it stands behind the ports through which api calls tutor — the readings of a sheet and an essay, the assessment of an essay, the tutor's words, the finding of the tasks on the photo of a page, the check of a task from paper and the drawing of grown-up mode — so that a run of the path on the dev projects calls no provider and costs nothing. Admission and the prices stay tutor's own, on the real table, by the gate the dev mode builds with the stub's adapter (admission.StubAdapters); only the calls are the stub's.

The stub reads a sheet by the shape of its crop: wider than tall is the right value, taller than wide a wrong one — the slot's first trap value, or the first value its check holds not right —, and square is illegible. It finds the values by module-kit's verdict on the instance, the key with it, which the stub alone is given: tutor sees the open view. It reads an essay by the shape of the sheet's crop too — wider than tall a text of its own, taller than wide a blank sheet, square illegible —, and assesses the text every criterion met but the last. It finds the tasks on the photo of a page by its shape as well: taller than wide five tasks, one under another, wider than tall none, and square a failure of AI. A task from paper it reads for "Recognise" by the shape of its statement — wider than tall one task, at least twice as tall as wide three, otherwise one word problem — and checks by the shape of the work, which takes in the tracing paper, on as many tasks as it is told, or, told none, as many as "Recognise" reads: more than twice as wide as tall every task correct, wider but not twice the first not yet, square every task so far correct, taller but not twice unreadable, and at least twice as tall nothing written. Its words — a rung's questions, the Check's words and ladder, the praise after a correct answer and the feedback on an essay — are its own, which pass the leak check and the form check. Its act of grown-up mode is a red line under the lowest stroke of the sheet. Each call spends what tutor expects a call of its kind to cost on its route, so that the quota runs out as on the models.

On an own key a call ends by how the key ends, as a provider would refuse it (KeyRefused and the endings beside it): api hands the stub the key's value beside the call, which tutor takes from the route alone, and the stub reads its ending and keeps nothing of it.

api takes the stub off a deployment alone: the configuration refuses it there, as api refuses the emulator of the sign-in service.

Index

Constants

View Source
const (
	KeyRefused      = "-refused"
	KeyLimit        = "-limit"
	KeyLimitOwner   = "-limit-owner"
	KeyLimitTier    = "-limit-tier"
	KeyLimitBalance = "-limit-balance"
	KeyLimitPayment = "-limit-payment"
)

The endings of a synthetic own key that a call of AI on the stub reads, past the checks of the request's form, as a provider would answer it: the key refused, or a limit — named by none of tutor's reasons, or by one; the ceiling of the tier with when access returns, as tutor's adapter of Claude gives it. A key that ends in none of them calls the stub as platform AI does. docs/build.md names them for app; CheckOwnKey takes them all.

View Source
const Model = "stub"

Model is the model the stub's usage names in the log's line ai_usage, so that no line of it is taken for a model's.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

type Gate interface {
	Reads(call tutor.Call, category formatv0.AgeCategory, ownKeyProvider string) bool
	Words(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool
	PaperWords(category formatv0.AgeCategory, ownKeyProvider string) bool
	CorrectWords(category formatv0.AgeCategory, ownKeyProvider string) bool
	Price(call tutor.Call, route tutor.Route) tutor.CallPrice
	Reading() tutor.Reading
}

Gate is what the stub asks of the gate of admission: whether a reading and the tutor's words are admitted, what a call is expected to cost, and the mode tutor reads handwriting by, which says how many readers read a sheet.

type Stub

type Stub struct {
	// contains filtered or unexported fields
}

Stub reads sheets and essays, assesses essays and words the tutor's words in place of tutor.

func New

func New(gate Gate) *Stub

New is the stub over gate, the dev mode's gate of admission.

func (*Stub) AssessEssay added in v0.1.49

func (s *Stub) AssessEssay(ctx context.Context, r tutor.RubricAssessment, own string) tutor.RubricAssessed

AssessEssay assesses the text of r by the criteria of its rubric as the stub does: every criterion met but the last, each with the stub's synthetic evidence, and the stub's feedback in the language of r — English for a language it has no words of —, which passes the leak check and words.Feedback against any text, since it quotes none. Of tutor's checks before its call the stub keeps those of the request's form: no text, no criterion or a blank one, no topic, no style, or a language words.Feedback cannot check, fails, as does a request whose context ended, every criterion without a mark. Past those checks an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallRubric on the route, tutor's by the entry the author's word admits; with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent.

func (*Stub) CheckPaper added in v0.1.80

func (s *Stub) CheckPaper(ctx context.Context, c tutor.PaperCheck, own string) tutor.PaperChecked

CheckPaper checks the work of c by the shape of its crop, which takes in the tracing paper, the same for each of its c.Tasks tasks — told none, as many as ReadStatement reads on its statement, three on one at least twice as tall as wide, else one —, each in a band of the crop of its own, one under another: more than twice as wide as tall, each task correct, stubKey read; wider but not twice, the first task incorrect, a wrong value read, with one error, and the others correct; square, each task with no answer yet, a start of the solution read and no error; taller but not twice, each unreadable; at least twice as tall, each with no answer and nothing read. Each slot has the hidden solution stubSolution, and the ladder is the stub's questions in the language of c. Of tutor's checks before its call the stub keeps those of the request's form: a count of tasks below 0 or above 20, a crop or an instruction that is no picture and a work that is no PNG fail with no usage. Past them an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) CorrectWords added in v0.1.45

func (s *Stub) CorrectWords(category formatv0.AgeCategory, ownKeyProvider string) bool

CorrectWords says whether the tutor's words after a correct answer are admitted, as the gate says.

func (*Stub) FindTasks added in v0.1.72

func (s *Stub) FindTasks(ctx context.Context, f tutor.TaskFinding, own string) tutor.TasksFound

FindTasks finds the tasks on the photo of f by its shape: taller than wide, pageTasks of them, one under another across the page, in its order, the first with the frame of an instruction in the margin above it; wider than tall, none, which the learner frames by hand; square, a failure of AI, which spends as a call that went. With the learner's request a photo not square has columnTasks of them, one under another in the left quarter, less those that cover a frame the learner drew, by tutor's own check. Of tutor's checks before its call the stub keeps the photo's form: one that is no JPEG or PNG fails with no usage. Past it an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallFinding, tutor's; with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent. It turns no photo: its turn is 0, the page taken as upright.

func (*Stub) GrownUp added in v0.1.81

GrownUp acts on the sheet in grown-up mode with an act of its own, so that app walks the mode without a model: one red line under the lowest stroke the request names, as wide as it, a little below it and kept on the work, or across the middle of the work when it names none, with words of its own in the language of g, English when it has none of it. It takes off nothing. Of tutor's checks before its call the stub keeps those of the request's form: a request with no words, no crop of the task, or a work that is no PNG fails with no usage. Past them an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) PaperWords added in v0.1.72

func (s *Stub) PaperWords(category formatv0.AgeCategory, ownKeyProvider string) bool

PaperWords says whether "explain differently" on a task from paper is admitted, as the gate says.

func (*Stub) ReadEssay added in v0.1.49

func (s *Stub) ReadEssay(ctx context.Context, r tutor.EssayReading, task formatv0.Task, own string) tutor.EssayRead

ReadEssay reads the essay of r, on task, by the shape of the crop of its sheet, as ReadSheet reads a sheet: wider than tall the stub's text, essayText; taller than wide a blank sheet, UNREADABLE_BLANK; square illegible, UNREADABLE_ILLEGIBLE. One reader reads it, as tutor's one model does, and the observation is of the one answer slot bound to the sheet, a value with no crop box, as tutor's. Of tutor's checks before its call the stub keeps those of the request's form: a task that is no handwriting sheet, has no slot bound to the sheet, more than one, or a slot bound otherwise, no open view of the task, a crop that is no PNG or is larger than maxCropSide on a side, and a request whose context ended, fail. Past those checks an own key of an ending of the stub's, own being its value, is refused by it. The call spends the expected price of CallEssay on the route, tutor's by the entry the author's word admits; with none, nothing priced, so the quota keeps its reserve by the value of the kind as spent.

func (*Stub) ReadSheet

func (s *Stub) ReadSheet(ctx context.Context, r tutor.SheetReading, task formatv0.Task, own string) tutor.SheetRead

ReadSheet reads the crop of r by its shape, on task, the instance whose open view r holds: each reader of the gate's mode reads the same, so module-kit joins the pair's as they are. A value stands with the crop box of the whole crop, in thousandths, and a reason with none, as an observation has them. A task with no answer slot bound anywhere, a crop that is no PNG, or a request whose context ended while the stub looked for a value, fails, as tutor's reading does. Past those checks an own key of an ending of the stub's is refused by it, own being its value.

func (*Stub) ReadStatement added in v0.1.72

func (s *Stub) ReadStatement(ctx context.Context, p tutor.PaperTask, own string) tutor.StatementRead

ReadStatement reads the statement of a task from paper by the shape of its crop: wider than tall, one task of the formula stubFormula; at least twice as tall as wide, the three tasks severalTasks; otherwise taller than wide or square, one task of no formula. Of tutor's checks before its call the stub keeps the crop's form: one that is no JPEG or PNG fails with no usage. Past it an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) Reads added in v0.1.49

func (s *Stub) Reads(call tutor.Call, category formatv0.AgeCategory, ownKeyProvider string) bool

Reads says whether the reading by the call of the kind is admitted for a learner of category, on the route of ownKeyProvider, as the gate says: admission is tutor's, so the stub admits no kind of call itself.

func (*Stub) TellCorrectWords added in v0.1.45

func (s *Stub) TellCorrectWords(ctx context.Context, c tutor.CorrectRequest, own string) tutor.CorrectAnswer

TellCorrectWords words the stub's praise in the language of c — of a step of the work when the work went, of the option chosen when it did not — with a question on the technique that helped as its last sentence, or, when the task names no technique, on how the answer was found, as tutor's prompt asks. They hold no number and tell no sex, so they pass the leak check and words.Correct. A language the stub has no words of gets English. Of tutor's checks before its call the stub keeps those of the request's form: no task, no style, no language, or a crop that is no PNG fails with no usage; the words of the task and the size of the crop it does not read. The call spends the expected price of CallCorrect, with the work or without it. Past those checks an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) TellPaperWords added in v0.1.72

func (s *Stub) TellPaperWords(ctx context.Context, w tutor.PaperWordsRequest, own string) tutor.WordsAnswer

TellPaperWords words "explain differently" on a task from paper with a question of the stub's own in the language of w, as TellWords does, and answers a learner's question with words of its own in that language, which name no number, so that app walks the conversation without a model. Of tutor's checks before its call the stub keeps those of the request's form: another kind of words, a question with no words, no style or a task not in the frame fails with no usage. Past them an own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) TellWords

func (s *Stub) TellWords(ctx context.Context, w tutor.WordsRequest, own string) tutor.WordsAnswer

TellWords words a question of the stub's own in the language of w: the first one of its list that w has not asked yet, so "explain differently" gets other words, and, once all were asked, the list again from its start. A language the stub has no list of gets English, which the form check turns down into the rung's fallback text. An own key of an ending of the stub's, own being its value, is refused by it.

func (*Stub) Words

func (s *Stub) Words(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool

Words says whether the tutor's words are admitted, as the gate says.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL