MCPcopy Create free account
hub / github.com/coder/coder / TestReasoningEffortFromChat

Function TestReasoningEffortFromChat

coderd/x/chatd/chatprovider/chatprovider_test.go:298–372  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

296}
297
298func TestReasoningEffortFromChat(t *testing.T) {
299 t.Parallel()
300
301 tests := []struct {
302 name string
303 provider string
304 input *string
305 want *string
306 }{
307 {
308 name: "OpenAICaseInsensitive",
309 provider: "openai",
310 input: ptr.Ref(" HIGH "),
311 want: ptr.Ref(string(fantasyopenai.ReasoningEffortHigh)),
312 },
313 {
314 name: "OpenAIXHighEffort",
315 provider: "openai",
316 input: ptr.Ref("xhigh"),
317 want: ptr.Ref(string(fantasyopenai.ReasoningEffortXHigh)),
318 },
319 {
320 name: "AnthropicEffort",
321 provider: "anthropic",
322 input: ptr.Ref("max"),
323 want: ptr.Ref(string(fantasyanthropic.EffortMax)),
324 },
325 {
326 name: "AnthropicXHighEffort",
327 provider: "anthropic",
328 input: ptr.Ref("xhigh"),
329 want: ptr.Ref(string(fantasyanthropic.EffortXHigh)),
330 },
331 {
332 name: "OpenRouterEffort",
333 provider: "openrouter",
334 input: ptr.Ref("medium"),
335 want: ptr.Ref(string(fantasyopenrouter.ReasoningEffortMedium)),
336 },
337 {
338 name: "VercelEffort",
339 provider: "vercel",
340 input: ptr.Ref("xhigh"),
341 want: ptr.Ref(string(fantasyvercel.ReasoningEffortXHigh)),
342 },
343 {
344 name: "InvalidEffortReturnsNil",
345 provider: "openai",
346 input: ptr.Ref("unknown"),
347 want: nil,
348 },
349 {
350 name: "UnsupportedProviderReturnsNil",
351 provider: "bedrock",
352 input: ptr.Ref("high"),
353 want: nil,
354 },
355 {

Callers

nothing calls this directly

Calls 4

RefFunction · 0.92
ReasoningEffortFromChatFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected