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

Feature request: add entities to track used tokens #105

Open
Woutch opened this issue Jan 17, 2024 · 3 comments
Open

Feature request: add entities to track used tokens #105

Woutch opened this issue Jan 17, 2024 · 3 comments

Comments

@Woutch
Copy link

Woutch commented Jan 17, 2024

Create some entities to track token usage. This to keep an eye on how much tokens are used to query chatgpt.

I saw my token usage spike during the first day's and after debugging found out that this was because this was I had too many and obsolete enities exposed. This can get quite big.

Do functions count towards tokens? Or can I add as many that I want?

Thanks for this great integration!!!!
Wouter

@jekalmin
Copy link
Owner

jekalmin commented Jan 18, 2024

Thanks for reporting an issue.

Do functions count towards tokens? Or can I add as many that I want?

Yes, functions count as tokens, hence limited.
Good functions should cover more general cases than specific cases.

Create some entities to track token usage

I agree that it needs a way to monitor token usage, functions called, etc...
There might be some ways to achieve this.

1. Create entities which hold token usage.

  • Pros
    • convenient
  • Cons
    • less flexible

2. Fire an event of which token usage is composed

  • Pros
    • more flexible (function call or message history can also be tracked)
  • Cons
    • less convenient (users have to manually set token to entity such as input_number)

Currently, I'm thinking of latter way(event).
Would it be enough for your case?

@Woutch
Copy link
Author

Woutch commented Jan 18, 2024

Hi Jekalmin,

Events would be fine for me. We can do wat we want with them.

Many thanks for your reply!
Best regards,
Wouter

@jekalmin
Copy link
Owner

jekalmin commented Feb 9, 2024

Sorry for being late.

I just released 1.0.3-beta2 version.
See #143 for details.

Please try it and give a feedback if possible.
Thanks.

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

No branches or pull requests

2 participants