@oxy.so/contracts 1.0.0 → 1.0.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/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/index.js +10 -4
- package/dist/cjs/inference/embeddings.js +19 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/inference/embeddings.js +16 -0
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/inference/catalogue.d.ts +24 -24
- package/dist/types/inference/embeddings.d.ts +455 -0
- package/dist/types/inference/modelDocumentation.d.ts +20 -20
- package/dist/types/inference/request.d.ts +4 -4
- package/dist/types/inference/streamEvents.d.ts +4 -4
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -70,6 +70,8 @@ export { INFERENCE_SCOPES, inferenceScopeSchema, billingPrincipalSchema, authent
|
|
|
70
70
|
export type { InferenceScope, BillingPrincipal, AuthenticatedPrincipal, InferenceAttribution, } from './inference/attribution';
|
|
71
71
|
export { INFERENCE_ERROR_CODES, NON_RETRYABLE_INFERENCE_ERROR_CODES, inferenceErrorCodeSchema, upstreamErrorCategorySchema, safeErrorTextSchema, providerErrorPassthroughSchema, inferenceErrorSchema, } from './inference/errors';
|
|
72
72
|
export type { InferenceErrorCode, UpstreamErrorCategory, ProviderErrorPassthrough, InferenceError, } from './inference/errors';
|
|
73
|
+
export { embeddingVectorSchema, embeddingUsageSchema, embeddingSuccessSchema, embeddingFailureSchema, embeddingResponseSchema, } from './inference/embeddings';
|
|
74
|
+
export type { EmbeddingVector, EmbeddingUsage, EmbeddingSuccess, EmbeddingFailure, EmbeddingResponse, } from './inference/embeddings';
|
|
73
75
|
export { priceVersionStatusSchema, priceVersionSchema, priceSnapshotSchema, } from './inference/priceVersion';
|
|
74
76
|
export type { PriceVersionStatus, PriceVersion, PriceSnapshot } from './inference/priceVersion';
|
|
75
77
|
export { inferenceModalitySchema, modelCapabilitiesSchema, modelLicenseSchema, modelProvenanceSchema, inferenceDataPolicySchema, availabilityScopeSchema, commercialPermissionSchema, modelDeprecationSchema, modelEvaluationResultSchema, modelSafetyMetadataSchema, modelPublisherSchema, catalogueModelSchema, modelRevisionSchema, inferenceProviderSchema, modelDeploymentSchema, routingProfileCandidateSchema, routingProfileSchema, cataloguePublisherSummarySchema, catalogueServingProviderSummarySchema, modelCatalogueEntrySchema, } from './inference/catalogue';
|
|
@@ -48,8 +48,8 @@ export declare const modelCapabilitiesSchema: z.ZodObject<{
|
|
|
48
48
|
maxOutputTokens: z.ZodNumber;
|
|
49
49
|
}, "strict", z.ZodTypeAny, {
|
|
50
50
|
tools: boolean;
|
|
51
|
-
inputModalities: ("image" | "
|
|
52
|
-
outputModalities: ("image" | "
|
|
51
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
52
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
53
53
|
parallelToolCalls: boolean;
|
|
54
54
|
structuredOutput: boolean;
|
|
55
55
|
jsonMode: boolean;
|
|
@@ -60,8 +60,8 @@ export declare const modelCapabilitiesSchema: z.ZodObject<{
|
|
|
60
60
|
maxOutputTokens: number;
|
|
61
61
|
}, {
|
|
62
62
|
tools: boolean;
|
|
63
|
-
inputModalities: ("image" | "
|
|
64
|
-
outputModalities: ("image" | "
|
|
63
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
64
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
65
65
|
parallelToolCalls: boolean;
|
|
66
66
|
structuredOutput: boolean;
|
|
67
67
|
jsonMode: boolean;
|
|
@@ -294,8 +294,8 @@ export declare const catalogueModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
294
294
|
maxOutputTokens: z.ZodNumber;
|
|
295
295
|
}, "strict", z.ZodTypeAny, {
|
|
296
296
|
tools: boolean;
|
|
297
|
-
inputModalities: ("image" | "
|
|
298
|
-
outputModalities: ("image" | "
|
|
297
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
298
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
299
299
|
parallelToolCalls: boolean;
|
|
300
300
|
structuredOutput: boolean;
|
|
301
301
|
jsonMode: boolean;
|
|
@@ -306,8 +306,8 @@ export declare const catalogueModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
306
306
|
maxOutputTokens: number;
|
|
307
307
|
}, {
|
|
308
308
|
tools: boolean;
|
|
309
|
-
inputModalities: ("image" | "
|
|
310
|
-
outputModalities: ("image" | "
|
|
309
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
310
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
311
311
|
parallelToolCalls: boolean;
|
|
312
312
|
structuredOutput: boolean;
|
|
313
313
|
jsonMode: boolean;
|
|
@@ -388,8 +388,8 @@ export declare const catalogueModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
388
388
|
displayName: string;
|
|
389
389
|
capabilities: {
|
|
390
390
|
tools: boolean;
|
|
391
|
-
inputModalities: ("image" | "
|
|
392
|
-
outputModalities: ("image" | "
|
|
391
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
392
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
393
393
|
parallelToolCalls: boolean;
|
|
394
394
|
structuredOutput: boolean;
|
|
395
395
|
jsonMode: boolean;
|
|
@@ -430,8 +430,8 @@ export declare const catalogueModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
430
430
|
displayName: string;
|
|
431
431
|
capabilities: {
|
|
432
432
|
tools: boolean;
|
|
433
|
-
inputModalities: ("image" | "
|
|
434
|
-
outputModalities: ("image" | "
|
|
433
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
434
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
435
435
|
parallelToolCalls: boolean;
|
|
436
436
|
structuredOutput: boolean;
|
|
437
437
|
jsonMode: boolean;
|
|
@@ -472,8 +472,8 @@ export declare const catalogueModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
472
472
|
displayName: string;
|
|
473
473
|
capabilities: {
|
|
474
474
|
tools: boolean;
|
|
475
|
-
inputModalities: ("image" | "
|
|
476
|
-
outputModalities: ("image" | "
|
|
475
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
476
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
477
477
|
parallelToolCalls: boolean;
|
|
478
478
|
structuredOutput: boolean;
|
|
479
479
|
jsonMode: boolean;
|
|
@@ -514,8 +514,8 @@ export declare const catalogueModelSchema: z.ZodEffects<z.ZodObject<{
|
|
|
514
514
|
displayName: string;
|
|
515
515
|
capabilities: {
|
|
516
516
|
tools: boolean;
|
|
517
|
-
inputModalities: ("image" | "
|
|
518
|
-
outputModalities: ("image" | "
|
|
517
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
518
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
519
519
|
parallelToolCalls: boolean;
|
|
520
520
|
structuredOutput: boolean;
|
|
521
521
|
jsonMode: boolean;
|
|
@@ -1132,8 +1132,8 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
1132
1132
|
maxOutputTokens: z.ZodNumber;
|
|
1133
1133
|
}, "strict", z.ZodTypeAny, {
|
|
1134
1134
|
tools: boolean;
|
|
1135
|
-
inputModalities: ("image" | "
|
|
1136
|
-
outputModalities: ("image" | "
|
|
1135
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1136
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1137
1137
|
parallelToolCalls: boolean;
|
|
1138
1138
|
structuredOutput: boolean;
|
|
1139
1139
|
jsonMode: boolean;
|
|
@@ -1144,8 +1144,8 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
1144
1144
|
maxOutputTokens: number;
|
|
1145
1145
|
}, {
|
|
1146
1146
|
tools: boolean;
|
|
1147
|
-
inputModalities: ("image" | "
|
|
1148
|
-
outputModalities: ("image" | "
|
|
1147
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1148
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1149
1149
|
parallelToolCalls: boolean;
|
|
1150
1150
|
structuredOutput: boolean;
|
|
1151
1151
|
jsonMode: boolean;
|
|
@@ -1411,8 +1411,8 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
1411
1411
|
displayName: string;
|
|
1412
1412
|
capabilities: {
|
|
1413
1413
|
tools: boolean;
|
|
1414
|
-
inputModalities: ("image" | "
|
|
1415
|
-
outputModalities: ("image" | "
|
|
1414
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1415
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1416
1416
|
parallelToolCalls: boolean;
|
|
1417
1417
|
structuredOutput: boolean;
|
|
1418
1418
|
jsonMode: boolean;
|
|
@@ -1505,8 +1505,8 @@ export declare const modelCatalogueEntrySchema: z.ZodObject<{
|
|
|
1505
1505
|
displayName: string;
|
|
1506
1506
|
capabilities: {
|
|
1507
1507
|
tools: boolean;
|
|
1508
|
-
inputModalities: ("image" | "
|
|
1509
|
-
outputModalities: ("image" | "
|
|
1508
|
+
inputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1509
|
+
outputModalities: ("image" | "embedding" | "text" | "audio" | "video")[];
|
|
1510
1510
|
parallelToolCalls: boolean;
|
|
1511
1511
|
structuredOutput: boolean;
|
|
1512
1512
|
jsonMode: boolean;
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const embeddingVectorSchema: z.ZodObject<{
|
|
3
|
+
index: z.ZodNumber;
|
|
4
|
+
embedding: z.ZodArray<z.ZodNumber, "many">;
|
|
5
|
+
}, "strict", z.ZodTypeAny, {
|
|
6
|
+
index: number;
|
|
7
|
+
embedding: number[];
|
|
8
|
+
}, {
|
|
9
|
+
index: number;
|
|
10
|
+
embedding: number[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare const embeddingUsageSchema: z.ZodEffects<z.ZodObject<{
|
|
13
|
+
inputTokens: z.ZodNumber;
|
|
14
|
+
totalTokens: z.ZodNumber;
|
|
15
|
+
}, "strict", z.ZodTypeAny, {
|
|
16
|
+
inputTokens: number;
|
|
17
|
+
totalTokens: number;
|
|
18
|
+
}, {
|
|
19
|
+
inputTokens: number;
|
|
20
|
+
totalTokens: number;
|
|
21
|
+
}>, {
|
|
22
|
+
inputTokens: number;
|
|
23
|
+
totalTokens: number;
|
|
24
|
+
}, {
|
|
25
|
+
inputTokens: number;
|
|
26
|
+
totalTokens: number;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const embeddingSuccessSchema: z.ZodEffects<z.ZodObject<{
|
|
29
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
30
|
+
requestId: z.ZodString;
|
|
31
|
+
model: z.ZodString;
|
|
32
|
+
dimension: z.ZodNumber;
|
|
33
|
+
data: z.ZodArray<z.ZodObject<{
|
|
34
|
+
index: z.ZodNumber;
|
|
35
|
+
embedding: z.ZodArray<z.ZodNumber, "many">;
|
|
36
|
+
}, "strict", z.ZodTypeAny, {
|
|
37
|
+
index: number;
|
|
38
|
+
embedding: number[];
|
|
39
|
+
}, {
|
|
40
|
+
index: number;
|
|
41
|
+
embedding: number[];
|
|
42
|
+
}>, "many">;
|
|
43
|
+
usage: z.ZodEffects<z.ZodObject<{
|
|
44
|
+
inputTokens: z.ZodNumber;
|
|
45
|
+
totalTokens: z.ZodNumber;
|
|
46
|
+
}, "strict", z.ZodTypeAny, {
|
|
47
|
+
inputTokens: number;
|
|
48
|
+
totalTokens: number;
|
|
49
|
+
}, {
|
|
50
|
+
inputTokens: number;
|
|
51
|
+
totalTokens: number;
|
|
52
|
+
}>, {
|
|
53
|
+
inputTokens: number;
|
|
54
|
+
totalTokens: number;
|
|
55
|
+
}, {
|
|
56
|
+
inputTokens: number;
|
|
57
|
+
totalTokens: number;
|
|
58
|
+
}>;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
schemaVersion: 1;
|
|
61
|
+
data: {
|
|
62
|
+
index: number;
|
|
63
|
+
embedding: number[];
|
|
64
|
+
}[];
|
|
65
|
+
requestId: string;
|
|
66
|
+
model: string;
|
|
67
|
+
dimension: number;
|
|
68
|
+
usage: {
|
|
69
|
+
inputTokens: number;
|
|
70
|
+
totalTokens: number;
|
|
71
|
+
};
|
|
72
|
+
}, {
|
|
73
|
+
schemaVersion: 1;
|
|
74
|
+
data: {
|
|
75
|
+
index: number;
|
|
76
|
+
embedding: number[];
|
|
77
|
+
}[];
|
|
78
|
+
requestId: string;
|
|
79
|
+
model: string;
|
|
80
|
+
dimension: number;
|
|
81
|
+
usage: {
|
|
82
|
+
inputTokens: number;
|
|
83
|
+
totalTokens: number;
|
|
84
|
+
};
|
|
85
|
+
}>, {
|
|
86
|
+
schemaVersion: 1;
|
|
87
|
+
data: {
|
|
88
|
+
index: number;
|
|
89
|
+
embedding: number[];
|
|
90
|
+
}[];
|
|
91
|
+
requestId: string;
|
|
92
|
+
model: string;
|
|
93
|
+
dimension: number;
|
|
94
|
+
usage: {
|
|
95
|
+
inputTokens: number;
|
|
96
|
+
totalTokens: number;
|
|
97
|
+
};
|
|
98
|
+
}, {
|
|
99
|
+
schemaVersion: 1;
|
|
100
|
+
data: {
|
|
101
|
+
index: number;
|
|
102
|
+
embedding: number[];
|
|
103
|
+
}[];
|
|
104
|
+
requestId: string;
|
|
105
|
+
model: string;
|
|
106
|
+
dimension: number;
|
|
107
|
+
usage: {
|
|
108
|
+
inputTokens: number;
|
|
109
|
+
totalTokens: number;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
export declare const embeddingFailureSchema: z.ZodObject<{
|
|
113
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
114
|
+
requestId: z.ZodString;
|
|
115
|
+
error: z.ZodEffects<z.ZodObject<{
|
|
116
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
117
|
+
code: z.ZodEnum<["invalid_request", "authentication_failed", "permission_denied", "insufficient_scope", "model_not_found", "unsupported_modality", "context_length_exceeded", "request_too_large", "output_limit_exceeded", "idempotency_conflict", "insufficient_balance", "spending_limit_exceeded", "quota_exceeded", "byok_credential_invalid", "policy_violation", "commercial_permission_denied", "no_route_available", "upstream_content_filtered", "cancelled", "rate_limited", "deployment_unavailable", "provider_error", "provider_timeout", "provider_overloaded", "provider_credential_invalid", "provider_billing_refused", "service_unavailable", "internal_error"]>;
|
|
118
|
+
message: z.ZodEffects<z.ZodString, string, string>;
|
|
119
|
+
retryable: z.ZodBoolean;
|
|
120
|
+
requestId: z.ZodString;
|
|
121
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
param: z.ZodOptional<z.ZodString>;
|
|
123
|
+
upstreamCategory: z.ZodOptional<z.ZodEnum<["rate_limit", "quota", "timeout", "overloaded", "server_error", "content_filter", "invalid_request", "authentication", "unknown"]>>;
|
|
124
|
+
providerError: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
provider: z.ZodString;
|
|
126
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
code: z.ZodOptional<z.ZodString>;
|
|
128
|
+
message: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
129
|
+
}, "strict", z.ZodTypeAny, {
|
|
130
|
+
provider: string;
|
|
131
|
+
code?: string | undefined;
|
|
132
|
+
message?: string | undefined;
|
|
133
|
+
status?: number | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
provider: string;
|
|
136
|
+
code?: string | undefined;
|
|
137
|
+
message?: string | undefined;
|
|
138
|
+
status?: number | undefined;
|
|
139
|
+
}>>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
142
|
+
message: string;
|
|
143
|
+
schemaVersion: 1;
|
|
144
|
+
requestId: string;
|
|
145
|
+
retryable: boolean;
|
|
146
|
+
retryAfterMs?: number | undefined;
|
|
147
|
+
param?: string | undefined;
|
|
148
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
149
|
+
providerError?: {
|
|
150
|
+
provider: string;
|
|
151
|
+
code?: string | undefined;
|
|
152
|
+
message?: string | undefined;
|
|
153
|
+
status?: number | undefined;
|
|
154
|
+
} | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
157
|
+
message: string;
|
|
158
|
+
schemaVersion: 1;
|
|
159
|
+
requestId: string;
|
|
160
|
+
retryable: boolean;
|
|
161
|
+
retryAfterMs?: number | undefined;
|
|
162
|
+
param?: string | undefined;
|
|
163
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
164
|
+
providerError?: {
|
|
165
|
+
provider: string;
|
|
166
|
+
code?: string | undefined;
|
|
167
|
+
message?: string | undefined;
|
|
168
|
+
status?: number | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
}>, {
|
|
171
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
172
|
+
message: string;
|
|
173
|
+
schemaVersion: 1;
|
|
174
|
+
requestId: string;
|
|
175
|
+
retryable: boolean;
|
|
176
|
+
retryAfterMs?: number | undefined;
|
|
177
|
+
param?: string | undefined;
|
|
178
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
179
|
+
providerError?: {
|
|
180
|
+
provider: string;
|
|
181
|
+
code?: string | undefined;
|
|
182
|
+
message?: string | undefined;
|
|
183
|
+
status?: number | undefined;
|
|
184
|
+
} | undefined;
|
|
185
|
+
}, {
|
|
186
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
187
|
+
message: string;
|
|
188
|
+
schemaVersion: 1;
|
|
189
|
+
requestId: string;
|
|
190
|
+
retryable: boolean;
|
|
191
|
+
retryAfterMs?: number | undefined;
|
|
192
|
+
param?: string | undefined;
|
|
193
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
194
|
+
providerError?: {
|
|
195
|
+
provider: string;
|
|
196
|
+
code?: string | undefined;
|
|
197
|
+
message?: string | undefined;
|
|
198
|
+
status?: number | undefined;
|
|
199
|
+
} | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
}, "strict", z.ZodTypeAny, {
|
|
202
|
+
schemaVersion: 1;
|
|
203
|
+
requestId: string;
|
|
204
|
+
error: {
|
|
205
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
206
|
+
message: string;
|
|
207
|
+
schemaVersion: 1;
|
|
208
|
+
requestId: string;
|
|
209
|
+
retryable: boolean;
|
|
210
|
+
retryAfterMs?: number | undefined;
|
|
211
|
+
param?: string | undefined;
|
|
212
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
213
|
+
providerError?: {
|
|
214
|
+
provider: string;
|
|
215
|
+
code?: string | undefined;
|
|
216
|
+
message?: string | undefined;
|
|
217
|
+
status?: number | undefined;
|
|
218
|
+
} | undefined;
|
|
219
|
+
};
|
|
220
|
+
}, {
|
|
221
|
+
schemaVersion: 1;
|
|
222
|
+
requestId: string;
|
|
223
|
+
error: {
|
|
224
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
225
|
+
message: string;
|
|
226
|
+
schemaVersion: 1;
|
|
227
|
+
requestId: string;
|
|
228
|
+
retryable: boolean;
|
|
229
|
+
retryAfterMs?: number | undefined;
|
|
230
|
+
param?: string | undefined;
|
|
231
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
232
|
+
providerError?: {
|
|
233
|
+
provider: string;
|
|
234
|
+
code?: string | undefined;
|
|
235
|
+
message?: string | undefined;
|
|
236
|
+
status?: number | undefined;
|
|
237
|
+
} | undefined;
|
|
238
|
+
};
|
|
239
|
+
}>;
|
|
240
|
+
export declare const embeddingResponseSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
241
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
242
|
+
requestId: z.ZodString;
|
|
243
|
+
model: z.ZodString;
|
|
244
|
+
dimension: z.ZodNumber;
|
|
245
|
+
data: z.ZodArray<z.ZodObject<{
|
|
246
|
+
index: z.ZodNumber;
|
|
247
|
+
embedding: z.ZodArray<z.ZodNumber, "many">;
|
|
248
|
+
}, "strict", z.ZodTypeAny, {
|
|
249
|
+
index: number;
|
|
250
|
+
embedding: number[];
|
|
251
|
+
}, {
|
|
252
|
+
index: number;
|
|
253
|
+
embedding: number[];
|
|
254
|
+
}>, "many">;
|
|
255
|
+
usage: z.ZodEffects<z.ZodObject<{
|
|
256
|
+
inputTokens: z.ZodNumber;
|
|
257
|
+
totalTokens: z.ZodNumber;
|
|
258
|
+
}, "strict", z.ZodTypeAny, {
|
|
259
|
+
inputTokens: number;
|
|
260
|
+
totalTokens: number;
|
|
261
|
+
}, {
|
|
262
|
+
inputTokens: number;
|
|
263
|
+
totalTokens: number;
|
|
264
|
+
}>, {
|
|
265
|
+
inputTokens: number;
|
|
266
|
+
totalTokens: number;
|
|
267
|
+
}, {
|
|
268
|
+
inputTokens: number;
|
|
269
|
+
totalTokens: number;
|
|
270
|
+
}>;
|
|
271
|
+
}, "strict", z.ZodTypeAny, {
|
|
272
|
+
schemaVersion: 1;
|
|
273
|
+
data: {
|
|
274
|
+
index: number;
|
|
275
|
+
embedding: number[];
|
|
276
|
+
}[];
|
|
277
|
+
requestId: string;
|
|
278
|
+
model: string;
|
|
279
|
+
dimension: number;
|
|
280
|
+
usage: {
|
|
281
|
+
inputTokens: number;
|
|
282
|
+
totalTokens: number;
|
|
283
|
+
};
|
|
284
|
+
}, {
|
|
285
|
+
schemaVersion: 1;
|
|
286
|
+
data: {
|
|
287
|
+
index: number;
|
|
288
|
+
embedding: number[];
|
|
289
|
+
}[];
|
|
290
|
+
requestId: string;
|
|
291
|
+
model: string;
|
|
292
|
+
dimension: number;
|
|
293
|
+
usage: {
|
|
294
|
+
inputTokens: number;
|
|
295
|
+
totalTokens: number;
|
|
296
|
+
};
|
|
297
|
+
}>, {
|
|
298
|
+
schemaVersion: 1;
|
|
299
|
+
data: {
|
|
300
|
+
index: number;
|
|
301
|
+
embedding: number[];
|
|
302
|
+
}[];
|
|
303
|
+
requestId: string;
|
|
304
|
+
model: string;
|
|
305
|
+
dimension: number;
|
|
306
|
+
usage: {
|
|
307
|
+
inputTokens: number;
|
|
308
|
+
totalTokens: number;
|
|
309
|
+
};
|
|
310
|
+
}, {
|
|
311
|
+
schemaVersion: 1;
|
|
312
|
+
data: {
|
|
313
|
+
index: number;
|
|
314
|
+
embedding: number[];
|
|
315
|
+
}[];
|
|
316
|
+
requestId: string;
|
|
317
|
+
model: string;
|
|
318
|
+
dimension: number;
|
|
319
|
+
usage: {
|
|
320
|
+
inputTokens: number;
|
|
321
|
+
totalTokens: number;
|
|
322
|
+
};
|
|
323
|
+
}>, z.ZodObject<{
|
|
324
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
325
|
+
requestId: z.ZodString;
|
|
326
|
+
error: z.ZodEffects<z.ZodObject<{
|
|
327
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
328
|
+
code: z.ZodEnum<["invalid_request", "authentication_failed", "permission_denied", "insufficient_scope", "model_not_found", "unsupported_modality", "context_length_exceeded", "request_too_large", "output_limit_exceeded", "idempotency_conflict", "insufficient_balance", "spending_limit_exceeded", "quota_exceeded", "byok_credential_invalid", "policy_violation", "commercial_permission_denied", "no_route_available", "upstream_content_filtered", "cancelled", "rate_limited", "deployment_unavailable", "provider_error", "provider_timeout", "provider_overloaded", "provider_credential_invalid", "provider_billing_refused", "service_unavailable", "internal_error"]>;
|
|
329
|
+
message: z.ZodEffects<z.ZodString, string, string>;
|
|
330
|
+
retryable: z.ZodBoolean;
|
|
331
|
+
requestId: z.ZodString;
|
|
332
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
333
|
+
param: z.ZodOptional<z.ZodString>;
|
|
334
|
+
upstreamCategory: z.ZodOptional<z.ZodEnum<["rate_limit", "quota", "timeout", "overloaded", "server_error", "content_filter", "invalid_request", "authentication", "unknown"]>>;
|
|
335
|
+
providerError: z.ZodOptional<z.ZodObject<{
|
|
336
|
+
provider: z.ZodString;
|
|
337
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
338
|
+
code: z.ZodOptional<z.ZodString>;
|
|
339
|
+
message: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
340
|
+
}, "strict", z.ZodTypeAny, {
|
|
341
|
+
provider: string;
|
|
342
|
+
code?: string | undefined;
|
|
343
|
+
message?: string | undefined;
|
|
344
|
+
status?: number | undefined;
|
|
345
|
+
}, {
|
|
346
|
+
provider: string;
|
|
347
|
+
code?: string | undefined;
|
|
348
|
+
message?: string | undefined;
|
|
349
|
+
status?: number | undefined;
|
|
350
|
+
}>>;
|
|
351
|
+
}, "strip", z.ZodTypeAny, {
|
|
352
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
353
|
+
message: string;
|
|
354
|
+
schemaVersion: 1;
|
|
355
|
+
requestId: string;
|
|
356
|
+
retryable: boolean;
|
|
357
|
+
retryAfterMs?: number | undefined;
|
|
358
|
+
param?: string | undefined;
|
|
359
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
360
|
+
providerError?: {
|
|
361
|
+
provider: string;
|
|
362
|
+
code?: string | undefined;
|
|
363
|
+
message?: string | undefined;
|
|
364
|
+
status?: number | undefined;
|
|
365
|
+
} | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
368
|
+
message: string;
|
|
369
|
+
schemaVersion: 1;
|
|
370
|
+
requestId: string;
|
|
371
|
+
retryable: boolean;
|
|
372
|
+
retryAfterMs?: number | undefined;
|
|
373
|
+
param?: string | undefined;
|
|
374
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
375
|
+
providerError?: {
|
|
376
|
+
provider: string;
|
|
377
|
+
code?: string | undefined;
|
|
378
|
+
message?: string | undefined;
|
|
379
|
+
status?: number | undefined;
|
|
380
|
+
} | undefined;
|
|
381
|
+
}>, {
|
|
382
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
383
|
+
message: string;
|
|
384
|
+
schemaVersion: 1;
|
|
385
|
+
requestId: string;
|
|
386
|
+
retryable: boolean;
|
|
387
|
+
retryAfterMs?: number | undefined;
|
|
388
|
+
param?: string | undefined;
|
|
389
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
390
|
+
providerError?: {
|
|
391
|
+
provider: string;
|
|
392
|
+
code?: string | undefined;
|
|
393
|
+
message?: string | undefined;
|
|
394
|
+
status?: number | undefined;
|
|
395
|
+
} | undefined;
|
|
396
|
+
}, {
|
|
397
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
398
|
+
message: string;
|
|
399
|
+
schemaVersion: 1;
|
|
400
|
+
requestId: string;
|
|
401
|
+
retryable: boolean;
|
|
402
|
+
retryAfterMs?: number | undefined;
|
|
403
|
+
param?: string | undefined;
|
|
404
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
405
|
+
providerError?: {
|
|
406
|
+
provider: string;
|
|
407
|
+
code?: string | undefined;
|
|
408
|
+
message?: string | undefined;
|
|
409
|
+
status?: number | undefined;
|
|
410
|
+
} | undefined;
|
|
411
|
+
}>;
|
|
412
|
+
}, "strict", z.ZodTypeAny, {
|
|
413
|
+
schemaVersion: 1;
|
|
414
|
+
requestId: string;
|
|
415
|
+
error: {
|
|
416
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
417
|
+
message: string;
|
|
418
|
+
schemaVersion: 1;
|
|
419
|
+
requestId: string;
|
|
420
|
+
retryable: boolean;
|
|
421
|
+
retryAfterMs?: number | undefined;
|
|
422
|
+
param?: string | undefined;
|
|
423
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
424
|
+
providerError?: {
|
|
425
|
+
provider: string;
|
|
426
|
+
code?: string | undefined;
|
|
427
|
+
message?: string | undefined;
|
|
428
|
+
status?: number | undefined;
|
|
429
|
+
} | undefined;
|
|
430
|
+
};
|
|
431
|
+
}, {
|
|
432
|
+
schemaVersion: 1;
|
|
433
|
+
requestId: string;
|
|
434
|
+
error: {
|
|
435
|
+
code: "invalid_request" | "authentication_failed" | "permission_denied" | "insufficient_scope" | "model_not_found" | "unsupported_modality" | "context_length_exceeded" | "request_too_large" | "output_limit_exceeded" | "idempotency_conflict" | "insufficient_balance" | "spending_limit_exceeded" | "quota_exceeded" | "byok_credential_invalid" | "policy_violation" | "commercial_permission_denied" | "no_route_available" | "upstream_content_filtered" | "cancelled" | "rate_limited" | "deployment_unavailable" | "provider_error" | "provider_timeout" | "provider_overloaded" | "provider_credential_invalid" | "provider_billing_refused" | "service_unavailable" | "internal_error";
|
|
436
|
+
message: string;
|
|
437
|
+
schemaVersion: 1;
|
|
438
|
+
requestId: string;
|
|
439
|
+
retryable: boolean;
|
|
440
|
+
retryAfterMs?: number | undefined;
|
|
441
|
+
param?: string | undefined;
|
|
442
|
+
upstreamCategory?: "unknown" | "authentication" | "invalid_request" | "rate_limit" | "quota" | "timeout" | "overloaded" | "server_error" | "content_filter" | undefined;
|
|
443
|
+
providerError?: {
|
|
444
|
+
provider: string;
|
|
445
|
+
code?: string | undefined;
|
|
446
|
+
message?: string | undefined;
|
|
447
|
+
status?: number | undefined;
|
|
448
|
+
} | undefined;
|
|
449
|
+
};
|
|
450
|
+
}>]>;
|
|
451
|
+
export type EmbeddingVector = z.infer<typeof embeddingVectorSchema>;
|
|
452
|
+
export type EmbeddingUsage = z.infer<typeof embeddingUsageSchema>;
|
|
453
|
+
export type EmbeddingSuccess = z.infer<typeof embeddingSuccessSchema>;
|
|
454
|
+
export type EmbeddingFailure = z.infer<typeof embeddingFailureSchema>;
|
|
455
|
+
export type EmbeddingResponse = z.infer<typeof embeddingResponseSchema>;
|