Open krrishdholakia opened 1 month ago
Observations:
when i look at the api swagger, total_cost
isn't mentioned there - https://api.smith.langchain.com/redoc#tag/run/operation/create_run_api_v1_runs_post
this makes me think, this isn't actually supported by the langsmith api
Today, cost info is computed from the token counts. Token counts can be sent up on a runwise basis and then the costs are estimated based on the patterns you configure for your workspace.
hey @hinthornw i can see total_cost
as a mentioned param on the api docs
https://docs.smith.langchain.com/reference/data_formats/run_data_format
is this not the case?
context - our users have custom cost for calls, and we need to log it accordingly
It's a computed value. It's present on the run resource as an aggregation of the tokens within child runs.
It's not a a field in the request body itself: https://api.smith.langchain.com/redoc#tag/run/operation/create_run_api_v1_runs_post
Issue you'd like to raise.
Hi, I'm trying to log custom cost to langsmith.
Here's my sample curl request: https://gist.github.com/krrishdholakia/434b1ef66decdb2e37b162537a615604
I'm following the format mentioned in docs: https://docs.smith.langchain.com/reference/data_formats/run_data_format
but i don't see the cost logged on UI
Suggestion:
No response
cc: @dqbd @hinthornw @eyurtsev