The async reference plugin's docs say it runs the forward translation and the
back-translation at the same time. The code does not do that, and it cannot, so
the example teaches a pattern that does not work.
In plugin-llm-async-example/init.py the module docstring says:
fires two LLM calls concurrently via asyncio.gather() ... one to translate
forward into the target language, one to back-translate the result into
English
The code actually gathers the forward translation and a one-word sentiment
classifier:
forward_result, sentiment_result = await asyncio.gather(
forward_task, sentiment_task
)
The back-translation runs after that, by itself, because it takes the forward
translation as its input:
back = await ctx.llm.acomplete(
messages=[..., {"role": "user", "content": translation}],
...
)
A call that depends on the forward result cannot run in parallel with it, so the
documented pair is impossible. The inline comments further down already describe
the real flow correctly. Only the top docstring is wrong.
The same wrong claim is in plugin-llm-async-example/plugin.yaml, whose
description says it "runs forward + back translations concurrently via
asyncio.gather()".
The repo's own README index already lists this plugin as a "forward + sentiment + back-translation pass," which matches the code. The docstring and plugin.yaml are the stale ones.
Two smaller mismatches in the docstring's Usage example:
- It shows only Forward, Back-check, and Confidence. The handler also prints a
Category line and a "via provider/model, tokens, time" footer.
- It uses a leading arrow and a different column alignment than the real
output.
None of this changes behavior. It is a documentation accuracy problem in a file
people copy from. I will open a PR that fixes the docstring and the plugin.yaml
description to match the code, and updates the Usage example to the real output.
The async reference plugin's docs say it runs the forward translation and the
back-translation at the same time. The code does not do that, and it cannot, so
the example teaches a pattern that does not work.
In plugin-llm-async-example/init.py the module docstring says:
fires two LLM calls concurrently via asyncio.gather() ... one to translate
forward into the target language, one to back-translate the result into
English
The code actually gathers the forward translation and a one-word sentiment
classifier:
The back-translation runs after that, by itself, because it takes the forward
translation as its input:
A call that depends on the forward result cannot run in parallel with it, so the
documented pair is impossible. The inline comments further down already describe
the real flow correctly. Only the top docstring is wrong.
The same wrong claim is in plugin-llm-async-example/plugin.yaml, whose
description says it "runs forward + back translations concurrently via
asyncio.gather()".
The repo's own README index already lists this plugin as a "forward + sentiment + back-translation pass," which matches the code. The docstring and plugin.yaml are the stale ones.
Two smaller mismatches in the docstring's Usage example:
Category line and a "via provider/model, tokens, time" footer.
output.
None of this changes behavior. It is a documentation accuracy problem in a file
people copy from. I will open a PR that fixes the docstring and the plugin.yaml
description to match the code, and updates the Usage example to the real output.