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

added usage_metrics to full output #756

Merged
merged 7 commits into from
Jun 12, 2024
Merged

Conversation

lorenzejay
Copy link
Collaborator

@lorenzejay lorenzejay commented Jun 11, 2024

…esult

Feature Added for #162

Added onto the Crew Class which takes in output_token_usage

Adds to full_output and to the result

Usage

Crew(
    agents=[agent],
    tasks=[task1],
    process=Process.sequential,
    full_output=True,
    verbose=True,
    output_token_usage=True,
)

Output:

Howdy!
(-------)
TOKEN USAGE:
total_tokens=176
prompt_tokens=158
completion_tokens=18
successful_requests=1

and or like this when full_output = True
{'final_output': 'Hi!', 'tasks_outputs': [TaskOutput(description='just say hi!', summary='just say hi!...', exported_output='Hi!', agent='test role', raw_output='Hi!')], 'token_usage': {'total_tokens': 169, 'prompt_tokens': 152, 'completion_tokens': 17, 'successful_requests': 1}}

@lorenzejay
Copy link
Collaborator Author

After some reconsideration with having crew.usage_metrics it makes the most sense just to append this the full_output and close tickets related to showing tokens since usage_metrics solves it

@lorenzejay lorenzejay changed the title added extra parameter for kickoff to return token usage count after r… added usage_metrics to full output Jun 12, 2024
@joaomdmoura joaomdmoura merged commit d3b6640 into main Jun 12, 2024
1 of 3 checks passed
@joaomdmoura joaomdmoura deleted the lorenzejay/log-token-count-flag branch June 12, 2024 17:18
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.

2 participants