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

Method newDirectModel

coderd/x/chatd/model_routing_direct.go:21–39  ·  view source on GitHub ↗
(
	_ context.Context,
	req modelClientRequest,
	route directModelRoute,
	opts modelBuildOptions,
)

Source from the content-addressed store, hash-verified

19}
20
21func (*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
41func (p *Server) resolveDirectModelRouteForConfig(
42 ctx context.Context,

Callers 1

newModelMethod · 0.95

Calls 1

newLanguageModelFunction · 0.85

Tested by

no test coverage detected