( ctx context.Context, chat database.Chat, debugSvc *chatdebug.Service, provider string, model string, route resolvedModelRoute, modelOpts modelBuildOptions, )
| 308 | } |
| 309 | |
| 310 | func (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 | |
| 339 | func (p *Server) prepareQuickgenDebugCandidate( |
| 340 | ctx context.Context, |
no test coverage detected