* 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)
| 58 | * @returns True if the payload is valid, false otherwise. |
| 59 | */ |
| 60 | function isValidChatCompletionRequest(payload: unknown): boolean { |
| 61 | const result = chatCompletionRequestSchema.safeParse(payload) |
| 62 | return result.success |
| 63 | } |
| 64 | |
| 65 | describe("Anthropic to OpenAI translation logic", () => { |
| 66 | test("should translate minimal Anthropic payload to valid OpenAI payload", () => { |
no outgoing calls
no test coverage detected
searching dependent graphs…