-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow statistics to team.start() output (#63)
# Add workflow statistics to team.start() output This PR addresses issue #62 by incorporating comprehensive workflow statistics directly into the output of the `team.start()` method, eliminating the need for a separate `getWorkflowStats()` call. ## Changes - Modified `team.start()` to return an object that includes: - Workflow status ('FINISHED' or 'BLOCKED') - Workflow result - Detailed statistics about the workflow execution - Updated the structure of the returned object to: ```javascript { status: 'FINISHED' | 'BLOCKED', result: workflowResult, stats: { duration: number, taskCount: number, agentCount: number, iterationCount: number, llmUsageStats: { inputTokens: number, outputTokens: number, callsCount: number, callsErrorCount: number, parsingErrors: number }, costDetails: { totalCost: number }, teamName: string } } ``` - Updated relevant documentation and examples to reflect the new output structure ## Benefits - Simplifies the process of retrieving workflow statistics - Ensures consistency between workflow result and associated statistics - Improves developer experience by providing all necessary information in a single method call - Facilitates easier implementation of performance monitoring, cost tracking, and debugging features ## Testing - Added unit tests to verify the new output structure of `team.start()` - Updated existing tests that relied on the separate `getWorkflowStats()` method - Manually tested various workflow scenarios to ensure correct statistics are returned ## Documentation - Updated the API documentation for `team.start()` to reflect the new return value structure - Added examples demonstrating how to access and use the new statistics in the output Please review and let me know if any further changes or clarifications are needed.
- Loading branch information
Showing
4 changed files
with
275 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.