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

Method GetChatCostPerModel

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

Per-model cost breakdown for a single user within a date range. Only counts assistant-role messages that have a model_config_id.

(ctx context.Context, arg GetChatCostPerModelParams)

Source from the content-addressed store, hash-verified

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)
350 // Deployment-wide per-user cost rollup within a date range.
351 // Only counts assistant-role messages.
352 GetChatCostPerUser(ctx context.Context, arg GetChatCostPerUserParams) ([]GetChatCostPerUserRow, error)

Callers 4

chatCostSummaryMethod · 0.65
GetChatCostPerModelMethod · 0.65
GetChatCostPerModelMethod · 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