MCPcopy Create free account
hub / github.com/coder/coder / RecordModelThought

Method RecordModelThought

coderd/aibridged/translator.go:116–124  ·  view source on GitHub ↗
(ctx context.Context, req *aibridge.ModelThoughtRecord)

Source from the content-addressed store, hash-verified

114}
115
116func (t *recorderTranslation) RecordModelThought(ctx context.Context, req *aibridge.ModelThoughtRecord) error {
117 _, err := t.client.RecordModelThought(ctx, &proto.RecordModelThoughtRequest{
118 InterceptionId: req.InterceptionID,
119 Content: req.Content,
120 Metadata: marshalForProto(req.Metadata),
121 CreatedAt: timestamppb.New(req.CreatedAt),
122 })
123 return err
124}
125
126// marshalForProto will attempt to convert from aibridge.Metadata into a proto-friendly map[string]*anypb.Any.
127// If any marshaling fails, rather return a map with the error details since we don't want to fail Record* funcs if metadata can't encode,

Callers

nothing calls this directly

Calls 3

marshalForProtoFunction · 0.85
RecordModelThoughtMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected