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

Function validateOpenAIResponses

aibridge/internal/integrationtest/mockupstream.go:296–303  ·  view source on GitHub ↗

validateOpenAIResponses validates that an OpenAI responses request has all required fields. See https://platform.openai.com/docs/api-reference/responses/create.

(t *testing.T, body []byte, msgAndArgs ...any)

Source from the content-addressed store, hash-verified

294// has all required fields.
295// See https://platform.openai.com/docs/api-reference/responses/create.
296func validateOpenAIResponses(t *testing.T, body []byte, msgAndArgs ...any) {
297 t.Helper()
298
299 var m map[string]any
300 require.NoError(t, json.Unmarshal(body, &m), msgAndArgs...)
301 require.NotEmpty(t, m["model"], "model is required", msgAndArgs)
302 require.Contains(t, m, "input", msgAndArgs...)
303}
304
305// validateAnthropicMessages validates that an Anthropic messages request
306// has all required fields.

Callers 1

validateRequestFunction · 0.85

Calls 4

NotEmptyMethod · 0.80
HelperMethod · 0.65
UnmarshalMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected