Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
i18n_ui
Terminal UI for translation progress: the interactive panel displays concurrent tasks cell by cell; non-interactive environments output line by line.
The translation side holds only lightweight handles Ui / Job; events are sent through a channel to a dedicated rendering thread, so a slow terminal never blocks network I/O.
Usage
use ;
let ui = new;
ui.plan;
let mut job = ui.job;
job.think;
job.reply.reply;
job.done;
ui.hit; // cache hit, counted directly as done
ui.log;
The think / reply / fail methods of Job, Reply, and Retry stream status events to the UI; callers can forward them in the ai_api::OnThink / OnReply / OnFail callbacks.
I18N_UI=plain
Modes
Mode::Auto uses the interactive panel when both stderr and stdout are terminals, the environment is not CI, and TERM is not dumb; the environment variable I18N_UI=tty|plain can force a specific mode.
Mode::Tty forces interactive mode; if stdout is redirected, cursor queries time out after about 2 seconds and fall back to line-by-line output.
Mode::Plain outputs line by line on stderr, with no color.
API
Ui::new(mode, concurrency)
Starts the rendering thread. concurrency is the upper limit on concurrent model calls and determines the number of panel cells.
plan(job, cache)
Sets the total number of tasks and the number of cache hits among them.
hit() / grow() / skip()
hit records a cache hit; grow adds a task missed by the pre-check; skip subtracts a task from the total.
job(from, out)
Creates a new task handle; from is the source language and out is the translation path.
log(text)
Appends a line to the history section.
Job
| Method | Description |
|---|---|
think(s) |
Append thought stream |
reply() |
Returns the body-callback handle Reply |
retry() |
Returns the failure-callback handle Retry for the cooldown countdown |
done() |
Marks the task as done |
fail(err) |
Marks the task as failed |
Drop impls on Ui and Job perform cleanup and restore the terminal; Retry::fail parameters are the current round, total rounds, cooldown duration, endpoint, and error.