MCPcopy
hub / github.com/ericc-ch/copilot-api / isValidChatCompletionRequest

Function isValidChatCompletionRequest

tests/anthropic-request.test.ts:60–63  ·  view source on GitHub ↗

* Validates if a request payload conforms to the OpenAI Chat Completion v1 shape using Zod. * @param payload The request payload to validate. * @returns True if the payload is valid, false otherwise.

(payload: unknown)

Source from the content-addressed store, hash-verified

58 * @returns True if the payload is valid, false otherwise.
59 */
60function isValidChatCompletionRequest(payload: unknown): boolean {
61 const result = chatCompletionRequestSchema.safeParse(payload)
62 return result.success
63}
64
65describe("Anthropic to OpenAI translation logic", () => {
66 test("should translate minimal Anthropic payload to valid OpenAI payload", () => {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…