Skip to content

Commit

Permalink
Clean up docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert committed Dec 17, 2024
1 parent e59a4ad commit 710e6fe
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions chatlas/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,8 @@ def token_count(
"""
Get the token count for the given input.
Get the token count for the given input. This can be useful for
understanding how many tokens your input will cost before sending it to
the model.
This is useful for estimating the number of tokens your input will cost
before sending it to the model.
Parameters
----------
Expand All @@ -224,11 +223,11 @@ def token_count(
# Estimate the token count before sending the input
print(chat.token_count("What is 2 + 2?"))
# Once input is sent, you can get the actual input and output token counts
# Once input is sent, you can get the actual input and output
# token counts from the chat object
chat.chat("What is 2 + 2?", echo="none")
print(chat.last_turn().tokens)
print(chat.token_usage)
```
"""

return self.provider.token_count(
Expand Down

0 comments on commit 710e6fe

Please sign in to comment.