Documentation
¶
Overview ¶
Package admission is the function of admission to AI as api asks it before an attempt: the admission table of the release of spec that tutor reads, the facts the deployment declares in its file, and the least stage of tutor's rule of admission of models. What a task that AI checks may be given is what tutor chooses for the call it will make, by the call's prompt (Tutor.ChooseCall), and tutor asks the same before its call.
tutor calls a provider only through an adapter the service gives it, and api gives only Anthropic's: the admission table admits no model of another provider, and an adapter api does not give is an SDK its binary does not hold.
The file of facts and the stage are the deployment's, not the image's: with no file no fact holds, and the table closes platform AI while it leaves an adult's own key open; with no stage it is "full", closed by default. No model has passed the stage full, so there no reading is admitted at all, by an own key either: the first app passes "author". A fact or a provider the table does not name is a refusal of the configuration, since a typo would close a route without a word.
Index ¶
- Constants
- Variables
- func Adapters() map[admissionv0.Provider]provider.Dial
- func Load(cfg config.Admission) (*Gate, Report, error)
- func StubAdapters() map[admissionv0.Provider]provider.Dial
- func WordsCall(withWork bool) tutor.Call
- type Gate
- func (g *Gate) Admitted(call tutor.Call) []table.Model
- func (g *Gate) AssessEssay(ctx context.Context, r tutor.RubricAssessment) tutor.RubricAssessed
- func (g *Gate) CheckKey(ctx context.Context, category formatv0.AgeCategory, provider, key string) (tutor.KeyCheck, error)
- func (g *Gate) CheckPaper(ctx context.Context, c tutor.PaperCheck) tutor.PaperChecked
- func (g *Gate) CorrectWords(category formatv0.AgeCategory, ownKeyProvider string) bool
- func (g *Gate) FindTasks(ctx context.Context, f tutor.TaskFinding) tutor.TasksFound
- func (g *Gate) GrownUp(ctx context.Context, r tutor.GrownUpRequest) tutor.GrownUpAnswer
- func (g *Gate) OwnKeyOpen(category formatv0.AgeCategory, provider string) bool
- func (g *Gate) OwnKeyProviders(category formatv0.AgeCategory) []Provider
- func (g *Gate) PaperWords(category formatv0.AgeCategory, ownKeyProvider string) bool
- func (g *Gate) Price(call tutor.Call, route tutor.Route) tutor.CallPrice
- func (g *Gate) ReadEssay(ctx context.Context, r tutor.EssayReading) tutor.EssayRead
- func (g *Gate) ReadSheet(ctx context.Context, r tutor.SheetReading) tutor.SheetRead
- func (g *Gate) ReadStatement(ctx context.Context, p tutor.PaperTask) tutor.StatementRead
- func (g *Gate) ReadWorkbook(ctx context.Context, r tutor.WorkbookReading) tutor.WorkbookRead
- func (g *Gate) Reading() tutor.Reading
- func (g *Gate) Reads(call tutor.Call, category formatv0.AgeCategory, ownKeyProvider string) bool
- func (g *Gate) TellCorrectWords(ctx context.Context, c tutor.CorrectRequest) tutor.CorrectAnswer
- func (g *Gate) TellPaperWords(ctx context.Context, w tutor.PaperWordsRequest) tutor.WordsAnswer
- func (g *Gate) TellWords(ctx context.Context, w tutor.WordsRequest) tutor.WordsAnswer
- func (g *Gate) Words(withWork bool, category formatv0.AgeCategory, ownKeyProvider string) bool
- type Provider
- type Report
Constants ¶
const ( StubKeyInvalid = "-invalid" StubKeyNoPerm = "-noperm" StubKeySilent = "-silent" )
The endings of a synthetic key that the stub's check of a key reads; a key that ends in none of them is accepted, those by which the stub refuses a call of AI too (tutorstub.KeyRefused and the endings beside it). docs/build.md names them for app.
Variables ¶
var ErrTooLittleTime = errors.New("admission: too little time to check the key")
ErrTooLittleTime is a check of a key that would not begin: the request has less than twice checkReserve left, and the provider would be blamed for the client's short deadline.
Functions ¶
func Adapters ¶ added in v0.1.22
func Adapters() map[admissionv0.Provider]provider.Dial
Adapters are the adapters of the providers api gives tutor: Anthropic's alone. Each call makes the map anew, so that no caller changes what a later gate gives.
func Load ¶
Load is the gate of the table of spec and of what cfg declares. A file that cannot be read, or that tutor refuses, is a refusal of the configuration, config.ErrInvalid, which names the variable and what tutor said, never the file's contents beyond the provider or the fact it does not know. A table that tutor cannot read is a fault of the release of spec.
func StubAdapters ¶ added in v0.1.35
func StubAdapters() map[admissionv0.Provider]provider.Dial
StubAdapters are the adapters of the dev mode's stub: Anthropic's, by the client of its catalog made with no key, whose names and prices tutor reads for the choice and the price as it does from any adapter, while the calls are refused before any network. So tutor admits, chooses and prices on the real table, and nothing of it reaches a provider. The check of an own key answers by how the key ends (stubModel.Check), so that Tutor.CheckKey gives every end of a check with no call.
Types ¶
type Gate ¶
type Gate struct {
// contains filtered or unexported fields
}
Gate answers whether a task that AI checks is admitted for a learner, and reads its work, by tutor made once with the table, the facts, the stage, the platform keys and the adapters: the gate asks the very choice tutor makes before its call.
func (*Gate) Admitted ¶ added in v0.1.72
Admitted are the models tutor's list gives the call for an adult on platform AI, in the order of the attempts of its cascade, what the debug mode shows of a call it leaves to the list; none where the list admits no model.
func (*Gate) AssessEssay ¶ added in v0.1.49
func (g *Gate) AssessEssay(ctx context.Context, r tutor.RubricAssessment) tutor.RubricAssessed
AssessEssay assesses the text of an essay by the criteria of its rubric: a mark of each criterion and one feedback, which api checks before it reaches the learner, or the outcome of a call that gave none.
func (*Gate) CheckKey ¶ added in v0.1.42
func (g *Gate) CheckKey(ctx context.Context, category formatv0.AgeCategory, provider, key string) (tutor.KeyCheck, error)
CheckKey checks the own key of provider at a learner of category through tutor, which checks it for every model it would call with it, each by a request with nothing of a learner's (Tutor.CheckKey). A provider closed to the key (OwnKeyOpen) is KeyProviderClosed with no call, so that the check and the list of ListOwnKeyProviders do not part. The check ends checkReserve before ctx's deadline, and with less than twice that left it does not begin: KeyUnanswered and ErrTooLittleTime. The error says what failed, for the log, and never holds the key.
func (*Gate) CheckPaper ¶ added in v0.1.80
func (g *Gate) CheckPaper(ctx context.Context, c tutor.PaperCheck) tutor.PaperChecked
CheckPaper checks the work on a task from paper by tutor's models of the Check, one at a time: the verdict of each task of the frame, what was read and where, the mistakes, the hidden solution and answer, the tutor's words and the ladder of hints, or the outcome of a call that gave none.
func (*Gate) CorrectWords ¶ added in v0.1.45
func (g *Gate) CorrectWords(category formatv0.AgeCategory, ownKeyProvider string) bool
CorrectWords says whether the tutor's words after a correct answer are admitted for a learner of category, on the route Reads takes: whether tutor chooses an entry for their call, CallCorrect, one kind with the work and without it. tutor asks again, of the very model.
func (*Gate) FindTasks ¶ added in v0.1.72
func (g *Gate) FindTasks(ctx context.Context, f tutor.TaskFinding) tutor.TasksFound
FindTasks finds the tasks on the photo of a page by tutor's model of the finding: their frames, or the outcome of a call that gave none.
func (*Gate) GrownUp ¶ added in v0.1.81
func (g *Gate) GrownUp(ctx context.Context, r tutor.GrownUpRequest) tutor.GrownUpAnswer
GrownUp asks tutor for the drawing of grown-up mode on a task from paper: the tutor's words and its act on the sheet, the strokes to write and the IDs to take off, or the outcome of a call that gave none.
func (*Gate) OwnKeyOpen ¶ added in v0.1.41
func (g *Gate) OwnKeyOpen(category formatv0.AgeCategory, provider string) bool
OwnKeyOpen says whether the own key of provider is open at a learner of category: whether tutor chooses, on the route of that key, an entry for one of the kinds of call api makes at least. A provider api gives no adapter of, or the table does not know, is closed; so is none. The list of ListOwnKeyProviders and the check of a key ask it alike, so that a provider out of the list is closed to the check with no call.
func (*Gate) OwnKeyProviders ¶ added in v0.1.41
func (g *Gate) OwnKeyProviders(category formatv0.AgeCategory) []Provider
OwnKeyProviders are the providers of the table, in its order, whose own key is open at a learner of category (OwnKeyOpen): none at a category the table opens no own key to.
func (*Gate) PaperWords ¶ added in v0.1.72
func (g *Gate) PaperWords(category formatv0.AgeCategory, ownKeyProvider string) bool
PaperWords says whether "explain differently" on a task from paper is admitted for a learner of category, on the route Reads takes, by its call, CallPaperHint: the other words of a task from paper are the Check's, which Reads admits by CallChecking.
func (*Gate) Price ¶ added in v0.1.23
Price is what tutor expects a call of the kind to cost on the route, by the models it would choose for it and their prices (Tutor.Price): the quota reserves by it before the call. A route tutor admits no model for, or a price it cannot give, is no price — CallPrice's Expected is false — and the quota reserves its own value of the kind then.
func (*Gate) ReadEssay ¶ added in v0.1.49
ReadEssay reads the essay of a task with a rubric by tutor's one reader: the observation of its answer slot bound sheet — the text, or unreadable — or the outcome of a call that gave none.
func (*Gate) ReadSheet ¶ added in v0.1.17
ReadSheet reads the work of a handwriting sheet by tutor's readers, the pair or one reader by the mode of reading: the observation of each, or the outcome of a call that gave none.
func (*Gate) ReadStatement ¶ added in v0.1.72
ReadStatement reads the statement of a task from paper into its tasks by tutor's model of the statement: each with its statement and formula, empty when it is none, or the outcome of a call that gave none.
func (*Gate) ReadWorkbook ¶ added in v0.1.49
func (g *Gate) ReadWorkbook(ctx context.Context, r tutor.WorkbookReading) tutor.WorkbookRead
ReadWorkbook reads the filled boxes of a workbook page by tutor's readers, the pair or one by the mode of reading: the observation of each over every box of the page, or the outcome of a call that gave none.
func (*Gate) Reading ¶ added in v0.1.58
Reading is the mode tutor reads the handwriting of a sheet and of a workbook page by, and so how many observations its reading gives: two of the pair, or one of the one reader.
func (*Gate) Reads ¶ added in v0.1.49
Reads says whether the reading of handwriting by the call of the kind — of a sheet, CallSheet, or of a workbook page, CallWorkbook — or the reading of an essay, CallEssay, or its assessment, CallRubric, or the finding of the tasks on the photo of a page, CallFinding, or the Check of a task from paper, CallChecking, or the drawing of grown-up mode on one, CallDrawing, is admitted for a learner of category: by platform AI, or, when ownKeyProvider names one, by the own key of that provider alone. It is admitted when tutor chooses, for the call, an entry all of whose models the table admits at the deployment's stage or above. On platform AI only the providers the platform holds a key of serve, and on either route only those api gives an adapter of; the reading asks again.
func (*Gate) TellCorrectWords ¶ added in v0.1.45
func (g *Gate) TellCorrectWords(ctx context.Context, c tutor.CorrectRequest) tutor.CorrectAnswer
TellCorrectWords asks tutor for the words after a correct answer: the praise of a step and a question on the technique that helped, or the outcome of a call that gave none. api checks them for leaks and their form before they reach the learner.
func (*Gate) TellPaperWords ¶ added in v0.1.72
func (g *Gate) TellPaperWords(ctx context.Context, w tutor.PaperWordsRequest) tutor.WordsAnswer
TellPaperWords asks tutor for "explain differently" on a task from paper: its question, or the outcome of a call that gave none. api checks them for leaks and their form before they reach the learner (tutor.PaperBreach).
func (*Gate) TellWords ¶ added in v0.1.17
func (g *Gate) TellWords(ctx context.Context, w tutor.WordsRequest) tutor.WordsAnswer
TellWords asks tutor for the words of a rung: its question, with the box of the first mistake when the work went, or the outcome of a call that gave none.
func (*Gate) Words ¶ added in v0.1.17
Words says whether the tutor's words are admitted for a learner of category, on the route Reads takes: the hint of a rung by the call of the hint without the work, and, with the work, the call of words, which serves the analysis of its steps and the hint at once, and which tutor admits only with the hint on the model of the analysis. tutor asks again, of the very model.
type Provider ¶ added in v0.1.41
type Provider struct {
Code admissionv0.Provider
Name string
}
Provider is a provider of the admission table: its code and its name, as the table writes them.
type Report ¶
type Report struct {
TableVersion string
FactsFile bool
Rung string
RungSet bool
// PlatformKeys is how many providers the platform holds a key of.
PlatformKeys int
// Stub says whether tutor's calls go to the stub of the dev mode.
Stub bool
// Reading is the mode of reading handwriting, pair or single.
Reading string
// Debug says whether the run serves the debug mode to an account with its
// right: tutor has its own adapters, with the key of Anthropic.
Debug bool
// DebugEvery says whether API_DEBUG_MODELS gives every account of the run
// that right, on a local run.
DebugEvery bool
}
Report is what a start says of admission to the operator: the version of the table, whether the deployment gave a file of facts, and the stage and whether it named it. It names no provider, fact or path.