You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use langchain for part of my workflow, but mostly with dspy, so I'm calling lm.history to get token count. I want to also add the token cost, which unfortunately returns nothing. I believe this is a bug as there are no other fields in lm.history for this purpose.
Thanks in advance for any help, much appreciated!
Steps to reproduce
This is a snippet function I use, but I removed the usage part as there's nothing:
@okhat I'm getting the same issue with or without langchain, I added langchain in this code because I could only get a portion of the total cost whereas most of my cost comes from dspy. So the problem is dspy's lm.history[-1].usage isn't providing a cost, which leads me to think it is a bug rather than a feature request.
What happened?
Hey guys,
I use
langchain
for part of my workflow, but mostly withdspy
, so I'm callinglm.history
to get token count. I want to also add the token cost, which unfortunately returns nothing. I believe this is a bug as there are no other fields inlm.history
for this purpose.Thanks in advance for any help, much appreciated!
Steps to reproduce
This is a snippet function I use, but I removed the
usage
part as there's nothing:DSPy version
2.6.0rc8
The text was updated successfully, but these errors were encountered: