-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
openai[patch]: add usage metadata details #27080
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
input_tokens=input_tokens, | ||
output_tokens=output_tokens, | ||
total_tokens=total_tokens, | ||
input_token_details=InputTokenDetails( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need InputTokenDetails here? Does it do a 2nd instantiation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for lint, could type ignore
return ["reasoning_output", "cache_read_input"] | ||
|
||
def invoke_with_cache_read_input(self, *, stream: bool = False) -> AIMessage: | ||
with open(REPO_ROOT_DIR / "README.md", "r") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we avoid loading a file here if ti's not necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having a >2k token string literal seems not great for readability
No description provided.