@oxy.so/contracts 1.3.0 → 1.4.0

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/esm/index.js CHANGED
@@ -138,7 +138,7 @@ export {
138
138
  priceVersionStatusSchema, priceVersionSchema, priceSnapshotSchema, } from './inference/priceVersion.js';
139
139
  export {
140
140
  // The six distinct catalogue objects + the customer-safe projection.
141
- inferenceModalitySchema, modelCapabilitiesSchema, modelLicenseSchema, modelProvenanceSchema, inferenceDataPolicySchema, availabilityScopeSchema, commercialPermissionSchema, modelDeprecationSchema, modelEvaluationResultSchema, modelSafetyMetadataSchema, modelPublisherSchema, catalogueModelSchema, modelRevisionSchema, inferenceProviderSchema, modelDeploymentSchema, routingProfileCandidateSchema, routingProfileSchema, cataloguePublisherSummarySchema, catalogueServingProviderSummarySchema, modelCatalogueEntrySchema, } from './inference/catalogue.js';
141
+ inferenceModalitySchema, reasoningEffortSchema, modelCapabilitiesSchema, modelLicenseSchema, modelProvenanceSchema, inferenceDataPolicySchema, availabilityScopeSchema, commercialPermissionSchema, modelDeprecationSchema, modelEvaluationResultSchema, modelSafetyMetadataSchema, modelPublisherSchema, catalogueModelSchema, modelRevisionSchema, inferenceProviderSchema, modelDeploymentSchema, routingProfileCandidateSchema, routingProfileSchema, cataloguePublisherSummarySchema, catalogueServingProviderSummarySchema, modelCatalogueEntrySchema, } from './inference/catalogue.js';
142
142
  export {
143
143
  // Routing policy: every control, plus the refinement that rejects a policy
144
144
  // no route could ever satisfy.
@@ -155,7 +155,7 @@ export {
155
155
  modelDistributionMethodSchema, modelSystemicRiskTierSchema, trainingComputeFlopsSchema, SYSTEMIC_RISK_COMPUTE_THRESHOLD_FLOPS, modelDownstreamDocumentationSchema, modelGpaiDocumentationSchema, modelLineDeclarationSchema, modelReleaseIngestionRequestSchema, modelReleaseIngestionResultSchema, modelDocumentationSchema, } from './inference/modelDocumentation.js';
156
156
  export {
157
157
  // The normalized Oxy→data-plane request envelope.
158
- inferenceContentSourceSchema, inferenceContentPartSchema, inferenceToolCallSchema, inferenceMessageRoleSchema, inferenceMessageSchema, inferenceInputSchema, samplingParametersSchema, toolDefinitionSchema, toolChoiceSchema, responseFormatSchema, clientRequestMetadataSchema, inferenceRequestSchema, inferenceSpeechParametersSchema, } from './inference/request.js';
158
+ inferenceContentSourceSchema, inferenceContentPartSchema, inferenceToolCallSchema, inferenceMessageRoleSchema, inferenceMessageSchema, inferenceInputSchema, samplingParametersSchema, inferenceReasoningSchema, toolDefinitionSchema, toolChoiceSchema, responseFormatSchema, clientRequestMetadataSchema, inferenceRequestSchema, inferenceSpeechParametersSchema, } from './inference/request.js';
159
159
  export {
160
160
  // Normalized SSE events.
161
161
  inferenceStreamStartEventSchema, inferenceStreamDeltaEventSchema, inferenceAudioMediaTypeSchema, MAX_INFERENCE_AUDIO_BYTES, inferenceStreamAudioEventSchema, inferenceStreamToolCallEventSchema, inferenceStreamUsageEventSchema, inferenceRouteSwitchDetailSchema, inferenceRouteSwitchReasonSchema, inferenceStreamRouteSwitchEventSchema, inferenceStreamErrorEventSchema, inferenceFinishReasonSchema, inferenceStreamDoneEventSchema, inferenceStreamEventSchema, } from './inference/streamEvents.js';
@@ -40,6 +40,15 @@ export const inferenceModalitySchema = z.enum([
40
40
  'video',
41
41
  'embedding',
42
42
  ]);
