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

Function WrapModel

coderd/x/chatd/chatdebug/recorder.go:25–37  ·  view source on GitHub ↗

WrapModel returns model unchanged when debug recording is disabled, or a debug wrapper when a service is available.

(
	model fantasy.LanguageModel,
	svc *Service,
	opts RecorderOptions,
)

Source from the content-addressed store, hash-verified

23// WrapModel returns model unchanged when debug recording is disabled, or a
24// debug wrapper when a service is available.
25func WrapModel(
26 model fantasy.LanguageModel,
27 svc *Service,
28 opts RecorderOptions,
29) fantasy.LanguageModel {
30 if model == nil {
31 panic("chatdebug: nil LanguageModel")
32 }
33 if svc == nil {
34 return model
35 }
36 return &debugModel{inner: model, svc: svc, opts: opts}
37}
38
39type attemptSink struct {
40 mu sync.Mutex

Callers 6

newDebugAwareModelMethod · 0.92
newQuickgenDebugModelMethod · 0.92
TestWrapModel_NilModelFunction · 0.85
TestWrapModel_NilServiceFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestWrapModel_NilModelFunction · 0.68
TestWrapModel_NilServiceFunction · 0.68