@@ -14,15 +14,15 @@ import (
1414 "github.com/coder/coder/v2/coderd/aibridged/proto"
1515)
1616
17- var _ aibridge.Recorder = & recorderTranslation {}
17+ var _ aibridge.Recorder = & DRPCRecorder {}
1818
19- // recorderTranslation satisfies the aibridge.Recorder interface and translates calls into dRPC calls to aibridgedserver.
20- type recorderTranslation struct {
19+ // DRPCRecorder satisfies the aibridge.Recorder interface and translates calls into dRPC calls to aibridgedserver.
20+ type DRPCRecorder struct {
2121 apiKeyID string
2222 client proto.DRPCRecorderClient
2323}
2424
25- func (t * recorderTranslation ) RecordInterception (ctx context.Context , req * aibridge.InterceptionRecord ) error {
25+ func (t * DRPCRecorder ) RecordInterception (ctx context.Context , req * aibridge.InterceptionRecord ) error {
2626 _ , err := t .client .RecordInterception (ctx , & proto.RecordInterceptionRequest {
2727 Id : req .ID ,
2828 ApiKeyId : t .apiKeyID ,
@@ -44,7 +44,7 @@ func (t *recorderTranslation) RecordInterception(ctx context.Context, req *aibri
4444 return err
4545}
4646
47- func (t * recorderTranslation ) RecordInterceptionEnded (ctx context.Context , req * aibridge.InterceptionRecordEnded ) error {
47+ func (t * DRPCRecorder ) RecordInterceptionEnded (ctx context.Context , req * aibridge.InterceptionRecordEnded ) error {
4848 endedReq := & proto.RecordInterceptionEndedRequest {
4949 Id : req .ID ,
5050 EndedAt : timestamppb .New (req .EndedAt ),
@@ -61,7 +61,7 @@ func (t *recorderTranslation) RecordInterceptionEnded(ctx context.Context, req *
6161 return err
6262}
6363
64- func (t * recorderTranslation ) RecordPromptUsage (ctx context.Context , req * aibridge.PromptUsageRecord ) error {
64+ func (t * DRPCRecorder ) RecordPromptUsage (ctx context.Context , req * aibridge.PromptUsageRecord ) error {
6565 _ , err := t .client .RecordPromptUsage (ctx , & proto.RecordPromptUsageRequest {
6666 InterceptionId : req .InterceptionID ,
6767 MsgId : req .MsgID ,
@@ -72,7 +72,7 @@ func (t *recorderTranslation) RecordPromptUsage(ctx context.Context, req *aibrid
7272 return err
7373}
7474
75- func (t * recorderTranslation ) RecordTokenUsage (ctx context.Context , req * aibridge.TokenUsageRecord ) error {
75+ func (t * DRPCRecorder ) RecordTokenUsage (ctx context.Context , req * aibridge.TokenUsageRecord ) error {
7676 merged := req .Metadata
7777 if merged == nil {
7878 merged = aibridge.Metadata {}
@@ -96,7 +96,7 @@ func (t *recorderTranslation) RecordTokenUsage(ctx context.Context, req *aibridg
9696 return err
9797}
9898
99- func (t * recorderTranslation ) RecordToolUsage (ctx context.Context , req * aibridge.ToolUsageRecord ) error {
99+ func (t * DRPCRecorder ) RecordToolUsage (ctx context.Context , req * aibridge.ToolUsageRecord ) error {
100100 serialized , err := json .Marshal (req .Args )
101101 if err != nil {
102102 return xerrors .Errorf ("serialize tool %q args: %w" , req .Tool , err )
@@ -123,7 +123,7 @@ func (t *recorderTranslation) RecordToolUsage(ctx context.Context, req *aibridge
123123 return err
124124}
125125
126- func (t * recorderTranslation ) RecordModelThought (ctx context.Context , req * aibridge.ModelThoughtRecord ) error {
126+ func (t * DRPCRecorder ) RecordModelThought (ctx context.Context , req * aibridge.ModelThoughtRecord ) error {
127127 _ , err := t .client .RecordModelThought (ctx , & proto.RecordModelThoughtRequest {
128128 InterceptionId : req .InterceptionID ,
129129 Content : req .Content ,
0 commit comments