43
+ /**
44
+ * How hard a reasoning model is asked to think before it answers.
45
+ *
46
+ * A closed, provider-neutral vocabulary: Kaana translates each value into the
47
+ * serving provider's own control. A model advertises the subset it accepts in
48
+ * `modelCapabilitiesSchema.reasoningEfforts`, and Oxy refuses a request for an
49
+ * effort the resolved model does not advertise rather than dropping it.
50
+ */
51
+ export const reasoningEffortSchema = z.enum(['low', 'medium', 'high']);
43
52
  /**
44
53
  * What a model can do, in the terms a caller has to decide against before
45
54
  * sending a request: can it call tools, does it accept images, will it honour a
@@ -54,6 +63,13 @@ export const modelCapabilitiesSchema = z
54
63
  structuredOutput: z.boolean(),
55
64
  jsonMode: z.boolean(),
56
65
  reasoning: z.boolean(),
66
+ /**
67
+ * The reasoning efforts a request may name for this model, in the order
68
+ * low → high. Empty means the model takes no effort control at all (it may
69
+ * still reason: `reasoning` answers that). Added in contract set 3.1.0;
70
+ * absent on the wire from an older producer, it parses as `[]`.
71
+ */
72
+ reasoningEfforts: z.array(reasoningEffortSchema).default([]),
57
73
  streaming: z.boolean(),
58
74
  promptCaching: z.boolean(),
59
75
  maxContextTokens: z.number().int().positive().safe(),
@@ -469,6 +485,12 @@ export const modelCatalogueEntrySchema = z.object({
469
485
  provenance: modelProvenanceSchema,
470
486
  knowledgeCutoff: inferenceDateSchema.optional(),
471
487
  releasedOn: inferenceDateSchema.optional(),
488
+ /**
489
+ * When the upstream provider first published this model, as that provider
490
+ * reports it. Present only when a provider reported it; never an Oxy or Kaana
491
+ * observation time. Lets a picker order models newest first.
492
+ */
493
+ releasedAt: inferenceTimestampSchema.optional(),
472
494
  regions: z.array(inferenceRegionSchema).default([]),
473
495
  servingProviders: z.array(catalogueServingProviderSummarySchema).default([]),
474
496
  dataPolicy: inferenceDataPolicySchema,
@@ -25,7 +25,7 @@
25
25
  */
26
26
  import { z } from "zod";
27
27
  import { inferenceAttributionSchema } from "./attribution.js";
28
- import { inferenceModalitySchema } from "./catalogue.js";
28
+ import { inferenceModalitySchema, reasoningEffortSchema } from "./catalogue.js";
29
29
  import { idempotencyKeySchema, inferenceTimestampSchema } from "./identifiers.js";
30
30
  import { authorizedRouteSchema, routingPolicyReferenceSchema, routingTargetSchema, } from "./routingPolicy.js";
31
31
  /* -------------------------------------------------------------------------- */
@@ -260,6 +260,16 @@ export const responseFormatSchema = z.discriminatedUnion("type", [
260
260
  })
261
261
  .strict(),
262
262
  ]);
263
+ /**
264
+ * The caller's reasoning control. Strict, like every leaf: a provider-specific
265
+ * knob (`budget_tokens`, `summary`) is refused rather than silently dropped.
266
+ *
267
+ * Oxy forwards it only after checking the resolved model advertises the effort
268
+ * in its catalogue `reasoningEfforts`; Kaana translates it per provider.
269
+ */
270
+ export const inferenceReasoningSchema = z
271
+ .object({ effort: reasoningEffortSchema })
272
+ .strict();
263
273
  /* -------------------------------------------------------------------------- */
264
274
  /* Client metadata */
265
275
  /* -------------------------------------------------------------------------- */
@@ -336,6 +346,8 @@ export const inferenceRequestSchema = z
336
346
  stream: z.boolean(),
337
347
  maxOutputTokens: z.number().int().positive().safe().optional(),
338
348
  sampling: samplingParametersSchema,
349
+ /** Absent means the route's own default reasoning behaviour. */
350
+ reasoning: inferenceReasoningSchema.optional(),
339
351
  speech: inferenceSpeechParametersSchema.optional(),
340
352
  tools: z.array(toolDefinitionSchema).default([]),
341
353
  toolChoice: toolChoiceSchema.optional(),
@@ -99,4 +99,4 @@
99
99
  * change to, say, the catalogue reject every in-flight inference request; the
100
100
  * per-shape `schemaVersion` is what a message is validated against.
101
101
  */
102
- export const INFERENCE_CONTRACT_VERSION = '3.0.0';
102
+ export const INFERENCE_CONTRACT_VERSION = '3.1.0';