llama-stack-client 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +298 -0
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/_shims/auto/runtime-bun.d.ts +5 -0
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/_shims/auto/types.js +3 -0
- package/_shims/auto/types.mjs +3 -0
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +243 -0
- package/core.d.ts.map +1 -0
- package/core.js +900 -0
- package/core.js.map +1 -0
- package/core.mjs +869 -0
- package/core.mjs.map +1 -0
- package/error.d.ts +53 -0
- package/error.d.ts.map +1 -0
- package/error.js +143 -0
- package/error.js.map +1 -0
- package/error.mjs +127 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +215 -0
- package/index.d.ts +215 -0
- package/index.d.ts.map +1 -0
- package/index.js +137 -0
- package/index.js.map +1 -0
- package/index.mjs +109 -0
- package/index.mjs.map +1 -0
- package/package.json +102 -0
- package/resource.d.ts +6 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +11 -0
- package/resource.js.map +1 -0
- package/resource.mjs +7 -0
- package/resource.mjs.map +1 -0
- package/resources/agents/agents.d.ts +233 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +73 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +46 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/index.d.ts +5 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +13 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +6 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/sessions.d.ts +76 -0
- package/resources/agents/sessions.d.ts.map +1 -0
- package/resources/agents/sessions.js +52 -0
- package/resources/agents/sessions.js.map +1 -0
- package/resources/agents/sessions.mjs +48 -0
- package/resources/agents/sessions.mjs.map +1 -0
- package/resources/agents/steps.d.ts +34 -0
- package/resources/agents/steps.d.ts.map +1 -0
- package/resources/agents/steps.js +24 -0
- package/resources/agents/steps.js.map +1 -0
- package/resources/agents/steps.mjs +20 -0
- package/resources/agents/steps.mjs.map +1 -0
- package/resources/agents/turns.d.ts +133 -0
- package/resources/agents/turns.d.ts.map +1 -0
- package/resources/agents/turns.js +38 -0
- package/resources/agents/turns.js.map +1 -0
- package/resources/agents/turns.mjs +34 -0
- package/resources/agents/turns.mjs.map +1 -0
- package/resources/batch-inference.d.ts +99 -0
- package/resources/batch-inference.d.ts.map +1 -0
- package/resources/batch-inference.js +37 -0
- package/resources/batch-inference.js.map +1 -0
- package/resources/batch-inference.mjs +33 -0
- package/resources/batch-inference.mjs.map +1 -0
- package/resources/datasets.d.ts +57 -0
- package/resources/datasets.d.ts.map +1 -0
- package/resources/datasets.js +52 -0
- package/resources/datasets.js.map +1 -0
- package/resources/datasets.mjs +48 -0
- package/resources/datasets.mjs.map +1 -0
- package/resources/evaluate/evaluate.d.ts +29 -0
- package/resources/evaluate/evaluate.d.ts.map +1 -0
- package/resources/evaluate/evaluate.js +49 -0
- package/resources/evaluate/evaluate.js.map +1 -0
- package/resources/evaluate/evaluate.mjs +22 -0
- package/resources/evaluate/evaluate.mjs.map +1 -0
- package/resources/evaluate/index.d.ts +6 -0
- package/resources/evaluate/index.d.ts.map +1 -0
- package/resources/evaluate/index.js +15 -0
- package/resources/evaluate/index.js.map +1 -0
- package/resources/evaluate/index.mjs +7 -0
- package/resources/evaluate/index.mjs.map +1 -0
- package/resources/evaluate/jobs/artifacts.d.ts +22 -0
- package/resources/evaluate/jobs/artifacts.d.ts.map +1 -0
- package/resources/evaluate/jobs/artifacts.js +24 -0
- package/resources/evaluate/jobs/artifacts.js.map +1 -0
- package/resources/evaluate/jobs/artifacts.mjs +20 -0
- package/resources/evaluate/jobs/artifacts.mjs.map +1 -0
- package/resources/evaluate/jobs/index.d.ts +5 -0
- package/resources/evaluate/jobs/index.d.ts.map +1 -0
- package/resources/evaluate/jobs/index.js +13 -0
- package/resources/evaluate/jobs/index.js.map +1 -0
- package/resources/evaluate/jobs/index.mjs +6 -0
- package/resources/evaluate/jobs/index.mjs.map +1 -0
- package/resources/evaluate/jobs/jobs.d.ts +56 -0
- package/resources/evaluate/jobs/jobs.d.ts.map +1 -0
- package/resources/evaluate/jobs/jobs.js +76 -0
- package/resources/evaluate/jobs/jobs.js.map +1 -0
- package/resources/evaluate/jobs/jobs.mjs +49 -0
- package/resources/evaluate/jobs/jobs.mjs.map +1 -0
- package/resources/evaluate/jobs/logs.d.ts +22 -0
- package/resources/evaluate/jobs/logs.d.ts.map +1 -0
- package/resources/evaluate/jobs/logs.js +24 -0
- package/resources/evaluate/jobs/logs.js.map +1 -0
- package/resources/evaluate/jobs/logs.mjs +20 -0
- package/resources/evaluate/jobs/logs.mjs.map +1 -0
- package/resources/evaluate/jobs/status.d.ts +22 -0
- package/resources/evaluate/jobs/status.d.ts.map +1 -0
- package/resources/evaluate/jobs/status.js +24 -0
- package/resources/evaluate/jobs/status.js.map +1 -0
- package/resources/evaluate/jobs/status.mjs +20 -0
- package/resources/evaluate/jobs/status.mjs.map +1 -0
- package/resources/evaluate/question-answering.d.ts +22 -0
- package/resources/evaluate/question-answering.d.ts.map +1 -0
- package/resources/evaluate/question-answering.js +24 -0
- package/resources/evaluate/question-answering.js.map +1 -0
- package/resources/evaluate/question-answering.mjs +20 -0
- package/resources/evaluate/question-answering.mjs.map +1 -0
- package/resources/evaluate/summarization.d.ts +4 -0
- package/resources/evaluate/summarization.d.ts.map +1 -0
- package/resources/evaluate/summarization.js +9 -0
- package/resources/evaluate/summarization.js.map +1 -0
- package/resources/evaluate/summarization.mjs +5 -0
- package/resources/evaluate/summarization.mjs.map +1 -0
- package/resources/evaluate/text-generation.d.ts +4 -0
- package/resources/evaluate/text-generation.d.ts.map +1 -0
- package/resources/evaluate/text-generation.js +9 -0
- package/resources/evaluate/text-generation.js.map +1 -0
- package/resources/evaluate/text-generation.mjs +5 -0
- package/resources/evaluate/text-generation.mjs.map +1 -0
- package/resources/evaluations.d.ts +35 -0
- package/resources/evaluations.d.ts.map +1 -0
- package/resources/evaluations.js +37 -0
- package/resources/evaluations.js.map +1 -0
- package/resources/evaluations.mjs +33 -0
- package/resources/evaluations.mjs.map +1 -0
- package/resources/index.d.ts +17 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +50 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +18 -0
- package/resources/index.mjs.map +1 -0
- package/resources/inference/embeddings.d.ts +29 -0
- package/resources/inference/embeddings.d.ts.map +1 -0
- package/resources/inference/embeddings.js +49 -0
- package/resources/inference/embeddings.js.map +1 -0
- package/resources/inference/embeddings.mjs +22 -0
- package/resources/inference/embeddings.mjs.map +1 -0
- package/resources/inference/index.d.ts +3 -0
- package/resources/inference/index.d.ts.map +1 -0
- package/resources/inference/index.js +9 -0
- package/resources/inference/index.js.map +1 -0
- package/resources/inference/index.mjs +4 -0
- package/resources/inference/index.mjs.map +1 -0
- package/resources/inference/inference.d.ts +172 -0
- package/resources/inference/inference.d.ts.map +1 -0
- package/resources/inference/inference.js +67 -0
- package/resources/inference/inference.js.map +1 -0
- package/resources/inference/inference.mjs +40 -0
- package/resources/inference/inference.mjs.map +1 -0
- package/resources/memory/documents.d.ts +49 -0
- package/resources/memory/documents.d.ts.map +1 -0
- package/resources/memory/documents.js +39 -0
- package/resources/memory/documents.js.map +1 -0
- package/resources/memory/documents.mjs +35 -0
- package/resources/memory/documents.mjs.map +1 -0
- package/resources/memory/index.d.ts +3 -0
- package/resources/memory/index.d.ts.map +1 -0
- package/resources/memory/index.js +9 -0
- package/resources/memory/index.js.map +1 -0
- package/resources/memory/index.mjs +4 -0
- package/resources/memory/index.mjs.map +1 -0
- package/resources/memory/memory.d.ts +158 -0
- package/resources/memory/memory.d.ts.map +1 -0
- package/resources/memory/memory.js +137 -0
- package/resources/memory/memory.js.map +1 -0
- package/resources/memory/memory.mjs +110 -0
- package/resources/memory/memory.mjs.map +1 -0
- package/resources/memory-banks.d.ts +42 -0
- package/resources/memory-banks.d.ts.map +1 -0
- package/resources/memory-banks.js +40 -0
- package/resources/memory-banks.js.map +1 -0
- package/resources/memory-banks.mjs +36 -0
- package/resources/memory-banks.mjs.map +1 -0
- package/resources/models.d.ts +46 -0
- package/resources/models.d.ts.map +1 -0
- package/resources/models.js +40 -0
- package/resources/models.js.map +1 -0
- package/resources/models.mjs +36 -0
- package/resources/models.mjs.map +1 -0
- package/resources/post-training/index.d.ts +3 -0
- package/resources/post-training/index.d.ts.map +1 -0
- package/resources/post-training/index.js +9 -0
- package/resources/post-training/index.js.map +1 -0
- package/resources/post-training/index.mjs +4 -0
- package/resources/post-training/index.mjs.map +1 -0
- package/resources/post-training/jobs.d.ts +91 -0
- package/resources/post-training/jobs.d.ts.map +1 -0
- package/resources/post-training/jobs.js +80 -0
- package/resources/post-training/jobs.js.map +1 -0
- package/resources/post-training/jobs.mjs +76 -0
- package/resources/post-training/jobs.mjs.map +1 -0
- package/resources/post-training/post-training.d.ts +183 -0
- package/resources/post-training/post-training.d.ts.map +1 -0
- package/resources/post-training/post-training.js +66 -0
- package/resources/post-training/post-training.js.map +1 -0
- package/resources/post-training/post-training.mjs +39 -0
- package/resources/post-training/post-training.mjs.map +1 -0
- package/resources/reward-scoring.d.ts +47 -0
- package/resources/reward-scoring.d.ts.map +1 -0
- package/resources/reward-scoring.js +24 -0
- package/resources/reward-scoring.js.map +1 -0
- package/resources/reward-scoring.mjs +20 -0
- package/resources/reward-scoring.mjs.map +1 -0
- package/resources/safety.d.ts +41 -0
- package/resources/safety.d.ts.map +1 -0
- package/resources/safety.js +24 -0
- package/resources/safety.js.map +1 -0
- package/resources/safety.mjs +20 -0
- package/resources/safety.mjs.map +1 -0
- package/resources/shared.d.ts +42 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/shields.d.ts +42 -0
- package/resources/shields.d.ts.map +1 -0
- package/resources/shields.js +40 -0
- package/resources/shields.js.map +1 -0
- package/resources/shields.mjs +36 -0
- package/resources/shields.mjs.map +1 -0
- package/resources/synthetic-data-generation.d.ts +36 -0
- package/resources/synthetic-data-generation.d.ts.map +1 -0
- package/resources/synthetic-data-generation.js +24 -0
- package/resources/synthetic-data-generation.js.map +1 -0
- package/resources/synthetic-data-generation.mjs +20 -0
- package/resources/synthetic-data-generation.mjs.map +1 -0
- package/resources/telemetry.d.ts +81 -0
- package/resources/telemetry.d.ts.map +1 -0
- package/resources/telemetry.js +38 -0
- package/resources/telemetry.js.map +1 -0
- package/resources/telemetry.mjs +34 -0
- package/resources/telemetry.mjs.map +1 -0
- package/shims/node.d.ts +30 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +1195 -0
- package/src/error.ts +146 -0
- package/src/index.ts +298 -0
- package/src/lib/.keep +4 -0
- package/src/resource.ts +11 -0
- package/src/resources/agents/agents.ts +383 -0
- package/src/resources/agents/index.ts +33 -0
- package/src/resources/agents/sessions.ts +135 -0
- package/src/resources/agents/steps.ts +58 -0
- package/src/resources/agents/turns.ts +231 -0
- package/src/resources/batch-inference.ts +154 -0
- package/src/resources/datasets.ts +110 -0
- package/src/resources/evaluate/evaluate.ts +35 -0
- package/src/resources/evaluate/index.ts +14 -0
- package/src/resources/evaluate/jobs/artifacts.ts +42 -0
- package/src/resources/evaluate/jobs/index.ts +13 -0
- package/src/resources/evaluate/jobs/jobs.ts +99 -0
- package/src/resources/evaluate/jobs/logs.ts +42 -0
- package/src/resources/evaluate/jobs/status.ts +42 -0
- package/src/resources/evaluate/question-answering.ts +42 -0
- package/src/resources/evaluate/summarization.ts +5 -0
- package/src/resources/evaluate/text-generation.ts +5 -0
- package/src/resources/evaluations.ts +73 -0
- package/src/resources/index.ts +84 -0
- package/src/resources/inference/embeddings.ts +48 -0
- package/src/resources/inference/index.ts +15 -0
- package/src/resources/inference/inference.ts +268 -0
- package/src/resources/memory/documents.ts +92 -0
- package/src/resources/memory/index.ts +23 -0
- package/src/resources/memory/memory.ts +297 -0
- package/src/resources/memory-banks.ts +84 -0
- package/src/resources/models.ts +88 -0
- package/src/resources/post-training/index.ts +19 -0
- package/src/resources/post-training/jobs.ts +192 -0
- package/src/resources/post-training/post-training.ts +285 -0
- package/src/resources/reward-scoring.ts +82 -0
- package/src/resources/safety.ts +66 -0
- package/src/resources/shared.ts +75 -0
- package/src/resources/shields.ts +84 -0
- package/src/resources/synthetic-data-generation.ts +62 -0
- package/src/resources/telemetry.ts +150 -0
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +475 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +255 -0
- package/src/version.ts +1 -0
- package/streaming.d.ts +41 -0
- package/streaming.d.ts.map +1 -0
- package/streaming.js +403 -0
- package/streaming.js.map +1 -0
- package/streaming.mjs +396 -0
- package/streaming.mjs.map +1 -0
- package/uploads.d.ts +75 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +171 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +158 -0
- package/uploads.mjs.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import * as Errors from "./error.js";
|
|
2
|
+
import * as Uploads from "./uploads.js";
|
|
3
|
+
import { type Agent } from "./_shims/index.js";
|
|
4
|
+
import * as Core from "./core.js";
|
|
5
|
+
import * as API from "./resources/index.js";
|
|
6
|
+
declare const environments: {
|
|
7
|
+
production: string;
|
|
8
|
+
sandbox: string;
|
|
9
|
+
};
|
|
10
|
+
type Environment = keyof typeof environments;
|
|
11
|
+
export interface ClientOptions {
|
|
12
|
+
/**
|
|
13
|
+
* Specifies the environment to use for the API.
|
|
14
|
+
*
|
|
15
|
+
* Each environment maps to a different base URL:
|
|
16
|
+
* - `production` corresponds to `http://any-hosted-llama-stack-client.com`
|
|
17
|
+
* - `sandbox` corresponds to `https://example.com`
|
|
18
|
+
*/
|
|
19
|
+
environment?: Environment;
|
|
20
|
+
/**
|
|
21
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
22
|
+
*
|
|
23
|
+
* Defaults to process.env['LLAMA_STACK_CLIENT_BASE_URL'].
|
|
24
|
+
*/
|
|
25
|
+
baseURL?: string | null | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
28
|
+
* from the server before timing out a single request.
|
|
29
|
+
*
|
|
30
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
31
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
32
|
+
*/
|
|
33
|
+
timeout?: number;
|
|
34
|
+
/**
|
|
35
|
+
* An HTTP agent used to manage HTTP(S) connections.
|
|
36
|
+
*
|
|
37
|
+
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
38
|
+
* otherwise no agent is used.
|
|
39
|
+
*/
|
|
40
|
+
httpAgent?: Agent;
|
|
41
|
+
/**
|
|
42
|
+
* Specify a custom `fetch` function implementation.
|
|
43
|
+
*
|
|
44
|
+
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
45
|
+
* defined globally.
|
|
46
|
+
*/
|
|
47
|
+
fetch?: Core.Fetch | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
50
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
51
|
+
*
|
|
52
|
+
* @default 2
|
|
53
|
+
*/
|
|
54
|
+
maxRetries?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Default headers to include with every request to the API.
|
|
57
|
+
*
|
|
58
|
+
* These can be removed in individual requests by explicitly setting the
|
|
59
|
+
* header to `undefined` or `null` in request options.
|
|
60
|
+
*/
|
|
61
|
+
defaultHeaders?: Core.Headers;
|
|
62
|
+
/**
|
|
63
|
+
* Default query parameters to include with every request to the API.
|
|
64
|
+
*
|
|
65
|
+
* These can be removed in individual requests by explicitly setting the
|
|
66
|
+
* param to `undefined` in request options.
|
|
67
|
+
*/
|
|
68
|
+
defaultQuery?: Core.DefaultQuery;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* API Client for interfacing with the Llama Stack Client API.
|
|
72
|
+
*/
|
|
73
|
+
export declare class LlamaStackClient extends Core.APIClient {
|
|
74
|
+
private _options;
|
|
75
|
+
/**
|
|
76
|
+
* API Client for interfacing with the Llama Stack Client API.
|
|
77
|
+
*
|
|
78
|
+
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
79
|
+
* @param {string} [opts.baseURL=process.env['LLAMA_STACK_CLIENT_BASE_URL'] ?? http://any-hosted-llama-stack-client.com] - Override the default base URL for the API.
|
|
80
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
81
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
82
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
83
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
84
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
85
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
86
|
+
*/
|
|
87
|
+
constructor({ baseURL, ...opts }?: ClientOptions);
|
|
88
|
+
telemetry: API.Telemetry;
|
|
89
|
+
agents: API.Agents;
|
|
90
|
+
datasets: API.Datasets;
|
|
91
|
+
evaluate: API.Evaluate;
|
|
92
|
+
evaluations: API.Evaluations;
|
|
93
|
+
inference: API.Inference;
|
|
94
|
+
safety: API.Safety;
|
|
95
|
+
memory: API.Memory;
|
|
96
|
+
postTraining: API.PostTraining;
|
|
97
|
+
rewardScoring: API.RewardScoringResource;
|
|
98
|
+
syntheticDataGeneration: API.SyntheticDataGenerationResource;
|
|
99
|
+
batchInference: API.BatchInference;
|
|
100
|
+
models: API.Models;
|
|
101
|
+
memoryBanks: API.MemoryBanks;
|
|
102
|
+
shields: API.Shields;
|
|
103
|
+
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
104
|
+
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
105
|
+
static LlamaStackClient: typeof LlamaStackClient;
|
|
106
|
+
static DEFAULT_TIMEOUT: number;
|
|
107
|
+
static LlamaStackClientError: typeof Errors.LlamaStackClientError;
|
|
108
|
+
static APIError: typeof Errors.APIError;
|
|
109
|
+
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
110
|
+
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
111
|
+
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
112
|
+
static NotFoundError: typeof Errors.NotFoundError;
|
|
113
|
+
static ConflictError: typeof Errors.ConflictError;
|
|
114
|
+
static RateLimitError: typeof Errors.RateLimitError;
|
|
115
|
+
static BadRequestError: typeof Errors.BadRequestError;
|
|
116
|
+
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
117
|
+
static InternalServerError: typeof Errors.InternalServerError;
|
|
118
|
+
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
119
|
+
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
120
|
+
static toFile: typeof Uploads.toFile;
|
|
121
|
+
static fileFromPath: typeof Uploads.fileFromPath;
|
|
122
|
+
}
|
|
123
|
+
export declare const LlamaStackClientError: typeof Errors.LlamaStackClientError, APIError: typeof Errors.APIError, APIConnectionError: typeof Errors.APIConnectionError, APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError, APIUserAbortError: typeof Errors.APIUserAbortError, NotFoundError: typeof Errors.NotFoundError, ConflictError: typeof Errors.ConflictError, RateLimitError: typeof Errors.RateLimitError, BadRequestError: typeof Errors.BadRequestError, AuthenticationError: typeof Errors.AuthenticationError, InternalServerError: typeof Errors.InternalServerError, PermissionDeniedError: typeof Errors.PermissionDeniedError, UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
124
|
+
export import toFile = Uploads.toFile;
|
|
125
|
+
export import fileFromPath = Uploads.fileFromPath;
|
|
126
|
+
export declare namespace LlamaStackClient {
|
|
127
|
+
export import RequestOptions = Core.RequestOptions;
|
|
128
|
+
export import Telemetry = API.Telemetry;
|
|
129
|
+
export import TelemetryGetTraceResponse = API.TelemetryGetTraceResponse;
|
|
130
|
+
export import TelemetryGetTraceParams = API.TelemetryGetTraceParams;
|
|
131
|
+
export import TelemetryLogParams = API.TelemetryLogParams;
|
|
132
|
+
export import Agents = API.Agents;
|
|
133
|
+
export import InferenceStep = API.InferenceStep;
|
|
134
|
+
export import MemoryRetrievalStep = API.MemoryRetrievalStep;
|
|
135
|
+
export import RestAPIExecutionConfig = API.RestAPIExecutionConfig;
|
|
136
|
+
export import ShieldCallStep = API.ShieldCallStep;
|
|
137
|
+
export import ToolExecutionStep = API.ToolExecutionStep;
|
|
138
|
+
export import ToolParamDefinition = API.ToolParamDefinition;
|
|
139
|
+
export import AgentCreateResponse = API.AgentCreateResponse;
|
|
140
|
+
export import AgentCreateParams = API.AgentCreateParams;
|
|
141
|
+
export import AgentDeleteParams = API.AgentDeleteParams;
|
|
142
|
+
export import Datasets = API.Datasets;
|
|
143
|
+
export import TrainEvalDataset = API.TrainEvalDataset;
|
|
144
|
+
export import DatasetCreateParams = API.DatasetCreateParams;
|
|
145
|
+
export import DatasetDeleteParams = API.DatasetDeleteParams;
|
|
146
|
+
export import DatasetGetParams = API.DatasetGetParams;
|
|
147
|
+
export import Evaluate = API.Evaluate;
|
|
148
|
+
export import EvaluationJob = API.EvaluationJob;
|
|
149
|
+
export import Evaluations = API.Evaluations;
|
|
150
|
+
export import EvaluationSummarizationParams = API.EvaluationSummarizationParams;
|
|
151
|
+
export import EvaluationTextGenerationParams = API.EvaluationTextGenerationParams;
|
|
152
|
+
export import Inference = API.Inference;
|
|
153
|
+
export import ChatCompletionStreamChunk = API.ChatCompletionStreamChunk;
|
|
154
|
+
export import CompletionStreamChunk = API.CompletionStreamChunk;
|
|
155
|
+
export import TokenLogProbs = API.TokenLogProbs;
|
|
156
|
+
export import InferenceChatCompletionResponse = API.InferenceChatCompletionResponse;
|
|
157
|
+
export import InferenceCompletionResponse = API.InferenceCompletionResponse;
|
|
158
|
+
export import InferenceChatCompletionParams = API.InferenceChatCompletionParams;
|
|
159
|
+
export import InferenceChatCompletionParamsNonStreaming = API.InferenceChatCompletionParamsNonStreaming;
|
|
160
|
+
export import InferenceChatCompletionParamsStreaming = API.InferenceChatCompletionParamsStreaming;
|
|
161
|
+
export import InferenceCompletionParams = API.InferenceCompletionParams;
|
|
162
|
+
export import Safety = API.Safety;
|
|
163
|
+
export import RunSheidResponse = API.RunSheidResponse;
|
|
164
|
+
export import SafetyRunShieldParams = API.SafetyRunShieldParams;
|
|
165
|
+
export import Memory = API.Memory;
|
|
166
|
+
export import QueryDocuments = API.QueryDocuments;
|
|
167
|
+
export import MemoryCreateResponse = API.MemoryCreateResponse;
|
|
168
|
+
export import MemoryRetrieveResponse = API.MemoryRetrieveResponse;
|
|
169
|
+
export import MemoryListResponse = API.MemoryListResponse;
|
|
170
|
+
export import MemoryDropResponse = API.MemoryDropResponse;
|
|
171
|
+
export import MemoryCreateParams = API.MemoryCreateParams;
|
|
172
|
+
export import MemoryRetrieveParams = API.MemoryRetrieveParams;
|
|
173
|
+
export import MemoryUpdateParams = API.MemoryUpdateParams;
|
|
174
|
+
export import MemoryListParams = API.MemoryListParams;
|
|
175
|
+
export import MemoryDropParams = API.MemoryDropParams;
|
|
176
|
+
export import MemoryInsertParams = API.MemoryInsertParams;
|
|
177
|
+
export import MemoryQueryParams = API.MemoryQueryParams;
|
|
178
|
+
export import PostTraining = API.PostTraining;
|
|
179
|
+
export import PostTrainingJob = API.PostTrainingJob;
|
|
180
|
+
export import PostTrainingPreferenceOptimizeParams = API.PostTrainingPreferenceOptimizeParams;
|
|
181
|
+
export import PostTrainingSupervisedFineTuneParams = API.PostTrainingSupervisedFineTuneParams;
|
|
182
|
+
export import RewardScoringResource = API.RewardScoringResource;
|
|
183
|
+
export import RewardScoring = API.RewardScoring;
|
|
184
|
+
export import ScoredDialogGenerations = API.ScoredDialogGenerations;
|
|
185
|
+
export import RewardScoringScoreParams = API.RewardScoringScoreParams;
|
|
186
|
+
export import SyntheticDataGenerationResource = API.SyntheticDataGenerationResource;
|
|
187
|
+
export import SyntheticDataGeneration = API.SyntheticDataGeneration;
|
|
188
|
+
export import SyntheticDataGenerationGenerateParams = API.SyntheticDataGenerationGenerateParams;
|
|
189
|
+
export import BatchInference = API.BatchInference;
|
|
190
|
+
export import BatchChatCompletion = API.BatchChatCompletion;
|
|
191
|
+
export import BatchInferenceChatCompletionParams = API.BatchInferenceChatCompletionParams;
|
|
192
|
+
export import BatchInferenceCompletionParams = API.BatchInferenceCompletionParams;
|
|
193
|
+
export import Models = API.Models;
|
|
194
|
+
export import ModelServingSpec = API.ModelServingSpec;
|
|
195
|
+
export import ModelListParams = API.ModelListParams;
|
|
196
|
+
export import ModelGetParams = API.ModelGetParams;
|
|
197
|
+
export import MemoryBanks = API.MemoryBanks;
|
|
198
|
+
export import MemoryBankSpec = API.MemoryBankSpec;
|
|
199
|
+
export import MemoryBankListParams = API.MemoryBankListParams;
|
|
200
|
+
export import MemoryBankGetParams = API.MemoryBankGetParams;
|
|
201
|
+
export import Shields = API.Shields;
|
|
202
|
+
export import ShieldSpec = API.ShieldSpec;
|
|
203
|
+
export import ShieldListParams = API.ShieldListParams;
|
|
204
|
+
export import ShieldGetParams = API.ShieldGetParams;
|
|
205
|
+
export import Attachment = API.Attachment;
|
|
206
|
+
export import BatchCompletion = API.BatchCompletion;
|
|
207
|
+
export import CompletionMessage = API.CompletionMessage;
|
|
208
|
+
export import SamplingParams = API.SamplingParams;
|
|
209
|
+
export import SystemMessage = API.SystemMessage;
|
|
210
|
+
export import ToolCall = API.ToolCall;
|
|
211
|
+
export import ToolResponseMessage = API.ToolResponseMessage;
|
|
212
|
+
export import UserMessage = API.UserMessage;
|
|
213
|
+
}
|
|
214
|
+
export default LlamaStackClient;
|
|
215
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,GAAG,MAAM,mBAAmB,CAAC;AAEzC,QAAA,MAAM,YAAY;;;CAGjB,CAAC;AACF,KAAK,WAAW,GAAG,MAAM,OAAO,YAAY,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEpC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAElB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IAE/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,C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c,GAAG,GAAG,CAAC,cAAc,CAAC;IAElD,MAAM,QAAQ,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IAC5C,MAAM,QAAQ,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;IAClD,MAAM,QAAQ,oBAAoB,GAAG,GAAG,CAAC,oBAAoB,CAAC;IAC9D,MAAM,QAAQ,mBAAmB,GAAG,GAAG,CAAC,mBAAmB,CAAC;IAE5D,MAAM,QAAQ,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IACpC,MAAM,QAAQ,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAC1C,MAAM,QAAQ,gBAAgB,GAAG,GAAG,CAAC,gBAAgB,CAAC;IACtD,MAAM,QAAQ,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC;IAEpD,MAAM,QAAQ,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAC1C,MAAM,QAAQ,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC;IACpD,MAAM,QAAQ,iBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAC;IACxD,MAAM,QAAQ,cAAc,GAAG,GAAG,CAAC,cAAc,CAAC;IAClD,MAAM,QAAQ,aAAa,GAAG,GAAG,CAAC,aAAa,CAAC;IAChD,MAAM,QAAQ,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IACtC,MAAM,QAAQ,mBAAmB,GAAG,GAAG,CAAC,mBAAmB,CAAC;IAC5D,MAAM,QAAQ,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;CAC7C;AAED,eAAe,gBAAgB,CAAC"}
|
package/index.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var _a;
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.fileFromPath = exports.toFile = exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.LlamaStackClientError = exports.LlamaStackClient = void 0;
|
|
29
|
+
const Errors = __importStar(require("./error.js"));
|
|
30
|
+
const Uploads = __importStar(require("./uploads.js"));
|
|
31
|
+
const Core = __importStar(require("./core.js"));
|
|
32
|
+
const API = __importStar(require("./resources/index.js"));
|
|
33
|
+
const environments = {
|
|
34
|
+
production: 'http://any-hosted-llama-stack-client.com',
|
|
35
|
+
sandbox: 'https://example.com',
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* API Client for interfacing with the Llama Stack Client API.
|
|
39
|
+
*/
|
|
40
|
+
class LlamaStackClient extends Core.APIClient {
|
|
41
|
+
/**
|
|
42
|
+
* API Client for interfacing with the Llama Stack Client API.
|
|
43
|
+
*
|
|
44
|
+
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
45
|
+
* @param {string} [opts.baseURL=process.env['LLAMA_STACK_CLIENT_BASE_URL'] ?? http://any-hosted-llama-stack-client.com] - Override the default base URL for the API.
|
|
46
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
47
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
48
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
49
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
50
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
51
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
52
|
+
*/
|
|
53
|
+
constructor({ baseURL = Core.readEnv('LLAMA_STACK_CLIENT_BASE_URL'), ...opts } = {}) {
|
|
54
|
+
const options = {
|
|
55
|
+
...opts,
|
|
56
|
+
baseURL,
|
|
57
|
+
environment: opts.environment ?? 'production',
|
|
58
|
+
};
|
|
59
|
+
if (baseURL && opts.environment) {
|
|
60
|
+
throw new Errors.LlamaStackClientError('Ambiguous URL; The `baseURL` option (or LLAMA_STACK_CLIENT_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null');
|
|
61
|
+
}
|
|
62
|
+
super({
|
|
63
|
+
baseURL: options.baseURL || environments[options.environment || 'production'],
|
|
64
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
65
|
+
httpAgent: options.httpAgent,
|
|
66
|
+
maxRetries: options.maxRetries,
|
|
67
|
+
fetch: options.fetch,
|
|
68
|
+
});
|
|
69
|
+
this.telemetry = new API.Telemetry(this);
|
|
70
|
+
this.agents = new API.Agents(this);
|
|
71
|
+
this.datasets = new API.Datasets(this);
|
|
72
|
+
this.evaluate = new API.Evaluate(this);
|
|
73
|
+
this.evaluations = new API.Evaluations(this);
|
|
74
|
+
this.inference = new API.Inference(this);
|
|
75
|
+
this.safety = new API.Safety(this);
|
|
76
|
+
this.memory = new API.Memory(this);
|
|
77
|
+
this.postTraining = new API.PostTraining(this);
|
|
78
|
+
this.rewardScoring = new API.RewardScoringResource(this);
|
|
79
|
+
this.syntheticDataGeneration = new API.SyntheticDataGenerationResource(this);
|
|
80
|
+
this.batchInference = new API.BatchInference(this);
|
|
81
|
+
this.models = new API.Models(this);
|
|
82
|
+
this.memoryBanks = new API.MemoryBanks(this);
|
|
83
|
+
this.shields = new API.Shields(this);
|
|
84
|
+
this._options = options;
|
|
85
|
+
}
|
|
86
|
+
defaultQuery() {
|
|
87
|
+
return this._options.defaultQuery;
|
|
88
|
+
}
|
|
89
|
+
defaultHeaders(opts) {
|
|
90
|
+
return {
|
|
91
|
+
...super.defaultHeaders(opts),
|
|
92
|
+
...this._options.defaultHeaders,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.LlamaStackClient = LlamaStackClient;
|
|
97
|
+
_a = LlamaStackClient;
|
|
98
|
+
LlamaStackClient.LlamaStackClient = _a;
|
|
99
|
+
LlamaStackClient.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
100
|
+
LlamaStackClient.LlamaStackClientError = Errors.LlamaStackClientError;
|
|
101
|
+
LlamaStackClient.APIError = Errors.APIError;
|
|
102
|
+
LlamaStackClient.APIConnectionError = Errors.APIConnectionError;
|
|
103
|
+
LlamaStackClient.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
104
|
+
LlamaStackClient.APIUserAbortError = Errors.APIUserAbortError;
|
|
105
|
+
LlamaStackClient.NotFoundError = Errors.NotFoundError;
|
|
106
|
+
LlamaStackClient.ConflictError = Errors.ConflictError;
|
|
107
|
+
LlamaStackClient.RateLimitError = Errors.RateLimitError;
|
|
108
|
+
LlamaStackClient.BadRequestError = Errors.BadRequestError;
|
|
109
|
+
LlamaStackClient.AuthenticationError = Errors.AuthenticationError;
|
|
110
|
+
LlamaStackClient.InternalServerError = Errors.InternalServerError;
|
|
111
|
+
LlamaStackClient.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
112
|
+
LlamaStackClient.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
113
|
+
LlamaStackClient.toFile = Uploads.toFile;
|
|
114
|
+
LlamaStackClient.fileFromPath = Uploads.fileFromPath;
|
|
115
|
+
exports.LlamaStackClientError = Errors.LlamaStackClientError, exports.APIError = Errors.APIError, exports.APIConnectionError = Errors.APIConnectionError, exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError, exports.APIUserAbortError = Errors.APIUserAbortError, exports.NotFoundError = Errors.NotFoundError, exports.ConflictError = Errors.ConflictError, exports.RateLimitError = Errors.RateLimitError, exports.BadRequestError = Errors.BadRequestError, exports.AuthenticationError = Errors.AuthenticationError, exports.InternalServerError = Errors.InternalServerError, exports.PermissionDeniedError = Errors.PermissionDeniedError, exports.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
116
|
+
exports.toFile = Uploads.toFile;
|
|
117
|
+
exports.fileFromPath = Uploads.fileFromPath;
|
|
118
|
+
(function (LlamaStackClient) {
|
|
119
|
+
LlamaStackClient.Telemetry = API.Telemetry;
|
|
120
|
+
LlamaStackClient.Agents = API.Agents;
|
|
121
|
+
LlamaStackClient.Datasets = API.Datasets;
|
|
122
|
+
LlamaStackClient.Evaluate = API.Evaluate;
|
|
123
|
+
LlamaStackClient.Evaluations = API.Evaluations;
|
|
124
|
+
LlamaStackClient.Inference = API.Inference;
|
|
125
|
+
LlamaStackClient.Safety = API.Safety;
|
|
126
|
+
LlamaStackClient.Memory = API.Memory;
|
|
127
|
+
LlamaStackClient.PostTraining = API.PostTraining;
|
|
128
|
+
LlamaStackClient.RewardScoringResource = API.RewardScoringResource;
|
|
129
|
+
LlamaStackClient.SyntheticDataGenerationResource = API.SyntheticDataGenerationResource;
|
|
130
|
+
LlamaStackClient.BatchInference = API.BatchInference;
|
|
131
|
+
LlamaStackClient.Models = API.Models;
|
|
132
|
+
LlamaStackClient.MemoryBanks = API.MemoryBanks;
|
|
133
|
+
LlamaStackClient.Shields = API.Shields;
|
|
134
|
+
})(LlamaStackClient = exports.LlamaStackClient || (exports.LlamaStackClient = {}));
|
|
135
|
+
exports = module.exports = LlamaStackClient;
|
|
136
|
+
exports.default = LlamaStackClient;
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,mDAAkC;AAClC,sDAAqC;AAErC,gDAA+B;AAC/B,0DAAyC;AAEzC,MAAM,YAAY,GAAG;IACnB,UAAU,EAAE,0CAA0C;IACtD,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAsEF;;GAEG;AACH,MAAa,gBAAiB,SAAQ,IAAI,CAAC,SAAS;IAGlD;;;;;;;;;;;OAWG;IACH,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,EAAE,GAAG,IAAI,KAAoB,EAAE;QAChG,MAAM,OAAO,GAAkB;YAC7B,GAAG,IAAI;YACP,OAAO;YACP,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,YAAY;SAC9C,CAAC;QAEF,IAAI,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE;YAC/B,MAAM,IAAI,MAAM,CAAC,qBAAqB,CACpC,qLAAqL,CACtL,CAAC;SACH;QAED,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,IA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Errors from "./error.mjs";
|
|
4
|
+
import * as Uploads from "./uploads.mjs";
|
|
5
|
+
import * as Core from "./core.mjs";
|
|
6
|
+
import * as API from "./resources/index.mjs";
|
|
7
|
+
const environments = {
|
|
8
|
+
production: 'http://any-hosted-llama-stack-client.com',
|
|
9
|
+
sandbox: 'https://example.com',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* API Client for interfacing with the Llama Stack Client API.
|
|
13
|
+
*/
|
|
14
|
+
export class LlamaStackClient extends Core.APIClient {
|
|
15
|
+
/**
|
|
16
|
+
* API Client for interfacing with the Llama Stack Client API.
|
|
17
|
+
*
|
|
18
|
+
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
19
|
+
* @param {string} [opts.baseURL=process.env['LLAMA_STACK_CLIENT_BASE_URL'] ?? http://any-hosted-llama-stack-client.com] - Override the default base URL for the API.
|
|
20
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
21
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
22
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
23
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
24
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
25
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
26
|
+
*/
|
|
27
|
+
constructor({ baseURL = Core.readEnv('LLAMA_STACK_CLIENT_BASE_URL'), ...opts } = {}) {
|
|
28
|
+
const options = {
|
|
29
|
+
...opts,
|
|
30
|
+
baseURL,
|
|
31
|
+
environment: opts.environment ?? 'production',
|
|
32
|
+
};
|
|
33
|
+
if (baseURL && opts.environment) {
|
|
34
|
+
throw new Errors.LlamaStackClientError('Ambiguous URL; The `baseURL` option (or LLAMA_STACK_CLIENT_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null');
|
|
35
|
+
}
|
|
36
|
+
super({
|
|
37
|
+
baseURL: options.baseURL || environments[options.environment || 'production'],
|
|
38
|
+
timeout: options.timeout ?? 60000 /* 1 minute */,
|
|
39
|
+
httpAgent: options.httpAgent,
|
|
40
|
+
maxRetries: options.maxRetries,
|
|
41
|
+
fetch: options.fetch,
|
|
42
|
+
});
|
|
43
|
+
this.telemetry = new API.Telemetry(this);
|
|
44
|
+
this.agents = new API.Agents(this);
|
|
45
|
+
this.datasets = new API.Datasets(this);
|
|
46
|
+
this.evaluate = new API.Evaluate(this);
|
|
47
|
+
this.evaluations = new API.Evaluations(this);
|
|
48
|
+
this.inference = new API.Inference(this);
|
|
49
|
+
this.safety = new API.Safety(this);
|
|
50
|
+
this.memory = new API.Memory(this);
|
|
51
|
+
this.postTraining = new API.PostTraining(this);
|
|
52
|
+
this.rewardScoring = new API.RewardScoringResource(this);
|
|
53
|
+
this.syntheticDataGeneration = new API.SyntheticDataGenerationResource(this);
|
|
54
|
+
this.batchInference = new API.BatchInference(this);
|
|
55
|
+
this.models = new API.Models(this);
|
|
56
|
+
this.memoryBanks = new API.MemoryBanks(this);
|
|
57
|
+
this.shields = new API.Shields(this);
|
|
58
|
+
this._options = options;
|
|
59
|
+
}
|
|
60
|
+
defaultQuery() {
|
|
61
|
+
return this._options.defaultQuery;
|
|
62
|
+
}
|
|
63
|
+
defaultHeaders(opts) {
|
|
64
|
+
return {
|
|
65
|
+
...super.defaultHeaders(opts),
|
|
66
|
+
...this._options.defaultHeaders,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_a = LlamaStackClient;
|
|
71
|
+
LlamaStackClient.LlamaStackClient = _a;
|
|
72
|
+
LlamaStackClient.DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
73
|
+
LlamaStackClient.LlamaStackClientError = Errors.LlamaStackClientError;
|
|
74
|
+
LlamaStackClient.APIError = Errors.APIError;
|
|
75
|
+
LlamaStackClient.APIConnectionError = Errors.APIConnectionError;
|
|
76
|
+
LlamaStackClient.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
77
|
+
LlamaStackClient.APIUserAbortError = Errors.APIUserAbortError;
|
|
78
|
+
LlamaStackClient.NotFoundError = Errors.NotFoundError;
|
|
79
|
+
LlamaStackClient.ConflictError = Errors.ConflictError;
|
|
80
|
+
LlamaStackClient.RateLimitError = Errors.RateLimitError;
|
|
81
|
+
LlamaStackClient.BadRequestError = Errors.BadRequestError;
|
|
82
|
+
LlamaStackClient.AuthenticationError = Errors.AuthenticationError;
|
|
83
|
+
LlamaStackClient.InternalServerError = Errors.InternalServerError;
|
|
84
|
+
LlamaStackClient.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
85
|
+
LlamaStackClient.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
86
|
+
LlamaStackClient.toFile = Uploads.toFile;
|
|
87
|
+
LlamaStackClient.fileFromPath = Uploads.fileFromPath;
|
|
88
|
+
export const { LlamaStackClientError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } = Errors;
|
|
89
|
+
export var toFile = Uploads.toFile;
|
|
90
|
+
export var fileFromPath = Uploads.fileFromPath;
|
|
91
|
+
(function (LlamaStackClient) {
|
|
92
|
+
LlamaStackClient.Telemetry = API.Telemetry;
|
|
93
|
+
LlamaStackClient.Agents = API.Agents;
|
|
94
|
+
LlamaStackClient.Datasets = API.Datasets;
|
|
95
|
+
LlamaStackClient.Evaluate = API.Evaluate;
|
|
96
|
+
LlamaStackClient.Evaluations = API.Evaluations;
|
|
97
|
+
LlamaStackClient.Inference = API.Inference;
|
|
98
|
+
LlamaStackClient.Safety = API.Safety;
|
|
99
|
+
LlamaStackClient.Memory = API.Memory;
|
|
100
|
+
LlamaStackClient.PostTraining = API.PostTraining;
|
|
101
|
+
LlamaStackClient.RewardScoringResource = API.RewardScoringResource;
|
|
102
|
+
LlamaStackClient.SyntheticDataGenerationResource = API.SyntheticDataGenerationResource;
|
|
103
|
+
LlamaStackClient.BatchInference = API.BatchInference;
|
|
104
|
+
LlamaStackClient.Models = API.Models;
|
|
105
|
+
LlamaStackClient.MemoryBanks = API.MemoryBanks;
|
|
106
|
+
LlamaStackClient.Shields = API.Shields;
|
|
107
|
+
})(LlamaStackClient || (LlamaStackClient = {}));
|
|
108
|
+
export default LlamaStackClient;
|
|
109
|
+
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;;OAE/E,KAAK,MAAM;OACX,KAAK,OAAO;OAEZ,KAAK,IAAI;OACT,KAAK,GAAG;AAEf,MAAM,YAAY,GAAG;IACnB,UAAU,EAAE,0CAA0C;IACtD,OAAO,EAAE,qBAAqB;CAC/B,CAAC;AAsEF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,IAAI,CAAC,SAAS;IAGlD;;;;;;;;;;;OAWG;IACH,YAAY,EAAE,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,6BAA6B,CAAC,EAAE,GAAG,IAAI,KAAoB,EAAE;QAChG,MAAM,OAAO,GAAkB;YAC7B,GAAG,IAAI;YACP,OAAO;YACP,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,YAAY;SAC9C,CAAC;QAEF,IAAI,OAAO,IAAI,IAAI,CAAC,WAAW,EAAE;YAC/B,MAAM,IAAI,MAAM,CAAC,qBAAqB,CACpC,qLAAqL,CACtL,CAAC;SACH;QAED,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,WAAW,IAAI,YAAY,CAAC;YAC7E,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,cAAc;YAChD,SA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AAC,MAAM,CAAC;AACtC,MAAM,KAAQ,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;AAElD,WAAiB,gBAAgB;IAGjB,0BAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAK1B,uBAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAWpB,yBAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAMxB,yBAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAGxB,4BAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IAI9B,0BAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAW1B,uBAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAIpB,uBAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAcpB,6BAAY,GAAG,GAAG,CAAC,YAAY,CAAC;IAKhC,sCAAqB,GAAG,GAAG,CAAC,qBAAqB,CAAC;IAKlD,gDAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;IAItE,+BAAc,GAAG,GAAG,CAAC,cAAc,CAAC;IAKpC,uBAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAKpB,4BAAW,GAAG,GAAG,CAAC,WAAW,CAAC;IAK9B,wBAAO,GAAG,GAAG,CAAC,OAAO,CAAC;AAatC,CAAC,EAvGgB,gBAAgB,KAAhB,gBAAgB,QAuGhC;AAED,eAAe,gBAAgB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "llama-stack-client",
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"description": "The official TypeScript library for the Llama Stack Client API",
|
|
5
|
+
"author": "Llama Stack Client <dev-feedback@llama-stack-client.com>",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"repository": "github:stainless-sdks/llama-stack-node",
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"packageManager": "yarn@1.22.22",
|
|
12
|
+
"files": [
|
|
13
|
+
"*"
|
|
14
|
+
],
|
|
15
|
+
"private": false,
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "./scripts/test",
|
|
18
|
+
"build": "./scripts/build",
|
|
19
|
+
"format": "prettier --write --cache --cache-strategy metadata . !dist",
|
|
20
|
+
"tsn": "ts-node -r tsconfig-paths/register",
|
|
21
|
+
"lint": "./scripts/lint",
|
|
22
|
+
"fix": "./scripts/format"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@types/node-fetch": "^2.6.4",
|
|
26
|
+
"abort-controller": "^3.0.0",
|
|
27
|
+
"agentkeepalive": "^4.2.1",
|
|
28
|
+
"form-data-encoder": "1.7.2",
|
|
29
|
+
"formdata-node": "^4.3.2",
|
|
30
|
+
"node-fetch": "^2.6.7"
|
|
31
|
+
},
|
|
32
|
+
"sideEffects": [
|
|
33
|
+
"./_shims/index.js",
|
|
34
|
+
"./_shims/index.mjs",
|
|
35
|
+
"./shims/node.js",
|
|
36
|
+
"./shims/node.mjs",
|
|
37
|
+
"./shims/web.js",
|
|
38
|
+
"./shims/web.mjs"
|
|
39
|
+
],
|
|
40
|
+
"imports": {
|
|
41
|
+
"llama-stack-client": ".",
|
|
42
|
+
"llama-stack-client/*": "./src/*"
|
|
43
|
+
},
|
|
44
|
+
"exports": {
|
|
45
|
+
"./_shims/auto/*": {
|
|
46
|
+
"deno": {
|
|
47
|
+
"types": "./_shims/auto/*.d.ts",
|
|
48
|
+
"require": "./_shims/auto/*.js",
|
|
49
|
+
"default": "./_shims/auto/*.mjs"
|
|
50
|
+
},
|
|
51
|
+
"bun": {
|
|
52
|
+
"types": "./_shims/auto/*.d.ts",
|
|
53
|
+
"require": "./_shims/auto/*-bun.js",
|
|
54
|
+
"default": "./_shims/auto/*-bun.mjs"
|
|
55
|
+
},
|
|
56
|
+
"browser": {
|
|
57
|
+
"types": "./_shims/auto/*.d.ts",
|
|
58
|
+
"require": "./_shims/auto/*.js",
|
|
59
|
+
"default": "./_shims/auto/*.mjs"
|
|
60
|
+
},
|
|
61
|
+
"worker": {
|
|
62
|
+
"types": "./_shims/auto/*.d.ts",
|
|
63
|
+
"require": "./_shims/auto/*.js",
|
|
64
|
+
"default": "./_shims/auto/*.mjs"
|
|
65
|
+
},
|
|
66
|
+
"workerd": {
|
|
67
|
+
"types": "./_shims/auto/*.d.ts",
|
|
68
|
+
"require": "./_shims/auto/*.js",
|
|
69
|
+
"default": "./_shims/auto/*.mjs"
|
|
70
|
+
},
|
|
71
|
+
"node": {
|
|
72
|
+
"types": "./_shims/auto/*-node.d.ts",
|
|
73
|
+
"require": "./_shims/auto/*-node.js",
|
|
74
|
+
"default": "./_shims/auto/*-node.mjs"
|
|
75
|
+
},
|
|
76
|
+
"types": "./_shims/auto/*.d.ts",
|
|
77
|
+
"require": "./_shims/auto/*.js",
|
|
78
|
+
"default": "./_shims/auto/*.mjs"
|
|
79
|
+
},
|
|
80
|
+
".": {
|
|
81
|
+
"require": {
|
|
82
|
+
"types": "./index.d.ts",
|
|
83
|
+
"default": "./index.js"
|
|
84
|
+
},
|
|
85
|
+
"types": "./index.d.mts",
|
|
86
|
+
"default": "./index.mjs"
|
|
87
|
+
},
|
|
88
|
+
"./*.mjs": {
|
|
89
|
+
"types": "./*.d.ts",
|
|
90
|
+
"default": "./*.mjs"
|
|
91
|
+
},
|
|
92
|
+
"./*.js": {
|
|
93
|
+
"types": "./*.d.ts",
|
|
94
|
+
"default": "./*.js"
|
|
95
|
+
},
|
|
96
|
+
"./*": {
|
|
97
|
+
"types": "./*.d.ts",
|
|
98
|
+
"require": "./*.js",
|
|
99
|
+
"default": "./*.mjs"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
package/resource.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,qBAAa,WAAW;IACtB,SAAS,CAAC,OAAO,EAAE,gBAAgB,CAAC;gBAExB,MAAM,EAAE,gBAAgB;CAGrC"}
|
package/resource.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.APIResource = void 0;
|
|
5
|
+
class APIResource {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this._client = client;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.APIResource = APIResource;
|
|
11
|
+
//# sourceMappingURL=resource.js.map
|
package/resource.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAItF,MAAa,WAAW;IAGtB,YAAY,MAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAND,kCAMC"}
|
package/resource.mjs
ADDED
package/resource.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.mjs","sourceRoot":"","sources":["src/resource.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAItF,MAAM,OAAO,WAAW;IAGtB,YAAY,MAAwB;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;CACF"}
|