@leaflow/sdk 0.200.0 → 0.200.2
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/canopy/v1/generated/models.d.ts +13 -0
- package/dist/canopy/v1/generated/validators/endpointCapabilities.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/model.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/modelCapabilities.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/modelList.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/modelListResponseBody.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/modelResource.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/videoCapabilities.zod.d.ts +5 -0
- package/dist/canopy/v1/generated/validators/videoCapabilities.zod.js +5 -0
- package/dist/canopy/v1/generated/validators/videoDurationRange.zod.d.ts +48 -0
- package/dist/canopy/v1/generated/validators/videoDurationRange.zod.js +48 -0
- package/package.json +1 -1
|
@@ -179,10 +179,23 @@ export interface AudioCapabilities {
|
|
|
179
179
|
*/
|
|
180
180
|
supports_stream: boolean | null;
|
|
181
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Accepted durations are min + n * step seconds, up to max. Independent of per-second pricing.
|
|
184
|
+
*/
|
|
185
|
+
export interface VideoDurationRange {
|
|
186
|
+
/** @minimum 1 */
|
|
187
|
+
min: number;
|
|
188
|
+
/** @minimum 1 */
|
|
189
|
+
max: number;
|
|
190
|
+
/** @minimum 1 */
|
|
191
|
+
step: number;
|
|
192
|
+
}
|
|
182
193
|
/**
|
|
183
194
|
* The video parameters this endpoint accepts. Video is asynchronous on every endpoint that supports it. Create returns a task, and the task is polled separately.
|
|
184
195
|
*/
|
|
185
196
|
export interface VideoCapabilities {
|
|
197
|
+
/** Continuous duration capability. Mutually exclusive with nonempty seconds. */
|
|
198
|
+
duration_range?: VideoDurationRange | null;
|
|
186
199
|
/**
|
|
187
200
|
* Durations the upstream accepts, in seconds. Null means unknown.
|
|
188
201
|
* @nullable
|
|
@@ -68,6 +68,11 @@ export declare const EndpointCapabilities: zod.ZodObject<{
|
|
|
68
68
|
supports_stream: zod.ZodNullable<zod.ZodBoolean>;
|
|
69
69
|
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
70
70
|
video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
71
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
72
|
+
min: zod.ZodInt;
|
|
73
|
+
max: zod.ZodInt;
|
|
74
|
+
step: zod.ZodInt;
|
|
75
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
71
76
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
72
77
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
73
78
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -94,6 +94,11 @@ export declare const Model: zod.ZodObject<{
|
|
|
94
94
|
supports_stream: zod.ZodNullable<zod.ZodBoolean>;
|
|
95
95
|
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
96
96
|
video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
97
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
98
|
+
min: zod.ZodInt;
|
|
99
|
+
max: zod.ZodInt;
|
|
100
|
+
step: zod.ZodInt;
|
|
101
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
97
102
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
98
103
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
99
104
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -68,6 +68,11 @@ export declare const ModelCapabilities: zod.ZodRecord<zod.ZodString, zod.ZodObje
|
|
|
68
68
|
supports_stream: zod.ZodNullable<zod.ZodBoolean>;
|
|
69
69
|
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
70
70
|
video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
71
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
72
|
+
min: zod.ZodInt;
|
|
73
|
+
max: zod.ZodInt;
|
|
74
|
+
step: zod.ZodInt;
|
|
75
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
71
76
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
72
77
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
73
78
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -96,6 +96,11 @@ export declare const ModelList: zod.ZodObject<{
|
|
|
96
96
|
supports_stream: zod.ZodNullable<zod.ZodBoolean>;
|
|
97
97
|
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
98
98
|
video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
99
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
100
|
+
min: zod.ZodInt;
|
|
101
|
+
max: zod.ZodInt;
|
|
102
|
+
step: zod.ZodInt;
|
|
103
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
99
104
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
100
105
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
101
106
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -119,6 +119,11 @@ export declare const ModelListResponseBody: zod.ZodObject<{
|
|
|
119
119
|
supports_stream: zod.ZodNullable<zod.ZodBoolean>;
|
|
120
120
|
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
121
121
|
video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
122
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
123
|
+
min: zod.ZodInt;
|
|
124
|
+
max: zod.ZodInt;
|
|
125
|
+
step: zod.ZodInt;
|
|
126
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
122
127
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
123
128
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
124
129
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -118,6 +118,11 @@ export declare const ModelResource: zod.ZodObject<{
|
|
|
118
118
|
supports_stream: zod.ZodNullable<zod.ZodBoolean>;
|
|
119
119
|
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
120
120
|
video: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
121
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
122
|
+
min: zod.ZodInt;
|
|
123
|
+
max: zod.ZodInt;
|
|
124
|
+
step: zod.ZodInt;
|
|
125
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
121
126
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
122
127
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
123
128
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
*/
|
|
41
41
|
import * as zod from "zod";
|
|
42
42
|
export declare const VideoCapabilities: zod.ZodObject<{
|
|
43
|
+
duration_range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
|
|
44
|
+
min: zod.ZodInt;
|
|
45
|
+
max: zod.ZodInt;
|
|
46
|
+
step: zod.ZodInt;
|
|
47
|
+
}, zod.z.core.$strict>, zod.ZodNull]>>;
|
|
43
48
|
seconds: zod.ZodNullable<zod.ZodArray<zod.ZodInt>>;
|
|
44
49
|
sizes: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
45
50
|
resolutions: zod.ZodNullable<zod.ZodArray<zod.ZodString>>;
|
|
@@ -39,8 +39,13 @@
|
|
|
39
39
|
* OpenAPI spec version: 1.0.0
|
|
40
40
|
*/
|
|
41
41
|
import * as zod from "zod";
|
|
42
|
+
import { VideoDurationRange } from "./videoDurationRange.zod.js";
|
|
42
43
|
export const VideoCapabilities = zod
|
|
43
44
|
.strictObject({
|
|
45
|
+
duration_range: zod
|
|
46
|
+
.union([VideoDurationRange, zod.null()])
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("Continuous duration capability. Mutually exclusive with nonempty seconds."),
|
|
44
49
|
seconds: zod
|
|
45
50
|
.array(zod.int().min(1))
|
|
46
51
|
.nullable()
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Canopy API
|
|
5
|
+
* Canopy model inference, API keys, model catalogue, service enablement and recorded usage.
|
|
6
|
+
*
|
|
7
|
+
* Project inference is served on this host in each provider's own protocol:
|
|
8
|
+
*
|
|
9
|
+
* - OpenAI: `/v1/chat/completions`, `/v1/responses` and `/v1/embeddings`; use
|
|
10
|
+
* `https://canopy.leaflow.cloud/v1` as the OpenAI SDK base URL.
|
|
11
|
+
* - Anthropic: `/v1/messages`; use `https://canopy.leaflow.cloud` as the Anthropic SDK base URL.
|
|
12
|
+
* - Gemini: `/v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
|
|
13
|
+
*
|
|
14
|
+
* Canopy does not convert between protocols. A request is accepted only for a model whose
|
|
15
|
+
* `supported_endpoints` lists the endpoint it was sent to, and it is forwarded unchanged except for
|
|
16
|
+
* the model name and the credentials. Reasoning settings such as `reasoning_effort` are passed
|
|
17
|
+
* through as written; a model's `capabilities` lists the values its upstream accepts.
|
|
18
|
+
*
|
|
19
|
+
* Management operations use `/api/v1`. The management model catalogue names how each model is billed in Billing;
|
|
20
|
+
* `/v1/models` returns the OpenAI model format with Canopy capabilities and parameter limits.
|
|
21
|
+
*
|
|
22
|
+
* ## Authentication
|
|
23
|
+
*
|
|
24
|
+
* Every request carries a scoped token; see the `bearerAuth` security scheme.
|
|
25
|
+
*
|
|
26
|
+
* Management and project inference accept the same verified IAM scoped token. The token is the
|
|
27
|
+
* sole billing project authority; `OpenAI-Project` and historical identity headers cannot
|
|
28
|
+
* override it. These endpoints do not accept a Canopy API key. The separate API-key gateway
|
|
29
|
+
* accepts Canopy API keys and serves the same endpoints.
|
|
30
|
+
*
|
|
31
|
+
* ## Conventions
|
|
32
|
+
*
|
|
33
|
+
* - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
|
|
34
|
+
* - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
|
|
35
|
+
* - **A usage query must carry a time range**, spanning no more than 31 days, or 400 days for the usage timeline. `from` and `to` carry a timezone offset, which the server does not infer.
|
|
36
|
+
* - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
|
|
37
|
+
* - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
|
|
38
|
+
* - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates Billing holds for each model's `billing`.
|
|
39
|
+
* OpenAPI spec version: 1.0.0
|
|
40
|
+
*/
|
|
41
|
+
import * as zod from "zod";
|
|
42
|
+
export declare const VideoDurationRange: zod.ZodObject<{
|
|
43
|
+
min: zod.ZodInt;
|
|
44
|
+
max: zod.ZodInt;
|
|
45
|
+
step: zod.ZodInt;
|
|
46
|
+
}, zod.z.core.$strict>;
|
|
47
|
+
export type VideoDurationRange = zod.input<typeof VideoDurationRange>;
|
|
48
|
+
export type VideoDurationRangeOutput = zod.output<typeof VideoDurationRange>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Canopy API
|
|
5
|
+
* Canopy model inference, API keys, model catalogue, service enablement and recorded usage.
|
|
6
|
+
*
|
|
7
|
+
* Project inference is served on this host in each provider's own protocol:
|
|
8
|
+
*
|
|
9
|
+
* - OpenAI: `/v1/chat/completions`, `/v1/responses` and `/v1/embeddings`; use
|
|
10
|
+
* `https://canopy.leaflow.cloud/v1` as the OpenAI SDK base URL.
|
|
11
|
+
* - Anthropic: `/v1/messages`; use `https://canopy.leaflow.cloud` as the Anthropic SDK base URL.
|
|
12
|
+
* - Gemini: `/v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
|
|
13
|
+
*
|
|
14
|
+
* Canopy does not convert between protocols. A request is accepted only for a model whose
|
|
15
|
+
* `supported_endpoints` lists the endpoint it was sent to, and it is forwarded unchanged except for
|
|
16
|
+
* the model name and the credentials. Reasoning settings such as `reasoning_effort` are passed
|
|
17
|
+
* through as written; a model's `capabilities` lists the values its upstream accepts.
|
|
18
|
+
*
|
|
19
|
+
* Management operations use `/api/v1`. The management model catalogue names how each model is billed in Billing;
|
|
20
|
+
* `/v1/models` returns the OpenAI model format with Canopy capabilities and parameter limits.
|
|
21
|
+
*
|
|
22
|
+
* ## Authentication
|
|
23
|
+
*
|
|
24
|
+
* Every request carries a scoped token; see the `bearerAuth` security scheme.
|
|
25
|
+
*
|
|
26
|
+
* Management and project inference accept the same verified IAM scoped token. The token is the
|
|
27
|
+
* sole billing project authority; `OpenAI-Project` and historical identity headers cannot
|
|
28
|
+
* override it. These endpoints do not accept a Canopy API key. The separate API-key gateway
|
|
29
|
+
* accepts Canopy API keys and serves the same endpoints.
|
|
30
|
+
*
|
|
31
|
+
* ## Conventions
|
|
32
|
+
*
|
|
33
|
+
* - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
|
|
34
|
+
* - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
|
|
35
|
+
* - **A usage query must carry a time range**, spanning no more than 31 days, or 400 days for the usage timeline. `from` and `to` carry a timezone offset, which the server does not infer.
|
|
36
|
+
* - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
|
|
37
|
+
* - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
|
|
38
|
+
* - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates Billing holds for each model's `billing`.
|
|
39
|
+
* OpenAPI spec version: 1.0.0
|
|
40
|
+
*/
|
|
41
|
+
import * as zod from "zod";
|
|
42
|
+
export const VideoDurationRange = zod
|
|
43
|
+
.strictObject({
|
|
44
|
+
min: zod.int().min(1),
|
|
45
|
+
max: zod.int().min(1),
|
|
46
|
+
step: zod.int().min(1),
|
|
47
|
+
})
|
|
48
|
+
.describe("Accepted durations are min + n * step seconds, up to max. Independent of per-second pricing.");
|