-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor multi agents execution #376
Refactor multi agents execution #376
Conversation
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
public/utils/pipeline/operator.ts
Outdated
*/ | ||
|
||
export abstract class Operator<T, P> { | ||
abstract execute(v: T): Promise<P>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need context parameter? and how about name it as Task
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about name it as Task
Sounds good, I like the name, let me update.
do we need context parameter?
Is there an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a real use case, but this could helpful if we have context for tasks share intermediate result during execution. For example, task 3 want to use a output of task 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current design is each task will add extra properties to its output, and the output will become the next task's input. But I got your point which makes to me, I think we can tweaks the implementation when there is a real use case.
Signed-off-by: Yulong Ruan <[email protected]>
Signed-off-by: Yulong Ruan <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
==========================================
+ Coverage 87.46% 87.60% +0.13%
==========================================
Files 65 66 +1
Lines 1891 1912 +21
Branches 473 473
==========================================
+ Hits 1654 1675 +21
Misses 236 236
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Yulong Ruan <[email protected]>
* refactor(t2viz): introduced pipeline to run async operations Signed-off-by: Yulong Ruan <[email protected]> * add tests Signed-off-by: Yulong Ruan <[email protected]> * update changelog entry Signed-off-by: Yulong Ruan <[email protected]> * rename Operator -> Task Signed-off-by: Yulong Ruan <[email protected]> * cleanup console.log Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> (cherry picked from commit fb47ce8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
* refactor(t2viz): introduced pipeline to run async operations Signed-off-by: Yulong Ruan <[email protected]> * add tests Signed-off-by: Yulong Ruan <[email protected]> * update changelog entry Signed-off-by: Yulong Ruan <[email protected]> * rename Operator -> Task Signed-off-by: Yulong Ruan <[email protected]> * cleanup console.log Signed-off-by: Yulong Ruan <[email protected]> --------- Signed-off-by: Yulong Ruan <[email protected]> (cherry picked from commit fb47ce8) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
The refactor in the commit introduces a
Pipeline
to execute asynchronous operations, each operator encapsulates a specific function. The Pipeline orchestrates these operators, processing input sequentially. The pipeline architecture allows for adding, reusing or rearranging steps with minimal impact on the codebase.The monolithic Text2Vega class also be replaced with Pipeline in this PR.
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.