Skip to content
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

Add workflow statistics to team.start() output #63

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

darielnoel
Copy link
Contributor

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:

    {
      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.

- Modify team.start() to include comprehensive workflow statistics in its output
- Remove the need for separate getWorkflowStats() call after workflow completion
- Include duration, task count, agent count, iteration count, LLM usage stats, and cost details in the output
- Ensure consistency between workflow result and associated statistics
- Update relevant documentation and examples to reflect new output structure

Resolves #62
@darielnoel darielnoel merged commit 2982da1 into main Sep 6, 2024
1 check passed
@darielnoel darielnoel deleted the feature/add-stats-to-team-start-output branch September 6, 2024 13:17
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.

1 participant