@b3os/sdk 0.2.1 → 0.2.3
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/README.md +1 -1
- package/dist/cjs/core/util.d.ts +1 -1
- package/dist/cjs/core/util.js +1 -1
- package/dist/cjs/generated/client.d.ts +18 -0
- package/dist/cjs/generated/client.js +34 -0
- package/dist/cjs/generated/client.js.map +1 -1
- package/dist/cjs/generated/errors.d.ts +1 -1
- package/dist/cjs/generated/errors.js +120 -0
- package/dist/cjs/generated/errors.js.map +1 -1
- package/dist/cjs/generated/ids.d.ts +89 -0
- package/dist/cjs/generated/ids.js +22 -0
- package/dist/cjs/generated/ids.js.map +1 -1
- package/dist/cjs/generated/jobs.js +4 -0
- package/dist/cjs/generated/jobs.js.map +1 -1
- package/dist/cjs/generated/ns/actions.d.ts +267 -33
- package/dist/cjs/generated/ns/actions.js +375 -33
- package/dist/cjs/generated/ns/actions.js.map +1 -1
- package/dist/cjs/generated/ns/agents.d.ts +656 -0
- package/dist/cjs/generated/ns/agents.js +989 -0
- package/dist/cjs/generated/ns/agents.js.map +1 -0
- package/dist/cjs/generated/ns/images.d.ts +162 -0
- package/dist/cjs/generated/ns/images.js +246 -0
- package/dist/cjs/generated/ns/images.js.map +1 -0
- package/dist/cjs/generated/ns/infer.d.ts +71 -3
- package/dist/cjs/generated/ns/infer.js +98 -3
- package/dist/cjs/generated/ns/infer.js.map +1 -1
- package/dist/cjs/generated/ns/keys.d.ts +3 -1
- package/dist/cjs/generated/ns/keys.js +3 -1
- package/dist/cjs/generated/ns/keys.js.map +1 -1
- package/dist/cjs/generated/ns/listeners.d.ts +163 -0
- package/dist/cjs/generated/ns/listeners.js +268 -0
- package/dist/cjs/generated/ns/listeners.js.map +1 -0
- package/dist/cjs/generated/ns/orgs.d.ts +10 -0
- package/dist/cjs/generated/ns/orgs.js +26 -1
- package/dist/cjs/generated/ns/orgs.js.map +1 -1
- package/dist/cjs/generated/ns/projects.d.ts +32 -0
- package/dist/cjs/generated/ns/projects.js +66 -0
- package/dist/cjs/generated/ns/projects.js.map +1 -1
- package/dist/cjs/generated/ns/render.d.ts +192 -21
- package/dist/cjs/generated/ns/render.js +267 -24
- package/dist/cjs/generated/ns/render.js.map +1 -1
- package/dist/cjs/generated/ns/requests.d.ts +3 -1
- package/dist/cjs/generated/ns/requests.js +3 -1
- package/dist/cjs/generated/ns/requests.js.map +1 -1
- package/dist/cjs/generated/ns/routines.d.ts +22 -4
- package/dist/cjs/generated/ns/routines.js +22 -4
- package/dist/cjs/generated/ns/routines.js.map +1 -1
- package/dist/cjs/generated/ns/sandboxes.d.ts +431 -7
- package/dist/cjs/generated/ns/sandboxes.js +633 -6
- package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
- package/dist/cjs/generated/ns/usage.d.ts +1 -1
- package/dist/cjs/generated/ns/usage.js +1 -1
- package/dist/cjs/generated/ns/vision.d.ts +113 -17
- package/dist/cjs/generated/ns/vision.js +152 -21
- package/dist/cjs/generated/ns/vision.js.map +1 -1
- package/dist/cjs/generated/ns/workspaces.d.ts +225 -0
- package/dist/cjs/generated/ns/workspaces.js +410 -0
- package/dist/cjs/generated/ns/workspaces.js.map +1 -0
- package/dist/cjs/generated/types.d.ts +5259 -605
- package/dist/cjs/helpers/sandboxes.d.ts +20 -1
- package/dist/cjs/helpers/sandboxes.js +13 -1
- package/dist/cjs/helpers/sandboxes.js.map +1 -1
- package/dist/esm/core/util.d.ts +1 -1
- package/dist/esm/core/util.js +1 -1
- package/dist/esm/generated/client.d.ts +18 -0
- package/dist/esm/generated/client.js +34 -0
- package/dist/esm/generated/client.js.map +1 -1
- package/dist/esm/generated/errors.d.ts +1 -1
- package/dist/esm/generated/errors.js +120 -0
- package/dist/esm/generated/errors.js.map +1 -1
- package/dist/esm/generated/ids.d.ts +89 -0
- package/dist/esm/generated/ids.js +22 -0
- package/dist/esm/generated/ids.js.map +1 -1
- package/dist/esm/generated/jobs.js +4 -0
- package/dist/esm/generated/jobs.js.map +1 -1
- package/dist/esm/generated/ns/actions.d.ts +267 -33
- package/dist/esm/generated/ns/actions.js +375 -33
- package/dist/esm/generated/ns/actions.js.map +1 -1
- package/dist/esm/generated/ns/agents.d.ts +656 -0
- package/dist/esm/generated/ns/agents.js +985 -0
- package/dist/esm/generated/ns/agents.js.map +1 -0
- package/dist/esm/generated/ns/images.d.ts +162 -0
- package/dist/esm/generated/ns/images.js +242 -0
- package/dist/esm/generated/ns/images.js.map +1 -0
- package/dist/esm/generated/ns/infer.d.ts +71 -3
- package/dist/esm/generated/ns/infer.js +98 -3
- package/dist/esm/generated/ns/infer.js.map +1 -1
- package/dist/esm/generated/ns/keys.d.ts +3 -1
- package/dist/esm/generated/ns/keys.js +3 -1
- package/dist/esm/generated/ns/keys.js.map +1 -1
- package/dist/esm/generated/ns/listeners.d.ts +163 -0
- package/dist/esm/generated/ns/listeners.js +264 -0
- package/dist/esm/generated/ns/listeners.js.map +1 -0
- package/dist/esm/generated/ns/orgs.d.ts +10 -0
- package/dist/esm/generated/ns/orgs.js +26 -1
- package/dist/esm/generated/ns/orgs.js.map +1 -1
- package/dist/esm/generated/ns/projects.d.ts +32 -0
- package/dist/esm/generated/ns/projects.js +66 -0
- package/dist/esm/generated/ns/projects.js.map +1 -1
- package/dist/esm/generated/ns/render.d.ts +192 -21
- package/dist/esm/generated/ns/render.js +267 -24
- package/dist/esm/generated/ns/render.js.map +1 -1
- package/dist/esm/generated/ns/requests.d.ts +3 -1
- package/dist/esm/generated/ns/requests.js +3 -1
- package/dist/esm/generated/ns/requests.js.map +1 -1
- package/dist/esm/generated/ns/routines.d.ts +22 -4
- package/dist/esm/generated/ns/routines.js +22 -4
- package/dist/esm/generated/ns/routines.js.map +1 -1
- package/dist/esm/generated/ns/sandboxes.d.ts +431 -7
- package/dist/esm/generated/ns/sandboxes.js +633 -6
- package/dist/esm/generated/ns/sandboxes.js.map +1 -1
- package/dist/esm/generated/ns/usage.d.ts +1 -1
- package/dist/esm/generated/ns/usage.js +1 -1
- package/dist/esm/generated/ns/vision.d.ts +113 -17
- package/dist/esm/generated/ns/vision.js +152 -21
- package/dist/esm/generated/ns/vision.js.map +1 -1
- package/dist/esm/generated/ns/workspaces.d.ts +225 -0
- package/dist/esm/generated/ns/workspaces.js +406 -0
- package/dist/esm/generated/ns/workspaces.js.map +1 -0
- package/dist/esm/generated/types.d.ts +5259 -605
- package/dist/esm/helpers/sandboxes.d.ts +20 -1
- package/dist/esm/helpers/sandboxes.js +13 -1
- package/dist/esm/helpers/sandboxes.js.map +1 -1
- package/package.json +1 -1
- package/src/core/util.ts +1 -1
- package/src/generated/client.ts +38 -0
- package/src/generated/errors.ts +240 -0
- package/src/generated/ids.ts +22 -0
- package/src/generated/jobs.ts +4 -0
- package/src/generated/ns/actions.ts +403 -33
- package/src/generated/ns/agents.ts +1102 -0
- package/src/generated/ns/images.ts +256 -0
- package/src/generated/ns/infer.ts +100 -3
- package/src/generated/ns/keys.ts +3 -1
- package/src/generated/ns/listeners.ts +300 -0
- package/src/generated/ns/orgs.ts +27 -1
- package/src/generated/ns/projects.ts +74 -0
- package/src/generated/ns/render.ts +277 -24
- package/src/generated/ns/requests.ts +3 -1
- package/src/generated/ns/routines.ts +22 -4
- package/src/generated/ns/sandboxes.ts +694 -7
- package/src/generated/ns/usage.ts +1 -1
- package/src/generated/ns/vision.ts +159 -21
- package/src/generated/ns/workspaces.ts +448 -0
- package/src/generated/types.ts +5684 -601
- package/src/helpers/sandboxes.ts +31 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../../../src/generated/ns/agents.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGvE,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,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAChC,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { BinaryInput, RequestOptions } from "../../core/client.ts";
|
|
2
|
+
import { Namespace } from "../../core/namespace.ts";
|
|
3
|
+
import type { Op } from "../../core/op.ts";
|
|
4
|
+
import type { APIPromise } from "../../core/promise.ts";
|
|
5
|
+
import type * as T from "../types.ts";
|
|
6
|
+
/** Descriptors of every images operation, keyed by method name (for tooling and custom clients). */
|
|
7
|
+
export declare const imagesOps: {
|
|
8
|
+
readonly listImages: Op;
|
|
9
|
+
readonly importImage: Op;
|
|
10
|
+
readonly getContext: Op;
|
|
11
|
+
readonly putContext: Op;
|
|
12
|
+
readonly deleteImage: Op;
|
|
13
|
+
readonly getImage: Op;
|
|
14
|
+
readonly getImageLogs: Op;
|
|
15
|
+
readonly releaseImage: Op;
|
|
16
|
+
};
|
|
17
|
+
/** Public OCI images imported as templates for your project's sandboxes (`/v1/images`). */
|
|
18
|
+
export declare class ImagesAPI extends Namespace {
|
|
19
|
+
/**
|
|
20
|
+
* List images
|
|
21
|
+
*
|
|
22
|
+
* Lists this project's images, newest first, in every status (an `evicted` or `failed` image stays listed
|
|
23
|
+
* until it is deleted). Other projects' images are never listed.
|
|
24
|
+
*
|
|
25
|
+
* `GET /v1/images` · scope `sandboxes:read` · served by the node
|
|
26
|
+
*/
|
|
27
|
+
listImages(options?: RequestOptions): APIPromise<T.ImageList>;
|
|
28
|
+
/**
|
|
29
|
+
* Import an image
|
|
30
|
+
*
|
|
31
|
+
* Imports a public OCI image, or builds one from a Dockerfile (`build`, with the `images.build` flag), as a
|
|
32
|
+
* template for this project's sandboxes. A build skips the resolve: it is queued, then `building` in a microVM
|
|
33
|
+
* of its own, and from the unpacking on it goes as an import does. The reference is resolved before the
|
|
34
|
+
* answer (a tag to its digest with one manifest `HEAD`), so the answer names the exact image: `202` with a new
|
|
35
|
+
* image (`status: queued`), or `200` with the project's existing image when one with the same key exists,
|
|
36
|
+
* ready or still importing. The key covers the project, the image's digest, the warm-up, the size and the
|
|
37
|
+
* node's own build inputs (guest agent, kernel, the unpacker), so the same request after a node release can be
|
|
38
|
+
* a new image. Watch it with `GET /v1/images/{image_id}?wait=30` until `ready` (or `failed`), then create
|
|
39
|
+
* sandboxes with `POST /v1/sandboxes {"image": "img_…"}`.
|
|
40
|
+
*
|
|
41
|
+
* The import runs whether or not the client stays connected. It holds `images.rootfs_max` of your
|
|
42
|
+
* organization's snapshot storage while it runs and then counts as one snapshot, its root file system plus its
|
|
43
|
+
* warm snapshot's memory, against `sandboxes.snapshots_max` and `sandboxes.snapshot_storage_max`. An
|
|
44
|
+
* organization runs one import at a time and a node two; more wait in the queue (`queued`). The CPU the import
|
|
45
|
+
* uses (the unpacking microVM and the warm-up boot) is recorded as `images.import_vcpu_ms`.
|
|
46
|
+
*
|
|
47
|
+
* `warmup.commands` run in order, each as an argument list (no shell unless you name one), as root, with no
|
|
48
|
+
* network, at most 300 seconds in all; what they read is in the page cache of every sandbox restored from the
|
|
49
|
+
* snapshot. The image's `USER`, `ENV` and `WORKDIR` apply to every command your sandboxes run. Clones of one
|
|
50
|
+
* warm snapshot share the in-process random state of anything the warm-up left running, within your project
|
|
51
|
+
* only; the kernel's random pool is reseeded for each.
|
|
52
|
+
*
|
|
53
|
+
* `size` (`vcpu`, `memory_mib`) is fixed at import: every sandbox from the image has it, and a create that asks
|
|
54
|
+
* for another size answers `400 invalid_request`.
|
|
55
|
+
*
|
|
56
|
+
* A private image (`images.build`) names a registry connection in `auth` (see `ImageRegistryAuth`); using it
|
|
57
|
+
* also needs `vault:run`. A connection of another project, or one this credential may not use, answers `404
|
|
58
|
+
* connection_not_found`; one that is not a registry connection for the image's registry, `422
|
|
59
|
+
* image_auth_invalid`; a credential the registry's token service refuses, `422 image_refused` with `reason:
|
|
60
|
+
* credentials`. While the flag is off, `auth` answers `400 invalid_request`. Without the flag on for your organization the answer is
|
|
61
|
+
* `404 feature_not_enabled`; without an image store on the node, a full store or the node's disk under its
|
|
62
|
+
* floor, `503 capacity_unavailable`.
|
|
63
|
+
*
|
|
64
|
+
* A `failed` image whose warm snapshot could not be rebuilt (`error.stage: rebuild`) keeps its root file
|
|
65
|
+
* system, and the node tries it again at its next start. The same request imports it again under its ID and
|
|
66
|
+
* replaces that file system, except while a running or paused sandbox, or a snapshot taken from one, uses the
|
|
67
|
+
* image's template: then the answer is `409 image_in_use`.
|
|
68
|
+
*
|
|
69
|
+
* `name` (with the `images.build` flag; without it the answer is `404 feature_not_enabled`) gives the image a
|
|
70
|
+
* name in this project, which a create resolves inside the project only: `POST /v1/sandboxes {"template":
|
|
71
|
+
* "py:3.11"}`. A name is unique among the project's images (`409 image_name_taken` while another image, of any
|
|
72
|
+
* status, has it; delete that one first) and is never a node template's (`422 image_name_reserved` for `base`,
|
|
73
|
+
* `base:v1` and the like). The name is part of the key: the same image under another name, or without one, is
|
|
74
|
+
* another image.
|
|
75
|
+
*
|
|
76
|
+
* `app` (with the `images.build` flag) asks for the image on behalf of an application, the `name` of its
|
|
77
|
+
* b3os.yaml: `b3os apply` sends it for `build.image` and `build.dockerfile`. The application then holds the
|
|
78
|
+
* image (`held_by`), new or existing: the same request from two applications is one image with two holds. An
|
|
79
|
+
* image asked for without `app`, even once, is `kept`: it stays until you delete it, as every image did before
|
|
80
|
+
* holds. An image that is not kept goes once no application holds it and no running, paused or hibernated
|
|
81
|
+
* sandbox and no snapshot uses its template. An application's hold ends when `b3os app down` releases it
|
|
82
|
+
* (`POST /v1/images/{image_id}/release`), or by itself once none of the application's sandboxes (running, or
|
|
83
|
+
* stopped and still listed, for 7 days) runs from the image and the application has not asked for it for
|
|
84
|
+
* `[images] hold_h` (7 days): a rollback can start every generation still listed from its image. When an
|
|
85
|
+
* import does not fit the node's image store, images that are not kept, that no sandbox or snapshot uses and
|
|
86
|
+
* that no application asked for in the last hour go first, least recently used first; a rollback to one of
|
|
87
|
+
* them imports it again by digest, or builds it again from its commit.
|
|
88
|
+
*
|
|
89
|
+
* `POST /v1/images` · scope `sandboxes:write` · served by the node
|
|
90
|
+
*/
|
|
91
|
+
importImage(body: T.ImageImportRequest, options?: RequestOptions): APIPromise<T.Image>;
|
|
92
|
+
/**
|
|
93
|
+
* Check a build context tar
|
|
94
|
+
*
|
|
95
|
+
* This project's tar with this sha256 and when it expires, or `404 image_context_not_found` when it was never uploaded or has expired. A client checks before it uploads.
|
|
96
|
+
*
|
|
97
|
+
* `GET /v1/images/contexts/{sha256}` · scope `sandboxes:read` · served by the node
|
|
98
|
+
*/
|
|
99
|
+
getContext(sha256: string, options?: RequestOptions): APIPromise<T.ImageContext>;
|
|
100
|
+
/**
|
|
101
|
+
* Upload a build context tar
|
|
102
|
+
*
|
|
103
|
+
* Stores the body, a tar (plain or gzip), as a build context of this project under its sha256, for
|
|
104
|
+
* `POST /v1/images {"build": {"context": [{"sha256": "…"}]}}`. The body's sha256 must be the one in the path
|
|
105
|
+
* (`400` otherwise). A tar is at most 100 MiB: split a larger context into more tars (they are unpacked in
|
|
106
|
+
* order, each at its `at`). It is kept 24 hours after its last upload or the last build that named it, and
|
|
107
|
+
* only this project can use it. Your organization's stored tars count against `images.contexts_bytes`
|
|
108
|
+
* (`422 limit_exceeded`). The node never unpacks a tar: only the build microVM does. Uploading the same tar
|
|
109
|
+
* again answers `200` and keeps it another 24 hours.
|
|
110
|
+
*
|
|
111
|
+
* `PUT /v1/images/contexts/{sha256}` · scope `sandboxes:write` · served by the node
|
|
112
|
+
*/
|
|
113
|
+
putContext(sha256: string, data: BinaryInput, options?: RequestOptions): APIPromise<T.ImageContext>;
|
|
114
|
+
/**
|
|
115
|
+
* Delete an image
|
|
116
|
+
*
|
|
117
|
+
* Deletes the image, its template, its warm snapshot and its root file system. An import in progress is
|
|
118
|
+
* cancelled and leaves nothing behind. While a running or paused sandbox, or a snapshot taken from one, uses
|
|
119
|
+
* the image's template the answer is `409 image_in_use`.
|
|
120
|
+
*
|
|
121
|
+
* `DELETE /v1/images/{image_id}` · scope `sandboxes:write` · served by the node
|
|
122
|
+
*/
|
|
123
|
+
deleteImage(imageId: string, options?: RequestOptions): APIPromise<T.Deleted>;
|
|
124
|
+
/**
|
|
125
|
+
* Get an image
|
|
126
|
+
*
|
|
127
|
+
* Returns one of this project's images. With `wait` (seconds, at most 30) the answer is held until the image is
|
|
128
|
+
* `ready`, `failed` or `evicted`, or the time passes, whichever is first; it then returns the image as it is.
|
|
129
|
+
* `stages_ms` times each stage the import has finished; `error` says why a `failed` image failed, with the
|
|
130
|
+
* last 4 KiB of output.
|
|
131
|
+
*
|
|
132
|
+
* `GET /v1/images/{image_id}` · scope `sandboxes:read` · served by the node
|
|
133
|
+
*/
|
|
134
|
+
getImage(imageId: string, params?: T.ImagesGetImageParams, options?: RequestOptions): APIPromise<T.Image>;
|
|
135
|
+
/**
|
|
136
|
+
* Read an image's build log
|
|
137
|
+
*
|
|
138
|
+
* The build log of one of this project's images (a Dockerfile build's output, its last 1 MiB), as lines from
|
|
139
|
+
* `offset` (0 is the first), at most 1,000 per answer. `next_offset` is where the next read starts. The log is
|
|
140
|
+
* kept when the build microVM ends, so a build still running has no lines yet, and an import has none. With
|
|
141
|
+
* `wait` (seconds, at most 30) the answer is held until there are lines past `offset` or the image is `ready`,
|
|
142
|
+
* `failed` or `evicted`, whichever is first. To follow a build, read again from `next_offset` until `status`
|
|
143
|
+
* is one of those and no lines come.
|
|
144
|
+
*
|
|
145
|
+
* `GET /v1/images/{image_id}/logs` · scope `sandboxes:read` · served by the node
|
|
146
|
+
*/
|
|
147
|
+
getImageLogs(imageId: string, params?: T.ImagesGetImageLogsParams, options?: RequestOptions): APIPromise<T.ImageLog>;
|
|
148
|
+
/**
|
|
149
|
+
* Release an application's hold on an image
|
|
150
|
+
*
|
|
151
|
+
* Ends `app`'s hold on the image (`held_by`), as `b3os app down` does for each image the application holds. The
|
|
152
|
+
* image is then removed now, as `DELETE /v1/images/{image_id}` removes it, when it is not `kept`, no other
|
|
153
|
+
* application holds it and no running, paused or hibernated sandbox and no snapshot uses its template
|
|
154
|
+
* (`removed: true`). Otherwise it stays, and the answer says why: `held_by`, `kept` or `in_use`. An image that
|
|
155
|
+
* stays only because something uses it goes once nothing does. Releasing a hold the application does not have
|
|
156
|
+
* changes nothing. An import still in progress for another holder answers `409 conflict`; release it once it
|
|
157
|
+
* is ready or failed.
|
|
158
|
+
*
|
|
159
|
+
* `POST /v1/images/{image_id}/release` · scope `sandboxes:write` · served by the node
|
|
160
|
+
*/
|
|
161
|
+
releaseImage(imageId: string, body: T.ImageReleaseRequest, options?: RequestOptions): APIPromise<T.ImageRelease>;
|
|
162
|
+
}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
// Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
|
|
2
|
+
import { Namespace } from "../../core/namespace.js";
|
|
3
|
+
const listImagesOp = {
|
|
4
|
+
id: "imagesListImages",
|
|
5
|
+
method: "GET",
|
|
6
|
+
path: "/v1/images",
|
|
7
|
+
timeoutMs: 10000,
|
|
8
|
+
scope: "sandboxes:read",
|
|
9
|
+
};
|
|
10
|
+
const importImageOp = {
|
|
11
|
+
id: "imagesImportImage",
|
|
12
|
+
method: "POST",
|
|
13
|
+
path: "/v1/images",
|
|
14
|
+
body: "json",
|
|
15
|
+
timeoutMs: 30000,
|
|
16
|
+
scope: "sandboxes:write",
|
|
17
|
+
};
|
|
18
|
+
const getContextOp = {
|
|
19
|
+
id: "imagesGetContext",
|
|
20
|
+
method: "GET",
|
|
21
|
+
path: "/v1/images/contexts/{sha256}",
|
|
22
|
+
params: ["sha256"],
|
|
23
|
+
timeoutMs: 10000,
|
|
24
|
+
scope: "sandboxes:read",
|
|
25
|
+
};
|
|
26
|
+
const putContextOp = {
|
|
27
|
+
id: "imagesPutContext",
|
|
28
|
+
method: "PUT",
|
|
29
|
+
path: "/v1/images/contexts/{sha256}",
|
|
30
|
+
params: ["sha256"],
|
|
31
|
+
body: "bytes",
|
|
32
|
+
contentType: "application/octet-stream",
|
|
33
|
+
timeoutMs: 60000,
|
|
34
|
+
scope: "sandboxes:write",
|
|
35
|
+
};
|
|
36
|
+
const deleteImageOp = {
|
|
37
|
+
id: "imagesDeleteImage",
|
|
38
|
+
method: "DELETE",
|
|
39
|
+
path: "/v1/images/{image_id}",
|
|
40
|
+
params: ["image_id"],
|
|
41
|
+
timeoutMs: 30000,
|
|
42
|
+
scope: "sandboxes:write",
|
|
43
|
+
};
|
|
44
|
+
const getImageOp = {
|
|
45
|
+
id: "imagesGetImage",
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "/v1/images/{image_id}",
|
|
48
|
+
params: ["image_id"],
|
|
49
|
+
timeoutMs: 35000,
|
|
50
|
+
scope: "sandboxes:read",
|
|
51
|
+
};
|
|
52
|
+
const getImageLogsOp = {
|
|
53
|
+
id: "imagesGetImageLogs",
|
|
54
|
+
method: "GET",
|
|
55
|
+
path: "/v1/images/{image_id}/logs",
|
|
56
|
+
params: ["image_id"],
|
|
57
|
+
timeoutMs: 35000,
|
|
58
|
+
scope: "sandboxes:read",
|
|
59
|
+
};
|
|
60
|
+
const releaseImageOp = {
|
|
61
|
+
id: "imagesReleaseImage",
|
|
62
|
+
method: "POST",
|
|
63
|
+
path: "/v1/images/{image_id}/release",
|
|
64
|
+
params: ["image_id"],
|
|
65
|
+
body: "json",
|
|
66
|
+
timeoutMs: 30000,
|
|
67
|
+
scope: "sandboxes:write",
|
|
68
|
+
};
|
|
69
|
+
/** Descriptors of every images operation, keyed by method name (for tooling and custom clients). */
|
|
70
|
+
export const imagesOps = {
|
|
71
|
+
listImages: listImagesOp,
|
|
72
|
+
importImage: importImageOp,
|
|
73
|
+
getContext: getContextOp,
|
|
74
|
+
putContext: putContextOp,
|
|
75
|
+
deleteImage: deleteImageOp,
|
|
76
|
+
getImage: getImageOp,
|
|
77
|
+
getImageLogs: getImageLogsOp,
|
|
78
|
+
releaseImage: releaseImageOp,
|
|
79
|
+
};
|
|
80
|
+
/** Public OCI images imported as templates for your project's sandboxes (`/v1/images`). */
|
|
81
|
+
export class ImagesAPI extends Namespace {
|
|
82
|
+
/**
|
|
83
|
+
* List images
|
|
84
|
+
*
|
|
85
|
+
* Lists this project's images, newest first, in every status (an `evicted` or `failed` image stays listed
|
|
86
|
+
* until it is deleted). Other projects' images are never listed.
|
|
87
|
+
*
|
|
88
|
+
* `GET /v1/images` · scope `sandboxes:read` · served by the node
|
|
89
|
+
*/
|
|
90
|
+
listImages(options) {
|
|
91
|
+
return this._client._call(listImagesOp, {}, options);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Import an image
|
|
95
|
+
*
|
|
96
|
+
* Imports a public OCI image, or builds one from a Dockerfile (`build`, with the `images.build` flag), as a
|
|
97
|
+
* template for this project's sandboxes. A build skips the resolve: it is queued, then `building` in a microVM
|
|
98
|
+
* of its own, and from the unpacking on it goes as an import does. The reference is resolved before the
|
|
99
|
+
* answer (a tag to its digest with one manifest `HEAD`), so the answer names the exact image: `202` with a new
|
|
100
|
+
* image (`status: queued`), or `200` with the project's existing image when one with the same key exists,
|
|
101
|
+
* ready or still importing. The key covers the project, the image's digest, the warm-up, the size and the
|
|
102
|
+
* node's own build inputs (guest agent, kernel, the unpacker), so the same request after a node release can be
|
|
103
|
+
* a new image. Watch it with `GET /v1/images/{image_id}?wait=30` until `ready` (or `failed`), then create
|
|
104
|
+
* sandboxes with `POST /v1/sandboxes {"image": "img_…"}`.
|
|
105
|
+
*
|
|
106
|
+
* The import runs whether or not the client stays connected. It holds `images.rootfs_max` of your
|
|
107
|
+
* organization's snapshot storage while it runs and then counts as one snapshot, its root file system plus its
|
|
108
|
+
* warm snapshot's memory, against `sandboxes.snapshots_max` and `sandboxes.snapshot_storage_max`. An
|
|
109
|
+
* organization runs one import at a time and a node two; more wait in the queue (`queued`). The CPU the import
|
|
110
|
+
* uses (the unpacking microVM and the warm-up boot) is recorded as `images.import_vcpu_ms`.
|
|
111
|
+
*
|
|
112
|
+
* `warmup.commands` run in order, each as an argument list (no shell unless you name one), as root, with no
|
|
113
|
+
* network, at most 300 seconds in all; what they read is in the page cache of every sandbox restored from the
|
|
114
|
+
* snapshot. The image's `USER`, `ENV` and `WORKDIR` apply to every command your sandboxes run. Clones of one
|
|
115
|
+
* warm snapshot share the in-process random state of anything the warm-up left running, within your project
|
|
116
|
+
* only; the kernel's random pool is reseeded for each.
|
|
117
|
+
*
|
|
118
|
+
* `size` (`vcpu`, `memory_mib`) is fixed at import: every sandbox from the image has it, and a create that asks
|
|
119
|
+
* for another size answers `400 invalid_request`.
|
|
120
|
+
*
|
|
121
|
+
* A private image (`images.build`) names a registry connection in `auth` (see `ImageRegistryAuth`); using it
|
|
122
|
+
* also needs `vault:run`. A connection of another project, or one this credential may not use, answers `404
|
|
123
|
+
* connection_not_found`; one that is not a registry connection for the image's registry, `422
|
|
124
|
+
* image_auth_invalid`; a credential the registry's token service refuses, `422 image_refused` with `reason:
|
|
125
|
+
* credentials`. While the flag is off, `auth` answers `400 invalid_request`. Without the flag on for your organization the answer is
|
|
126
|
+
* `404 feature_not_enabled`; without an image store on the node, a full store or the node's disk under its
|
|
127
|
+
* floor, `503 capacity_unavailable`.
|
|
128
|
+
*
|
|
129
|
+
* A `failed` image whose warm snapshot could not be rebuilt (`error.stage: rebuild`) keeps its root file
|
|
130
|
+
* system, and the node tries it again at its next start. The same request imports it again under its ID and
|
|
131
|
+
* replaces that file system, except while a running or paused sandbox, or a snapshot taken from one, uses the
|
|
132
|
+
* image's template: then the answer is `409 image_in_use`.
|
|
133
|
+
*
|
|
134
|
+
* `name` (with the `images.build` flag; without it the answer is `404 feature_not_enabled`) gives the image a
|
|
135
|
+
* name in this project, which a create resolves inside the project only: `POST /v1/sandboxes {"template":
|
|
136
|
+
* "py:3.11"}`. A name is unique among the project's images (`409 image_name_taken` while another image, of any
|
|
137
|
+
* status, has it; delete that one first) and is never a node template's (`422 image_name_reserved` for `base`,
|
|
138
|
+
* `base:v1` and the like). The name is part of the key: the same image under another name, or without one, is
|
|
139
|
+
* another image.
|
|
140
|
+
*
|
|
141
|
+
* `app` (with the `images.build` flag) asks for the image on behalf of an application, the `name` of its
|
|
142
|
+
* b3os.yaml: `b3os apply` sends it for `build.image` and `build.dockerfile`. The application then holds the
|
|
143
|
+
* image (`held_by`), new or existing: the same request from two applications is one image with two holds. An
|
|
144
|
+
* image asked for without `app`, even once, is `kept`: it stays until you delete it, as every image did before
|
|
145
|
+
* holds. An image that is not kept goes once no application holds it and no running, paused or hibernated
|
|
146
|
+
* sandbox and no snapshot uses its template. An application's hold ends when `b3os app down` releases it
|
|
147
|
+
* (`POST /v1/images/{image_id}/release`), or by itself once none of the application's sandboxes (running, or
|
|
148
|
+
* stopped and still listed, for 7 days) runs from the image and the application has not asked for it for
|
|
149
|
+
* `[images] hold_h` (7 days): a rollback can start every generation still listed from its image. When an
|
|
150
|
+
* import does not fit the node's image store, images that are not kept, that no sandbox or snapshot uses and
|
|
151
|
+
* that no application asked for in the last hour go first, least recently used first; a rollback to one of
|
|
152
|
+
* them imports it again by digest, or builds it again from its commit.
|
|
153
|
+
*
|
|
154
|
+
* `POST /v1/images` · scope `sandboxes:write` · served by the node
|
|
155
|
+
*/
|
|
156
|
+
importImage(body, options) {
|
|
157
|
+
return this._client._call(importImageOp, { body }, options);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Check a build context tar
|
|
161
|
+
*
|
|
162
|
+
* This project's tar with this sha256 and when it expires, or `404 image_context_not_found` when it was never uploaded or has expired. A client checks before it uploads.
|
|
163
|
+
*
|
|
164
|
+
* `GET /v1/images/contexts/{sha256}` · scope `sandboxes:read` · served by the node
|
|
165
|
+
*/
|
|
166
|
+
getContext(sha256, options) {
|
|
167
|
+
return this._client._call(getContextOp, { path: [sha256] }, options);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Upload a build context tar
|
|
171
|
+
*
|
|
172
|
+
* Stores the body, a tar (plain or gzip), as a build context of this project under its sha256, for
|
|
173
|
+
* `POST /v1/images {"build": {"context": [{"sha256": "…"}]}}`. The body's sha256 must be the one in the path
|
|
174
|
+
* (`400` otherwise). A tar is at most 100 MiB: split a larger context into more tars (they are unpacked in
|
|
175
|
+
* order, each at its `at`). It is kept 24 hours after its last upload or the last build that named it, and
|
|
176
|
+
* only this project can use it. Your organization's stored tars count against `images.contexts_bytes`
|
|
177
|
+
* (`422 limit_exceeded`). The node never unpacks a tar: only the build microVM does. Uploading the same tar
|
|
178
|
+
* again answers `200` and keeps it another 24 hours.
|
|
179
|
+
*
|
|
180
|
+
* `PUT /v1/images/contexts/{sha256}` · scope `sandboxes:write` · served by the node
|
|
181
|
+
*/
|
|
182
|
+
putContext(sha256, data, options) {
|
|
183
|
+
return this._client._call(putContextOp, { path: [sha256], body: data }, options);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Delete an image
|
|
187
|
+
*
|
|
188
|
+
* Deletes the image, its template, its warm snapshot and its root file system. An import in progress is
|
|
189
|
+
* cancelled and leaves nothing behind. While a running or paused sandbox, or a snapshot taken from one, uses
|
|
190
|
+
* the image's template the answer is `409 image_in_use`.
|
|
191
|
+
*
|
|
192
|
+
* `DELETE /v1/images/{image_id}` · scope `sandboxes:write` · served by the node
|
|
193
|
+
*/
|
|
194
|
+
deleteImage(imageId, options) {
|
|
195
|
+
return this._client._call(deleteImageOp, { path: [imageId] }, options);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get an image
|
|
199
|
+
*
|
|
200
|
+
* Returns one of this project's images. With `wait` (seconds, at most 30) the answer is held until the image is
|
|
201
|
+
* `ready`, `failed` or `evicted`, or the time passes, whichever is first; it then returns the image as it is.
|
|
202
|
+
* `stages_ms` times each stage the import has finished; `error` says why a `failed` image failed, with the
|
|
203
|
+
* last 4 KiB of output.
|
|
204
|
+
*
|
|
205
|
+
* `GET /v1/images/{image_id}` · scope `sandboxes:read` · served by the node
|
|
206
|
+
*/
|
|
207
|
+
getImage(imageId, params, options) {
|
|
208
|
+
return this._client._call(getImageOp, { path: [imageId], query: params }, options);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Read an image's build log
|
|
212
|
+
*
|
|
213
|
+
* The build log of one of this project's images (a Dockerfile build's output, its last 1 MiB), as lines from
|
|
214
|
+
* `offset` (0 is the first), at most 1,000 per answer. `next_offset` is where the next read starts. The log is
|
|
215
|
+
* kept when the build microVM ends, so a build still running has no lines yet, and an import has none. With
|
|
216
|
+
* `wait` (seconds, at most 30) the answer is held until there are lines past `offset` or the image is `ready`,
|
|
217
|
+
* `failed` or `evicted`, whichever is first. To follow a build, read again from `next_offset` until `status`
|
|
218
|
+
* is one of those and no lines come.
|
|
219
|
+
*
|
|
220
|
+
* `GET /v1/images/{image_id}/logs` · scope `sandboxes:read` · served by the node
|
|
221
|
+
*/
|
|
222
|
+
getImageLogs(imageId, params, options) {
|
|
223
|
+
return this._client._call(getImageLogsOp, { path: [imageId], query: params }, options);
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Release an application's hold on an image
|
|
227
|
+
*
|
|
228
|
+
* Ends `app`'s hold on the image (`held_by`), as `b3os app down` does for each image the application holds. The
|
|
229
|
+
* image is then removed now, as `DELETE /v1/images/{image_id}` removes it, when it is not `kept`, no other
|
|
230
|
+
* application holds it and no running, paused or hibernated sandbox and no snapshot uses its template
|
|
231
|
+
* (`removed: true`). Otherwise it stays, and the answer says why: `held_by`, `kept` or `in_use`. An image that
|
|
232
|
+
* stays only because something uses it goes once nothing does. Releasing a hold the application does not have
|
|
233
|
+
* changes nothing. An import still in progress for another holder answers `409 conflict`; release it once it
|
|
234
|
+
* is ready or failed.
|
|
235
|
+
*
|
|
236
|
+
* `POST /v1/images/{image_id}/release` · scope `sandboxes:write` · served by the node
|
|
237
|
+
*/
|
|
238
|
+
releaseImage(imageId, body, options) {
|
|
239
|
+
return this._client._call(releaseImageOp, { path: [imageId], body }, options);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../../src/generated/ns/images.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,YAAY;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,iBAAiB;CACzB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,8BAA8B;IACpC,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,YAAY,GAAO;IACvB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,8BAA8B;IACpC,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,0BAA0B;IACvC,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,iBAAiB;CACzB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,uBAAuB;IAC7B,MAAM,EAAE,CAAC,UAAU,CAAC;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,iBAAiB;CACzB,CAAC;AACF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AE,OAAwB;QACjF,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAiB,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;CACF"}
|
|
@@ -13,9 +13,11 @@ export declare const inferOps: {
|
|
|
13
13
|
readonly createEmbeddings: Op;
|
|
14
14
|
readonly listModels: Op;
|
|
15
15
|
readonly getModel: Op;
|
|
16
|
+
readonly createRerank: Op;
|
|
16
17
|
readonly createResponse: Op;
|
|
17
18
|
readonly createMessage: Op;
|
|
18
19
|
readonly countMessageTokens: Op;
|
|
20
|
+
readonly createRerankV2: Op;
|
|
19
21
|
};
|
|
20
22
|
/** Models on the node: OpenAI-compatible chat, embeddings and speech (`/v1/infer`). */
|
|
21
23
|
export declare class InferAPI extends Namespace {
|
|
@@ -137,8 +139,33 @@ export declare class InferAPI extends Namespace {
|
|
|
137
139
|
/**
|
|
138
140
|
* Create embeddings
|
|
139
141
|
*
|
|
140
|
-
* The OpenAI Embeddings API, for embedding models the node serves (`b3os.kind` is `embedding`
|
|
141
|
-
* return `404 model_not_available`; the beta node serves no embedding
|
|
142
|
+
* The OpenAI Embeddings API, for embedding models the node serves (`b3os.kind` is `embedding` in
|
|
143
|
+
* `GET /v1/infer/models`). Other models return `404 model_not_available`; the beta node serves no embedding
|
|
144
|
+
* model yet. An embedding model has no alias: name its own ID, so stored vectors always come from the model
|
|
145
|
+
* that made them.
|
|
146
|
+
*
|
|
147
|
+
* `input` is a string or 1 to 2,048 strings, none of them empty (`400 invalid_request` pointing at it). Arrays
|
|
148
|
+
* of token IDs are `400 unsupported_parameter`: the node reads text only, and token IDs from another tokenizer
|
|
149
|
+
* would give wrong vectors (LangChain's `OpenAIEmbeddings` sends them unless it is created with
|
|
150
|
+
* `check_embedding_ctx_length=False`). An input may have as many tokens as the model's `context_length`,
|
|
151
|
+
* query prompt included; a longer one is `400 context_length_exceeded` pointing at it, unless `truncate` is
|
|
152
|
+
* `end`, which cuts it at the end to fit.
|
|
153
|
+
*
|
|
154
|
+
* `encoding_format` is `float` (the default) or `base64` (little-endian float32, what the OpenAI SDKs ask for
|
|
155
|
+
* by default); both carry the same numbers. Every vector has length 1. `dimensions` shortens the vectors, from
|
|
156
|
+
* the model's `b3os.min_dimensions` to its `b3os.dimensions` values (`400 unsupported_parameter` outside it):
|
|
157
|
+
* the node cuts each vector and scales it back to length 1. `user` is accepted and ignored.
|
|
158
|
+
*
|
|
159
|
+
* B3OS extensions: `input_type: "query"` puts the model's query prompt before each input, for text you search
|
|
160
|
+
* with (`document`, the default, embeds the input as it is), and `instruction` replaces the task the prompt
|
|
161
|
+
* describes (with `input_type: "query"` only, at most 512 characters). The prompt's tokens are billed with the
|
|
162
|
+
* input. The node sends a large request to the model in parts of at most 8,192 tokens and answers in input
|
|
163
|
+
* order.
|
|
164
|
+
*
|
|
165
|
+
* Bills `infer.embed_tokens`, the tokens the model read; a request that fails is not billed. Requests are
|
|
166
|
+
* admitted against your organization's per-minute token and request limits on the model, and against 8
|
|
167
|
+
* embedding and rerank requests in flight per organization (`429 concurrency_limited`, limit
|
|
168
|
+
* `infer.pool.concurrent`). Embeddings are never kept by the model call log. No streaming.
|
|
142
169
|
*
|
|
143
170
|
* `POST /v1/infer/embeddings` · scope `infer:run` · served by the node
|
|
144
171
|
*
|
|
@@ -152,7 +179,8 @@ export declare class InferAPI extends Namespace {
|
|
|
152
179
|
* quantization, whether it supports tools, JSON Schema output and image input, the largest accepted request,
|
|
153
180
|
* and your per-model token and request limits. Chat models are listed while the node's model runtime is
|
|
154
181
|
* configured (one that is restarting is still listed; requests get `503` with `Retry-After`); speech models
|
|
155
|
-
* while the voice service answers.
|
|
182
|
+
* while the voice service answers. Embedding and rerank models, where a node serves them, are listed the same
|
|
183
|
+
* way, each with its own engine.
|
|
156
184
|
*
|
|
157
185
|
* `GET /v1/infer/models` · scope `infer:read` · served by the node
|
|
158
186
|
*/
|
|
@@ -165,6 +193,34 @@ export declare class InferAPI extends Namespace {
|
|
|
165
193
|
* `GET /v1/infer/models/{model}` · scope `infer:read` · served by the node
|
|
166
194
|
*/
|
|
167
195
|
getModel(model: string, options?: RequestOptions): APIPromise<T.Model>;
|
|
196
|
+
/**
|
|
197
|
+
* Rerank documents
|
|
198
|
+
*
|
|
199
|
+
* Ranks documents by how well they answer a query, in the shape of Cohere's v2 rerank API, for rerank models
|
|
200
|
+
* the node serves (`b3os.kind` is `rerank` in `GET /v1/infer/models`). Other models return
|
|
201
|
+
* `404 model_not_available`; the beta node serves no rerank model yet. The same operation answers at
|
|
202
|
+
* `POST /v1/infer/v2/rerank`, so Cohere's SDK works with its base URL set to
|
|
203
|
+
* `https://beta-api.b3os.org/v1/infer`.
|
|
204
|
+
*
|
|
205
|
+
* `documents` holds 1 to 1,000 strings or `{text}` objects, none of them empty. `query` may have 2,048 tokens
|
|
206
|
+
* (`400 context_length_exceeded` past it). Each document is cut at the end to `max_tokens_per_doc` tokens
|
|
207
|
+
* (default 4,096, at most 8,000), and further where the query and the document together would pass the
|
|
208
|
+
* model's `context_length`. `results` lists the `top_n` best documents (default: all of them), highest
|
|
209
|
+
* `relevance_score` (0 to 1) first, each with its `index` in `documents`; with `return_documents: true` each
|
|
210
|
+
* also carries its document as sent. B3OS extension: `instruction` replaces the task the model's query prompt
|
|
211
|
+
* describes (at most 512 characters). The node sends a large request to the model in parts of at most 8,192
|
|
212
|
+
* tokens.
|
|
213
|
+
*
|
|
214
|
+
* Bills `infer.rerank_tokens`, the tokens of every query and document pair the model read
|
|
215
|
+
* (`usage.total_tokens`, also in `meta.billed_units.input_tokens`); a request that fails is not billed. Limits
|
|
216
|
+
* as for embeddings: per-minute tokens and requests on the model, and 8 embedding and rerank requests in
|
|
217
|
+
* flight per organization. Rerank calls are never kept by the model call log. No streaming.
|
|
218
|
+
*
|
|
219
|
+
* `POST /v1/infer/rerank` · scope `infer:run` · served by the node
|
|
220
|
+
*
|
|
221
|
+
* Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
|
|
222
|
+
*/
|
|
223
|
+
createRerank(body: T.RerankRequest, options?: RequestOptions): APIPromise<T.RerankList>;
|
|
168
224
|
/**
|
|
169
225
|
* Create a response (OpenAI Responses API)
|
|
170
226
|
*
|
|
@@ -318,4 +374,16 @@ export declare class InferAPI extends Namespace {
|
|
|
318
374
|
* `POST /v1/infer/v1/messages/count_tokens` · scope `infer:run` · served by the node
|
|
319
375
|
*/
|
|
320
376
|
countMessageTokens(body: T.AnthropicCountTokensRequest, options?: RequestOptions): APIPromise<T.AnthropicCountTokens>;
|
|
377
|
+
/**
|
|
378
|
+
* Rerank documents at Cohere's path
|
|
379
|
+
*
|
|
380
|
+
* `POST /v1/infer/rerank` at the path Cohere's v2 SDK calls (`<base URL>/v2/rerank`), so
|
|
381
|
+
* `cohere.ClientV2(base_url="https://beta-api.b3os.org/v1/infer")` works unchanged. The request, the answer,
|
|
382
|
+
* the limits and the meter are those of `POST /v1/infer/rerank`.
|
|
383
|
+
*
|
|
384
|
+
* `POST /v1/infer/v2/rerank` · scope `infer:run` · served by the node
|
|
385
|
+
*
|
|
386
|
+
* Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
|
|
387
|
+
*/
|
|
388
|
+
createRerankV2(body: T.RerankRequest, options?: RequestOptions): APIPromise<T.RerankList>;
|
|
321
389
|
}
|