runSingleShot
runSingleShot(
source,_preamble,content,config,resolvers?,command?,agentFactory?):Promise<SingleShotResult>
Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/runtime/singleShot.ts:56
Ask a question and get an answer from the LLM.
This is the shared, non-interactive single-shot runtime behind both the conversational
ask command and the scripted exec command (prompt-as-script). The command argument
is forwarded to the agent so it can pick the right mode prompt (e.g. exec-mode for exec).
Parameters
Section titled “Parameters”source
Section titled “source”string
The source of the question (used for file naming)
_preamble
Section titled “_preamble”string
Deprecated/ignored (BATCH-13): the agent composes the system prompt itself; see the body comment. Retained positionally so existing callers need no change.
content
Section titled “content”string
The content of the question
config
Section titled “config”The resolved config
resolvers?
Section titled “resolvers?”Optional agent resolvers (tools/middleware)
command?
Section titled “command?”GthCommand = 'ask'
The originating command (defaults to ask); selects the agent mode prompt
agentFactory?
Section titled “agentFactory?”Optional backend factory (B5). When omitted the runner uses its built-in
lean GthLangChainAgent default (unchanged behavior for existing callers). The app
layer passes resolveAgentFactory(config, 'lean') so an explicit agent.backend is honored.
Returns
Section titled “Returns”Promise<SingleShotResult>
A SingleShotResult: ok is true when the run completed without error, false
when it failed (so callers such as exec can set a non-zero exit code); answer/tokensInput/
tokensOutput/tools carry the SUT’s answer text and run stats for callers that need them
(e.g. gth batch/gth eval).