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

Function IsReasoningModel

coderd/x/chatd/chatopenai/options.go:204–221  ·  view source on GitHub ↗

IsReasoningModel reports whether a model ID follows OpenAI reasoning model naming conventions.

(modelID string)

Source from the content-addressed store, hash-verified

202// IsReasoningModel reports whether a model ID follows OpenAI reasoning model
203// naming conventions.
204func IsReasoningModel(modelID string) bool {
205 if len(modelID) < 2 || modelID[0] != 'o' {
206 return false
207 }
208
209 index := 1
210 for index < len(modelID) && modelID[index] >= '0' && modelID[index] <= '9' {
211 index++
212 }
213 if index == 1 {
214 return false
215 }
216
217 if index == len(modelID) {
218 return true
219 }
220 return modelID[index] == '-' || modelID[index] == '.'
221}
222
223func boolPtrOrDefault(value *bool, def bool) *bool {
224 if value != nil {

Callers 2

TestIsReasoningModelFunction · 0.92
isChatModelForProviderFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestIsReasoningModelFunction · 0.74