( _ context.Context, req modelClientRequest, route directModelRoute, opts modelBuildOptions, )
| 19 | } |
| 20 | |
| 21 | func (*Server) newDirectModel( |
| 22 | _ context.Context, |
| 23 | req modelClientRequest, |
| 24 | route directModelRoute, |
| 25 | opts modelBuildOptions, |
| 26 | ) (fantasy.LanguageModel, error) { |
| 27 | var httpClient *http.Client |
| 28 | if opts.RecordHTTP { |
| 29 | httpClient = &http.Client{Transport: &chatdebug.RecordingTransport{}} |
| 30 | } |
| 31 | return newLanguageModel( |
| 32 | route.ProviderHint, |
| 33 | req.ModelName, |
| 34 | route.Keys, |
| 35 | req.UserAgent, |
| 36 | req.ExtraHeaders, |
| 37 | httpClient, |
| 38 | ) |
| 39 | } |
| 40 | |
| 41 | func (p *Server) resolveDirectModelRouteForConfig( |
| 42 | ctx context.Context, |
no test coverage detected