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

Include usage stats #19

Merged
merged 15 commits into from
May 7, 2024
Merged

Include usage stats #19

merged 15 commits into from
May 7, 2024

Conversation

ronaldmannak
Copy link
Contributor

OpenAI added usage stats to streaming chat completions today. This PR adds a new usage stats property to StreamableChatThread that will be set if completion is called with argument includeUsage to true.

Additionally, I've added a completeIncludeUsage method to the async ChatThread that returns a tuple of the completion and the usage.

Copy link
Owner

@btfranklin btfranklin left a comment

Choose a reason for hiding this comment

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

Just one minor change to a comment header, please. Otherwise, looking great!

@@ -0,0 +1,17 @@
//
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove this comment header. These comment headers that repeat the name of the file are just noise and don't add any value to the code.

// StreamOptions.swift
//
//
// Created by Ronald Mannak on 5/6/24.
Copy link
Owner

Choose a reason for hiding this comment

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

Feel free to leave this Created by line though. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@btfranklin Done!

@btfranklin btfranklin merged commit 09c1477 into btfranklin:main May 7, 2024
1 check passed
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