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

Function TestWithProviderUsesExplicitHint

coderd/x/chatd/chaterror/classify_test.go:953–967  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

951}
952
953func TestWithProviderUsesExplicitHint(t *testing.T) {
954 t.Parallel()
955
956 classified := chaterror.Classify(xerrors.New("openai received status 429 from upstream"))
957 require.Equal(t, "openai", classified.Provider)
958
959 enriched := classified.WithProvider("azure openai")
960 require.Equal(t, chaterror.ClassifiedError{
961 Message: "Azure OpenAI is rate limiting requests.",
962 Kind: codersdk.ChatErrorKindRateLimit,
963 Provider: "azure",
964 Retryable: true,
965 StatusCode: 429,
966 }, enriched)
967}
968
969func TestWithProviderAddsProviderWhenUnknown(t *testing.T) {
970 t.Parallel()

Callers

nothing calls this directly

Calls 4

ClassifyFunction · 0.92
NewMethod · 0.65
EqualMethod · 0.45
WithProviderMethod · 0.45

Tested by

no test coverage detected