Skip to content

Resolves: #76, Add get_cost to chat #106

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

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft

Conversation

elnelson575
Copy link

@elnelson575 elnelson575 commented Jun 11, 2025

Purpose: Add .get cost() method to get cost of each turn and total chat cost. Mirrors tidyverse/ellmer#418

@elnelson575 elnelson575 self-assigned this Jun 11, 2025
@elnelson575 elnelson575 linked an issue Jun 11, 2025 that may be closed by this pull request

def get_cost(
self,
options: CostOptions = "all",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add param to BYO cost info

self,
values: Literal["cumulative", "discrete"] = "discrete",
) -> list[int] | list[tuple[int, int] | None]:
def get_tokens(self) -> list[TokensDict]:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's make sure to highlight breaking changes in CHANGELOG.md

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.

Add .get_cost()
2 participants