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

Method RecordPromptUsage

coderd/aibridged/translator.go:55–64  ·  view source on GitHub ↗
(ctx context.Context, req *aibridge.PromptUsageRecord)

Source from the content-addressed store, hash-verified

53}
54
55func (t *recorderTranslation) RecordPromptUsage(ctx context.Context, req *aibridge.PromptUsageRecord) error {
56 _, err := t.client.RecordPromptUsage(ctx, &proto.RecordPromptUsageRequest{
57 InterceptionId: req.InterceptionID,
58 MsgId: req.MsgID,
59 Prompt: req.Prompt,
60 Metadata: marshalForProto(req.Metadata),
61 CreatedAt: timestamppb.New(req.CreatedAt),
62 })
63 return err
64}
65
66func (t *recorderTranslation) RecordTokenUsage(ctx context.Context, req *aibridge.TokenUsageRecord) error {
67 merged := req.Metadata

Callers

nothing calls this directly

Calls 3

marshalForProtoFunction · 0.85
RecordPromptUsageMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected