AgentOps-AI / tokencost

Easy token price estimates for 400+ LLMs. TokenOps.
https://agentops.ai
MIT License
1.48k stars 61 forks source link

fix: :bug: Skip updating estimates if event isn't a prompt nor message #57

Closed AndreCNF closed 5 months ago

AndreCNF commented 5 months ago

Sometimes running TokenCost with LlamaIndex was failing for me due to the estimates object only being defined if the event payload contains prompt or messages. This PR fixes this by skipping events that don't match these conditions.

areibman commented 5 months ago

Thanks, @AndreCNF !