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 support for --token-usage/-t flag #12

Merged
merged 11 commits into from
Sep 20, 2024
Merged

Conversation

mulla028
Copy link
Contributor

@mulla028 mulla028 commented Sep 19, 2024

This pull request implements/ fixes issue #11

What changed

  • Function fetch_clue_collection() now returns additional object Usage, instead of just ClueCollection
  • Added public structure called Usage that is being passed to ChatCompletionResponse
  • Added ability of usage of t/--token-usage flags
  • Updated main.rs to output the token usage to stderr
  • Updated README.md documentation

@theoforger theoforger self-requested a review September 19, 2024 15:45
@theoforger theoforger self-assigned this Sep 19, 2024
Copy link
Owner

@theoforger theoforger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great contribution! Mostly consistent with the rest of the code. I had a few nitpicks for you to consider. See the inline comments for details.

Let me know if you have questions or different ideas!

src/api/chat_completions.rs Outdated Show resolved Hide resolved
src/api/chat_completions.rs Outdated Show resolved Hide resolved
src/api/json_models/chat_completion.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
@theoforger theoforger added the enhancement New feature or request label Sep 19, 2024
@mulla028 mulla028 requested a review from theoforger September 19, 2024 21:53
@mulla028
Copy link
Contributor Author

All changes done according to your nitpicks

@theoforger
Copy link
Owner

Perfect! GitHub Actions failed only because the API key is configured as a repository secret. But the code is good.

Will merge now.

@theoforger theoforger merged commit 0ee9238 into theoforger:main Sep 20, 2024
1 check failed
@mulla028 mulla028 deleted the issue-11 branch September 20, 2024 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants