Skip to content

Fix async example plugin docs to match the actual concurrency and output - #6

Open
MaxFreedomPollard wants to merge 1 commit into
NousResearch:mainfrom
MaxFreedomPollard:docs/async-example-concurrency
Open

Fix async example plugin docs to match the actual concurrency and output#6
MaxFreedomPollard wants to merge 1 commit into
NousResearch:mainfrom
MaxFreedomPollard:docs/async-example-concurrency

Conversation

@MaxFreedomPollard

Copy link
Copy Markdown

The async reference plugin documented a concurrency pattern the code does not
use. The docstring and the plugin.yaml description both said asyncio.gather()
runs the forward translation and the back-translation together. The code gathers
the forward translation and a sentiment classifier instead, and the
back-translation runs serially afterward 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 old text described something impossible, which is
misleading in a reference plugin.

Changes, docs only:

  • Rewrote the module docstring so the concurrent pair is the forward
    translation and the sentiment classification, and the back-translation is
    described as serial with the reason why.
  • Updated the Usage example to the real output, including the Category line and
    the "via provider/model, tokens, time" footer.
  • Fixed the plugin.yaml description to match.

No behavior change.

Fixes #5

…nd usage example

The docstring and plugin.yaml said asyncio.gather() runs the forward and back
translations concurrently. The code gathers the forward translation and a
sentiment classifier; the back-translation runs serially afterward because it
needs the forward result as input. Update the docs to match, and update the
usage example to the real output (Category line and the via/tokens/time footer).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Async example plugin docs describe a concurrency pattern the code does not use

1 participant