(ref: StructuredOutputSchemaRef)
| 46 | } |
| 47 | |
| 48 | function assertSchemaRef(ref: StructuredOutputSchemaRef): void { |
| 49 | if (!SCHEMA_PATTERN.test(ref.schema)) { |
| 50 | throw new Error(`Invalid structured output schema name: ${ref.schema}`); |
| 51 | } |
| 52 | if (!SCHEMA_VERSION_PATTERN.test(ref.version)) { |
| 53 | throw new Error(`Invalid structured output schema version: ${ref.version}`); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | function readJsonObject(filePath: string, label: string): JsonObject { |
| 58 | let raw: string; |
no outgoing calls
no test coverage detected