visual-ai-assertions 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -420,8 +420,12 @@ declare const AskResultSchema: z.ZodObject<{
420
420
  /**
421
421
  * For video inputs, the indices of frames the model relied on to answer.
422
422
  * Indices are 0-based and refer to entries in `frames.timestampsSeconds`.
423
+ *
424
+ * Nullable because providers with strict structured-output schemas (e.g. OpenAI)
425
+ * must mark every field required and represent "no value" as `null` rather than
426
+ * omitting the key, even for image inputs that were never asked to populate it.
423
427
  */
424
- frameReferences: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
428
+ frameReferences: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
425
429
  usage: z.ZodOptional<z.ZodObject<{
426
430
  inputTokens: z.ZodNumber;
427
431
  outputTokens: z.ZodNumber;
@@ -457,7 +461,7 @@ declare const AskResultSchema: z.ZodObject<{
457
461
  estimatedCost?: number | undefined;
458
462
  durationSeconds?: number | undefined;
459
463
  } | undefined;
460
- frameReferences?: number[] | undefined;
464
+ frameReferences?: number[] | null | undefined;
461
465
  }, {
462
466
  issues: {
463
467
  priority: "critical" | "major" | "minor";
@@ -473,11 +477,12 @@ declare const AskResultSchema: z.ZodObject<{
473
477
  estimatedCost?: number | undefined;
474
478
  durationSeconds?: number | undefined;
475
479
  } | undefined;
476
- frameReferences?: number[] | undefined;
480
+ frameReferences?: number[] | null | undefined;
477
481
  }>;
478
482
  /** Result returned by `ask()`. */
479
- type AskResult = z.infer<typeof AskResultSchema> & {
483
+ type AskResult = Omit<z.infer<typeof AskResultSchema>, "frameReferences"> & {
480
484
  /** Present only when the input was a video. Describes which frames the model saw. */
485
+ frameReferences?: number[];
481
486
  frames?: VideoFramesMetadata;
482
487
  };
483
488
  /** Supported input shapes for image arguments accepted by the client. */
package/dist/index.d.ts CHANGED
@@ -420,8 +420,12 @@ declare const AskResultSchema: z.ZodObject<{
420
420
  /**
421
421
  * For video inputs, the indices of frames the model relied on to answer.
422
422
  * Indices are 0-based and refer to entries in `frames.timestampsSeconds`.
423
+ *
424
+ * Nullable because providers with strict structured-output schemas (e.g. OpenAI)
425
+ * must mark every field required and represent "no value" as `null` rather than
426
+ * omitting the key, even for image inputs that were never asked to populate it.
423
427
  */
424
- frameReferences: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
428
+ frameReferences: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
425
429
  usage: z.ZodOptional<z.ZodObject<{
426
430
  inputTokens: z.ZodNumber;
427
431
  outputTokens: z.ZodNumber;
@@ -457,7 +461,7 @@ declare const AskResultSchema: z.ZodObject<{
457
461
  estimatedCost?: number | undefined;
458
462
  durationSeconds?: number | undefined;
459
463
  } | undefined;
460
- frameReferences?: number[] | undefined;
464
+ frameReferences?: number[] | null | undefined;
461
465
  }, {
462
466
  issues: {
463
467
  priority: "critical" | "major" | "minor";
@@ -473,11 +477,12 @@ declare const AskResultSchema: z.ZodObject<{
473
477
  estimatedCost?: number | undefined;
474
478
  durationSeconds?: number | undefined;
475
479
  } | undefined;
476
- frameReferences?: number[] | undefined;
480
+ frameReferences?: number[] | null | undefined;
477
481
  }>;
478
482
  /** Result returned by `ask()`. */
479
- type AskResult = z.infer<typeof AskResultSchema> & {
483
+ type AskResult = Omit<z.infer<typeof AskResultSchema>, "frameReferences"> & {
480
484
  /** Present only when the input was a video. Describes which frames the model saw. */
485
+ frameReferences?: number[];
481
486
  frames?: VideoFramesMetadata;
482
487
  };
483
488
  /** Supported input shapes for image arguments accepted by the client. */
package/dist/index.js CHANGED
@@ -1785,8 +1785,12 @@ var AskResultSchema = z.object({
1785
1785
  /**
1786
1786
  * For video inputs, the indices of frames the model relied on to answer.
1787
1787
  * Indices are 0-based and refer to entries in `frames.timestampsSeconds`.
1788
+ *
1789
+ * Nullable because providers with strict structured-output schemas (e.g. OpenAI)
1790
+ * must mark every field required and represent "no value" as `null` rather than
1791
+ * omitting the key, even for image inputs that were never asked to populate it.
1788
1792
  */
1789
- frameReferences: z.array(z.number().int().nonnegative()).optional(),
1793
+ frameReferences: z.array(z.number().int().nonnegative()).nullable().optional(),
1790
1794
  usage: UsageInfoSchema.optional()
1791
1795
  });
1792
1796
 
@@ -1838,7 +1842,11 @@ function parseCheckResponse(raw) {
1838
1842
  return reconcileCheckResult(result);
1839
1843
  }
1840
1844
  function parseAskResponse(raw) {
1841
- return parseResponse(raw, AskResponseSchema);
1845
+ const result = parseResponse(raw, AskResponseSchema);
1846
+ return {
1847
+ ...result,
1848
+ frameReferences: result.frameReferences ?? void 0
1849
+ };
1842
1850
  }
1843
1851
  function parseCompareResponse(raw) {
1844
1852
  return parseResponse(raw, CompareResponseSchema);