AgentOps-AI / tokencost

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

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

Closed AndreCNF closed 3 months ago

AndreCNF commented 3 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 3 months ago

Thanks, @AndreCNF !