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

Method preferredShortTextCandidates

coderd/x/chatd/quickgen.go:75–102  ·  view source on GitHub ↗
(
	chat database.Chat,
	keys chatprovider.ProviderAPIKeys,
)

Source from the content-addressed store, hash-verified

73}
74
75func (p *Server) preferredShortTextCandidates(
76 chat database.Chat,
77 keys chatprovider.ProviderAPIKeys,
78) []shortTextCandidate {
79 if p.shouldUseAIGatewayRouting() {
80 return nil
81 }
82
83 candidates := make([]shortTextCandidate, 0, len(preferredTitleModels)+1)
84 userAgent := chatprovider.UserAgent()
85 extraHeaders := chatprovider.CoderHeaders(chat)
86 for _, candidate := range preferredTitleModels {
87 model, err := chatprovider.ModelFromConfig(
88 candidate.provider, candidate.model, keys, userAgent,
89 extraHeaders,
90 nil,
91 )
92 if err == nil {
93 candidates = append(candidates, shortTextCandidate{
94 provider: candidate.provider,
95 model: candidate.model,
96 route: newDirectModelRoute(candidate.provider, keys),
97 lm: model,
98 })
99 }
100 }
101 return candidates
102}
103
104func selectPreferredConfiguredShortTextModelConfig(
105 configs []database.ChatModelConfig,

Calls 5

UserAgentFunction · 0.92
CoderHeadersFunction · 0.92
ModelFromConfigFunction · 0.92
newDirectModelRouteFunction · 0.85