Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Tool Reference

These contracts describe the public FrameX-Core 0.4.4 export. The handbook includes additional development components; appearing in a pattern does not mean a tool is registered in every host.

Generic host: framex.tools

Run programs with python -m framex.tools program.fx. Direct Python calls use execute(name, parameters, client, adapters=None).

ToolRequest fieldsSuccessful output
_llmprompt and input fields; optional host fields belowModel scalars as result("key"); rows as row(N, "key")
_queryqueryresult("status"): true, false, unknown or bindings; result("text"): the full answer as JSON text
_evidence_needsgoal; optional max_states, max_assumptionsBounded evidence-question report; preserve its search limits and completeness information
_forgetAnswerstextresult("removed"): number of stored model-answer records deleted
_fixtureresponse: a JSON object encoded as a stringAuthored output, with evidence that no model was called
_emitmessageresult("delivered") -> true; the message in event evidence

Direct _query calls need a Client; framex agent handles native tools inside the engine. _emit records delivery in this host; it is not a general messaging-service adapter.

_forgetAnswers removes matching model-answer cache records. It does not retract accepted facts or erase receipts and transcripts. Model withdrawal separately and revise the session when evidence is removed.

Fields read by the model host

FieldBehavior
promptInstruction; other named input fields form one JSON message
inputExplicit user-message text; takes precedence over collecting other named fields
schemaJSON schema in direct Python calls; constrains provider formatting where supported
groundInSource text; adds quoteFound and valueQuoted to each returned row
mustSayText for a lexical check; adds saysDecision based on the reply’s text
contextKeyStep whose selectedFor statements rules selected as context
tool#maxContextContext bound, default 32 statements; excess fails the call

The host strips tool#... fields and consumes grounding/context controls before calling the model. A prompt may also be a named object: external read(?D) using _llm with readPrompt[document -> ?T] <- ..., where readPrompt:Prompt[text -> "..."] supplies the instruction.

quoteFound checks that a nonempty quote occurs verbatim in groundIn. valueQuoted checks that a nonempty value occurs in the quote. These lexical measurements do not establish that a quote supports the property or that the source is authoritative. Acceptance rules must read the checks and restrict which claims a source may establish.

With contextKey, the host sends selected statements in identifier order and records IDs as tool#sent("id"). Rules can check that citations refer to statements sent for that request and still current.

Dialogue host: framex.dialogue

These tools are registered by the dialogue driver. They are not automatically available in framex.tools. See Dialogue and Interviews.

ToolRequest fieldsSuccessful output
_turnquestion, attemptanswer, spoken utterance, canonical question
_judgecriterion, question, answerverdict: yes, no or unclear; reason; label where returned
_askquestionquestion, answer; no model used
_saytextDisplays the text and records delivery
_repairTurn, _repairJudgeOriginal fields and repair informationAnother attempt when the flow policy requests it

unclear is a judge’s interpretation, stored as data; engine unknown is a logical answer. Dialogue format problems may return formatError and received for rules to inspect. Execution failure remains a failed call. A successful call alone is not acceptance.

_checkCandidate needs additional code

The handbook’s adapter checks candidate rules against a fixed vocabulary, allowed heads and regression cases. Results include status, feedback, regressions and failedAfter. Checking does not adopt a proposal.

It is not shipped as a tool in the public 0.4.4 export. The export also omits framex.candidates, which the handbook’s adapter imports. Copying that adapter alone will fail. Use separately supplied course/development code or implement and register a checker. Keep generated rules as candidate text until checks and an explicit adoption decision permit a change.