Maintain consistent data formats, parameter units, and interface patterns across API implementations. This includes: 1. Consistent type mappings and format handling
Maintain consistent data formats, parameter units, and interface patterns across API implementations. This includes:
Example of problematic inconsistencies:
// Inconsistent MIME type mapping
const mimeTypes: Record<string, string> = {
".png": "image/png",
".jpg": "image/jpeg",
// Missing MIME type for supported format
// .avif is in SUPPORTED_IMAGE_FORMATS but not mapped here
}
// Inconsistent parameter unit description
openAiApiTimeout: z.number().optional().describe("Timeout in milliseconds"),
// But actually handled as minutes in implementation:
const timeoutMs = (options.timeout ?? 10) * 60 * 1000
// Inconsistent message format handling
// Don't convert structured data to plain text when the API supports JSON
const args = [
"-p",
JSON.stringify(messages), // Correct: Preserve message structure
"--system-prompt",
systemPrompt
]
To maintain consistency:
Enter the URL of a public GitHub repository