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

Method newQuickgenDebugModel

coderd/x/chatd/quickgen.go:310–337  ·  view source on GitHub ↗
(
	ctx context.Context,
	chat database.Chat,
	debugSvc *chatdebug.Service,
	provider string,
	model string,
	route resolvedModelRoute,
	modelOpts modelBuildOptions,
)

Source from the content-addressed store, hash-verified

308}
309
310func (p *Server) newQuickgenDebugModel(
311 ctx context.Context,
312 chat database.Chat,
313 debugSvc *chatdebug.Service,
314 provider string,
315 model string,
316 route resolvedModelRoute,
317 modelOpts modelBuildOptions,
318) (fantasy.LanguageModel, error) {
319 debugOpts := modelOpts
320 debugOpts.RecordHTTP = true
321 debugModel, err := p.newModel(ctx, modelClientRequest{
322 Chat: chat,
323 ModelName: model,
324 UserAgent: chatprovider.UserAgent(),
325 ExtraHeaders: chatprovider.CoderHeaders(chat),
326 }, route, debugOpts)
327 if err != nil {
328 return nil, err
329 }
330
331 return chatdebug.WrapModel(debugModel, debugSvc, chatdebug.RecorderOptions{
332 ChatID: chat.ID,
333 OwnerID: chat.OwnerID,
334 Provider: provider,
335 Model: model,
336 }), nil
337}
338
339func (p *Server) prepareQuickgenDebugCandidate(
340 ctx context.Context,

Callers 1

Calls 4

newModelMethod · 0.95
UserAgentFunction · 0.92
CoderHeadersFunction · 0.92
WrapModelFunction · 0.92

Tested by

no test coverage detected