MCPcopy Index your code
hub / github.com/coder/coder / GetChatCostPerChat

Method GetChatCostPerChat

coderd/database/querier.go:346–346  ·  view source on GitHub ↗

Per-root-chat cost breakdown for a single user within a date range. Groups by root_chat_id so forked chats roll up under their root. Only counts assistant-role messages.

(ctx context.Context, arg GetChatCostPerChatParams)

Source from the content-addressed store, hash-verified

344 // Groups by root_chat_id so forked chats roll up under their root.
345 // Only counts assistant-role messages.
346 GetChatCostPerChat(ctx context.Context, arg GetChatCostPerChatParams) ([]GetChatCostPerChatRow, error)
347 // Per-model cost breakdown for a single user within a date range.
348 // Only counts assistant-role messages that have a model_config_id.
349 GetChatCostPerModel(ctx context.Context, arg GetChatCostPerModelParams) ([]GetChatCostPerModelRow, error)

Callers 4

chatCostSummaryMethod · 0.65
GetChatCostPerChatMethod · 0.65
GetChatCostPerChatMethod · 0.65
TestChatsMethod · 0.65

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls

Tested by 1

TestChatsMethod · 0.52