langsmith 0.7.8 → 0.7.10
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 +161 -15
- package/dist/_openapi_client/client.cjs +814 -0
- package/dist/_openapi_client/client.d.ts +247 -0
- package/dist/_openapi_client/client.js +777 -0
- package/dist/_openapi_client/core/api-promise.cjs +100 -0
- package/dist/_openapi_client/core/api-promise.d.ts +45 -0
- package/dist/_openapi_client/core/api-promise.js +96 -0
- package/dist/_openapi_client/core/error.cjs +134 -0
- package/dist/_openapi_client/core/error.d.ts +45 -0
- package/dist/_openapi_client/core/error.js +118 -0
- package/dist/_openapi_client/core/pagination.cjs +374 -0
- package/dist/_openapi_client/core/pagination.d.ts +157 -0
- package/dist/_openapi_client/core/pagination.js +361 -0
- package/dist/_openapi_client/core/resource.cjs +17 -0
- package/dist/_openapi_client/core/resource.d.ts +5 -0
- package/dist/_openapi_client/core/resource.js +13 -0
- package/dist/_openapi_client/core/uploads.cjs +5 -0
- package/dist/_openapi_client/core/uploads.d.ts +2 -0
- package/dist/_openapi_client/core/uploads.js +1 -0
- package/dist/_openapi_client/index.cjs +29 -0
- package/dist/_openapi_client/index.d.ts +6 -0
- package/dist/_openapi_client/index.js +8 -0
- package/dist/_openapi_client/internal/builtin-types.cjs +4 -0
- package/dist/_openapi_client/internal/builtin-types.d.ts +72 -0
- package/dist/_openapi_client/internal/builtin-types.js +3 -0
- package/dist/_openapi_client/internal/detect-platform.cjs +162 -0
- package/dist/_openapi_client/internal/detect-platform.d.ts +14 -0
- package/dist/_openapi_client/internal/detect-platform.js +157 -0
- package/dist/_openapi_client/internal/errors.cjs +41 -0
- package/dist/_openapi_client/internal/errors.d.ts +2 -0
- package/dist/_openapi_client/internal/errors.js +36 -0
- package/dist/_openapi_client/internal/headers.cjs +79 -0
- package/dist/_openapi_client/internal/headers.d.ts +18 -0
- package/dist/_openapi_client/internal/headers.js +74 -0
- package/dist/_openapi_client/internal/parse.cjs +40 -0
- package/dist/_openapi_client/internal/parse.d.ts +11 -0
- package/dist/_openapi_client/internal/parse.js +37 -0
- package/dist/_openapi_client/internal/qs/formats.cjs +12 -0
- package/dist/_openapi_client/internal/qs/formats.d.ts +6 -0
- package/dist/_openapi_client/internal/qs/formats.js +8 -0
- package/dist/_openapi_client/internal/qs/stringify.cjs +277 -0
- package/dist/_openapi_client/internal/qs/stringify.d.ts +2 -0
- package/dist/_openapi_client/internal/qs/stringify.js +274 -0
- package/dist/_openapi_client/internal/qs/types.cjs +2 -0
- package/dist/_openapi_client/internal/qs/types.d.ts +56 -0
- package/dist/_openapi_client/internal/qs/types.js +1 -0
- package/dist/_openapi_client/internal/qs/utils.cjs +230 -0
- package/dist/_openapi_client/internal/qs/utils.d.ts +14 -0
- package/dist/_openapi_client/internal/qs/utils.js +217 -0
- package/dist/_openapi_client/internal/request-options.cjs +14 -0
- package/dist/_openapi_client/internal/request-options.d.ts +74 -0
- package/dist/_openapi_client/internal/request-options.js +10 -0
- package/dist/_openapi_client/internal/shim-types.cjs +4 -0
- package/dist/_openapi_client/internal/shim-types.d.ts +16 -0
- package/dist/_openapi_client/internal/shim-types.js +3 -0
- package/dist/_openapi_client/internal/shims.cjs +92 -0
- package/dist/_openapi_client/internal/shims.d.ts +25 -0
- package/dist/_openapi_client/internal/shims.js +85 -0
- package/dist/_openapi_client/internal/to-file.cjs +91 -0
- package/dist/_openapi_client/internal/to-file.d.ts +44 -0
- package/dist/_openapi_client/internal/to-file.js +88 -0
- package/dist/_openapi_client/internal/types.cjs +4 -0
- package/dist/_openapi_client/internal/types.d.ts +35 -0
- package/dist/_openapi_client/internal/types.js +3 -0
- package/dist/_openapi_client/internal/uploads.cjs +140 -0
- package/dist/_openapi_client/internal/uploads.d.ts +41 -0
- package/dist/_openapi_client/internal/uploads.js +130 -0
- package/dist/_openapi_client/internal/utils/env.cjs +22 -0
- package/dist/_openapi_client/internal/utils/env.d.ts +8 -0
- package/dist/_openapi_client/internal/utils/env.js +18 -0
- package/dist/_openapi_client/internal/utils/log.cjs +88 -0
- package/dist/_openapi_client/internal/utils/log.d.ts +36 -0
- package/dist/_openapi_client/internal/utils/log.js +82 -0
- package/dist/_openapi_client/internal/utils/path.cjs +79 -0
- package/dist/_openapi_client/internal/utils/path.d.ts +14 -0
- package/dist/_openapi_client/internal/utils/path.js +74 -0
- package/dist/_openapi_client/internal/utils/query.cjs +42 -0
- package/dist/_openapi_client/internal/utils/query.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/query.js +6 -0
- package/dist/_openapi_client/internal/utils/sleep.cjs +7 -0
- package/dist/_openapi_client/internal/utils/sleep.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/sleep.js +3 -0
- package/dist/_openapi_client/internal/utils/uuid.cjs +19 -0
- package/dist/_openapi_client/internal/utils/uuid.d.ts +4 -0
- package/dist/_openapi_client/internal/utils/uuid.js +15 -0
- package/dist/_openapi_client/internal/utils/values.cjs +112 -0
- package/dist/_openapi_client/internal/utils/values.d.ts +17 -0
- package/dist/_openapi_client/internal/utils/values.js +94 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +138 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +367 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +101 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.cjs +46 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +128 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.js +42 -0
- package/dist/_openapi_client/resources/commits.cjs +44 -0
- package/dist/_openapi_client/resources/commits.d.ts +204 -0
- package/dist/_openapi_client/resources/commits.js +40 -0
- package/dist/_openapi_client/resources/datasets/comparative.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/comparative.d.ts +55 -0
- package/dist/_openapi_client/resources/datasets/comparative.js +18 -0
- package/dist/_openapi_client/resources/datasets/datasets.cjs +193 -0
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +374 -0
- package/dist/_openapi_client/resources/datasets/datasets.js +156 -0
- package/dist/_openapi_client/resources/datasets/experiments.cjs +16 -0
- package/dist/_openapi_client/resources/datasets/experiments.d.ts +23 -0
- package/dist/_openapi_client/resources/datasets/experiments.js +12 -0
- package/dist/_openapi_client/resources/datasets/group.cjs +17 -0
- package/dist/_openapi_client/resources/datasets/group.d.ts +160 -0
- package/dist/_openapi_client/resources/datasets/group.js +13 -0
- package/dist/_openapi_client/resources/datasets/runs.cjs +29 -0
- package/dist/_openapi_client/resources/datasets/runs.d.ts +216 -0
- package/dist/_openapi_client/resources/datasets/runs.js +25 -0
- package/dist/_openapi_client/resources/datasets/share.cjs +32 -0
- package/dist/_openapi_client/resources/datasets/share.d.ts +28 -0
- package/dist/_openapi_client/resources/datasets/share.js +28 -0
- package/dist/_openapi_client/resources/datasets/splits.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/splits.d.ts +30 -0
- package/dist/_openapi_client/resources/datasets/splits.js +18 -0
- package/dist/_openapi_client/resources/datasets/versions.cjs +23 -0
- package/dist/_openapi_client/resources/datasets/versions.d.ts +36 -0
- package/dist/_openapi_client/resources/datasets/versions.js +19 -0
- package/dist/_openapi_client/resources/evaluators.cjs +15 -0
- package/dist/_openapi_client/resources/evaluators.d.ts +125 -0
- package/dist/_openapi_client/resources/evaluators.js +11 -0
- package/dist/_openapi_client/resources/examples/bulk.cjs +24 -0
- package/dist/_openapi_client/resources/examples/bulk.d.ts +78 -0
- package/dist/_openapi_client/resources/examples/bulk.js +20 -0
- package/dist/_openapi_client/resources/examples/examples.cjs +124 -0
- package/dist/_openapi_client/resources/examples/examples.d.ts +182 -0
- package/dist/_openapi_client/resources/examples/examples.js +87 -0
- package/dist/_openapi_client/resources/examples/validate.cjs +21 -0
- package/dist/_openapi_client/resources/examples/validate.d.ts +38 -0
- package/dist/_openapi_client/resources/examples/validate.js +17 -0
- package/dist/_openapi_client/resources/feedback/configs.cjs +24 -0
- package/dist/_openapi_client/resources/feedback/configs.d.ts +18 -0
- package/dist/_openapi_client/resources/feedback/configs.js +20 -0
- package/dist/_openapi_client/resources/feedback/feedback.cjs +98 -0
- package/dist/_openapi_client/resources/feedback/feedback.d.ts +275 -0
- package/dist/_openapi_client/resources/feedback/feedback.js +61 -0
- package/dist/_openapi_client/resources/feedback/tokens.cjs +35 -0
- package/dist/_openapi_client/resources/feedback/tokens.d.ts +130 -0
- package/dist/_openapi_client/resources/feedback/tokens.js +31 -0
- package/dist/_openapi_client/resources/index.cjs +35 -0
- package/dist/_openapi_client/resources/index.d.ts +15 -0
- package/dist/_openapi_client/resources/index.js +17 -0
- package/dist/_openapi_client/resources/info.cjs +15 -0
- package/dist/_openapi_client/resources/info.d.ts +51 -0
- package/dist/_openapi_client/resources/info.js +11 -0
- package/dist/_openapi_client/resources/online-evaluators.cjs +70 -0
- package/dist/_openapi_client/resources/online-evaluators.d.ts +284 -0
- package/dist/_openapi_client/resources/online-evaluators.js +66 -0
- package/dist/_openapi_client/resources/public/datasets.cjs +47 -0
- package/dist/_openapi_client/resources/public/datasets.d.ts +152 -0
- package/dist/_openapi_client/resources/public/datasets.js +43 -0
- package/dist/_openapi_client/resources/public/public.cjs +62 -0
- package/dist/_openapi_client/resources/public/public.d.ts +32 -0
- package/dist/_openapi_client/resources/public/public.js +25 -0
- package/dist/_openapi_client/resources/repos/directories.cjs +40 -0
- package/dist/_openapi_client/resources/repos/directories.d.ts +72 -0
- package/dist/_openapi_client/resources/repos/directories.js +36 -0
- package/dist/_openapi_client/resources/repos/repos.cjs +93 -0
- package/dist/_openapi_client/resources/repos/repos.d.ts +188 -0
- package/dist/_openapi_client/resources/repos/repos.js +56 -0
- package/dist/_openapi_client/resources/runs/rules.cjs +9 -0
- package/dist/_openapi_client/resources/runs/rules.d.ts +3 -0
- package/dist/_openapi_client/resources/runs/rules.js +5 -0
- package/dist/_openapi_client/resources/runs/runs.cjs +102 -0
- package/dist/_openapi_client/resources/runs/runs.d.ts +542 -0
- package/dist/_openapi_client/resources/runs/runs.js +65 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +1121 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +63 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +13 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.js +26 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +130 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
- package/dist/_openapi_client/resources/sessions/insights.cjs +54 -0
- package/dist/_openapi_client/resources/sessions/insights.d.ts +246 -0
- package/dist/_openapi_client/resources/sessions/insights.js +50 -0
- package/dist/_openapi_client/resources/sessions/sessions.cjs +109 -0
- package/dist/_openapi_client/resources/sessions/sessions.d.ts +674 -0
- package/dist/_openapi_client/resources/sessions/sessions.js +72 -0
- package/dist/_openapi_client/resources/settings.cjs +15 -0
- package/dist/_openapi_client/resources/settings.d.ts +18 -0
- package/dist/_openapi_client/resources/settings.js +11 -0
- package/dist/_openapi_client/resources/workspaces.cjs +35 -0
- package/dist/_openapi_client/resources/workspaces.d.ts +84 -0
- package/dist/_openapi_client/resources/workspaces.js +31 -0
- package/dist/_openapi_client/version.cjs +5 -0
- package/dist/_openapi_client/version.d.ts +1 -0
- package/dist/_openapi_client/version.js +2 -0
- package/dist/client.cjs +48 -19
- package/dist/client.d.ts +5 -0
- package/dist/client.js +29 -0
- package/dist/env.cjs +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/env.js +1 -1
- package/dist/experimental/otel/exporter.cjs +1 -1
- package/dist/experimental/otel/exporter.js +2 -2
- package/dist/experimental/vercel/telemetry.cjs +1 -1
- package/dist/experimental/vercel/telemetry.js +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/run_trees.cjs +1 -1
- package/dist/run_trees.js +2 -2
- package/dist/sandbox/client.cjs +11 -3
- package/dist/sandbox/client.js +11 -3
- package/dist/sandbox/index.cjs +8 -2
- package/dist/sandbox/index.d.ts +3 -2
- package/dist/sandbox/index.js +2 -1
- package/dist/sandbox/mounts.cjs +114 -0
- package/dist/sandbox/mounts.d.ts +24 -0
- package/dist/sandbox/mounts.js +109 -0
- package/dist/sandbox/proxy_config.cjs +90 -5
- package/dist/sandbox/proxy_config.d.ts +19 -4
- package/dist/sandbox/proxy_config.js +86 -4
- package/dist/sandbox/types.d.ts +92 -3
- package/dist/traceable.cjs +1 -1
- package/dist/traceable.js +2 -2
- package/dist/utils/guard.cjs +13 -0
- package/dist/utils/guard.d.ts +6 -0
- package/dist/utils/guard.js +10 -0
- package/dist/utils/jestlike/globals.cjs +1 -1
- package/dist/utils/jestlike/globals.js +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,542 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource.js';
|
|
2
|
+
import * as RulesAPI from './rules.js';
|
|
3
|
+
import { Rules } from './rules.js';
|
|
4
|
+
import * as SessionsAPI from '../sessions/sessions.js';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise.js';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options.js';
|
|
7
|
+
export declare class Runs extends APIResource {
|
|
8
|
+
rules: RulesAPI.Rules;
|
|
9
|
+
/**
|
|
10
|
+
* Queues a single run for ingestion. The request body must be a JSON-encoded run
|
|
11
|
+
* object that follows the Run schema.
|
|
12
|
+
*/
|
|
13
|
+
create(body: RunCreateParams, options?: RequestOptions): APIPromise<RunCreateResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Get a specific run.
|
|
16
|
+
*/
|
|
17
|
+
retrieve(runID: string, query?: RunRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<RunSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Updates a run identified by its ID. The body should contain only the fields to
|
|
20
|
+
* be changed; unknown fields are ignored.
|
|
21
|
+
*/
|
|
22
|
+
update(runID: string, body: RunUpdateParams, options?: RequestOptions): APIPromise<RunUpdateResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Ingests a batch of runs in a single JSON payload. The payload must have `post`
|
|
25
|
+
* and/or `patch` arrays containing run objects. Prefer this endpoint over
|
|
26
|
+
* single‑run ingestion when submitting hundreds of runs, but `/runs/multipart`
|
|
27
|
+
* offers better handling for very large fields and attachments.
|
|
28
|
+
*/
|
|
29
|
+
ingestBatch(body: RunIngestBatchParams, options?: RequestOptions): APIPromise<RunIngestBatchResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Query Runs
|
|
32
|
+
*/
|
|
33
|
+
query(body: RunQueryParams, options?: RequestOptions): APIPromise<RunQueryResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* Get all runs by query in body payload.
|
|
36
|
+
*/
|
|
37
|
+
stats(body: RunStatsParams, options?: RequestOptions): APIPromise<RunStatsResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Update a run.
|
|
40
|
+
*/
|
|
41
|
+
update2(runID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Query params for run endpoints.
|
|
45
|
+
*/
|
|
46
|
+
export interface BodyParamsForRunSchema {
|
|
47
|
+
id?: Array<string> | null;
|
|
48
|
+
cursor?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Enum for run data source types.
|
|
51
|
+
*/
|
|
52
|
+
data_source_type?: RunsFilterDataSourceTypeEnum | null;
|
|
53
|
+
end_time?: string | null;
|
|
54
|
+
error?: boolean | null;
|
|
55
|
+
execution_order?: number | null;
|
|
56
|
+
filter?: string | null;
|
|
57
|
+
is_root?: boolean | null;
|
|
58
|
+
limit?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Enum for run start date order.
|
|
61
|
+
*/
|
|
62
|
+
order?: 'asc' | 'desc';
|
|
63
|
+
parent_run?: string | null;
|
|
64
|
+
query?: string | null;
|
|
65
|
+
reference_example?: Array<string> | null;
|
|
66
|
+
/**
|
|
67
|
+
* Enum for run types.
|
|
68
|
+
*/
|
|
69
|
+
run_type?: RunTypeEnum | null;
|
|
70
|
+
search_filter?: string | null;
|
|
71
|
+
select?: Array<'id' | 'name' | 'run_type' | 'start_time' | 'end_time' | 'status' | 'error' | 'extra' | 'events' | 'inputs' | 'inputs_preview' | 'inputs_s3_urls' | 'inputs_or_signed_url' | 'outputs' | 'outputs_preview' | 'outputs_s3_urls' | 'outputs_or_signed_url' | 's3_urls' | 'error_or_signed_url' | 'events_or_signed_url' | 'extra_or_signed_url' | 'serialized_or_signed_url' | 'parent_run_id' | 'manifest_id' | 'manifest_s3_id' | 'manifest' | 'session_id' | 'serialized' | 'reference_example_id' | 'reference_dataset_id' | 'total_tokens' | 'prompt_tokens' | 'prompt_token_details' | 'completion_tokens' | 'completion_token_details' | 'total_cost' | 'prompt_cost' | 'prompt_cost_details' | 'completion_cost' | 'completion_cost_details' | 'price_model_id' | 'first_token_time' | 'trace_id' | 'dotted_order' | 'last_queued_at' | 'feedback_stats' | 'child_run_ids' | 'parent_run_ids' | 'tags' | 'in_dataset' | 'app_path' | 'share_token' | 'trace_tier' | 'trace_first_received_at' | 'ttl_seconds' | 'trace_upgrade' | 'thread_id' | 'trace_min_max_start_time' | 'messages' | 'inserted_at'>;
|
|
72
|
+
session?: Array<string> | null;
|
|
73
|
+
skip_pagination?: boolean | null;
|
|
74
|
+
skip_prev_cursor?: boolean;
|
|
75
|
+
start_time?: string | null;
|
|
76
|
+
trace?: string | null;
|
|
77
|
+
trace_filter?: string | null;
|
|
78
|
+
tree_filter?: string | null;
|
|
79
|
+
use_experimental_search?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface RequestBodyForRunsGenerateQuery {
|
|
82
|
+
query: string;
|
|
83
|
+
feedback_keys?: Array<'user_score' | 'user_edited' | 'user_removed' | 'user_opened_run' | 'user_selected_run' | 'results_size' | 'valid_filter'>;
|
|
84
|
+
}
|
|
85
|
+
export interface ResponseBodyForRunsGenerateQuery {
|
|
86
|
+
feedback_urls: {
|
|
87
|
+
[key: string]: string;
|
|
88
|
+
};
|
|
89
|
+
filter: string;
|
|
90
|
+
}
|
|
91
|
+
export interface Run {
|
|
92
|
+
id?: string;
|
|
93
|
+
dotted_order?: string;
|
|
94
|
+
end_time?: string;
|
|
95
|
+
error?: string;
|
|
96
|
+
events?: Array<{
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
}>;
|
|
99
|
+
extra?: {
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
};
|
|
102
|
+
input_attachments?: {
|
|
103
|
+
[key: string]: unknown;
|
|
104
|
+
};
|
|
105
|
+
inputs?: {
|
|
106
|
+
[key: string]: unknown;
|
|
107
|
+
};
|
|
108
|
+
name?: string;
|
|
109
|
+
output_attachments?: {
|
|
110
|
+
[key: string]: unknown;
|
|
111
|
+
};
|
|
112
|
+
outputs?: {
|
|
113
|
+
[key: string]: unknown;
|
|
114
|
+
};
|
|
115
|
+
parent_run_id?: string;
|
|
116
|
+
reference_example_id?: string;
|
|
117
|
+
run_type?: 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
|
|
118
|
+
serialized?: {
|
|
119
|
+
[key: string]: unknown;
|
|
120
|
+
};
|
|
121
|
+
session_id?: string;
|
|
122
|
+
session_name?: string;
|
|
123
|
+
start_time?: string;
|
|
124
|
+
status?: string;
|
|
125
|
+
tags?: Array<string>;
|
|
126
|
+
trace_id?: string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Run schema.
|
|
130
|
+
*/
|
|
131
|
+
export interface RunSchema {
|
|
132
|
+
id: string;
|
|
133
|
+
app_path: string;
|
|
134
|
+
dotted_order: string;
|
|
135
|
+
name: string;
|
|
136
|
+
/**
|
|
137
|
+
* Enum for run types.
|
|
138
|
+
*/
|
|
139
|
+
run_type: RunTypeEnum;
|
|
140
|
+
session_id: string;
|
|
141
|
+
status: string;
|
|
142
|
+
trace_id: string;
|
|
143
|
+
child_run_ids?: Array<string> | null;
|
|
144
|
+
completion_cost?: string | null;
|
|
145
|
+
completion_cost_details?: {
|
|
146
|
+
[key: string]: string;
|
|
147
|
+
} | null;
|
|
148
|
+
completion_token_details?: {
|
|
149
|
+
[key: string]: number;
|
|
150
|
+
} | null;
|
|
151
|
+
completion_tokens?: number;
|
|
152
|
+
direct_child_run_ids?: Array<string> | null;
|
|
153
|
+
end_time?: string | null;
|
|
154
|
+
error?: string | null;
|
|
155
|
+
events?: Array<{
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
}> | null;
|
|
158
|
+
execution_order?: number;
|
|
159
|
+
extra?: {
|
|
160
|
+
[key: string]: unknown;
|
|
161
|
+
} | null;
|
|
162
|
+
feedback_stats?: {
|
|
163
|
+
[key: string]: {
|
|
164
|
+
[key: string]: unknown;
|
|
165
|
+
};
|
|
166
|
+
} | null;
|
|
167
|
+
first_token_time?: string | null;
|
|
168
|
+
in_dataset?: boolean | null;
|
|
169
|
+
inputs?: {
|
|
170
|
+
[key: string]: unknown;
|
|
171
|
+
} | null;
|
|
172
|
+
inputs_preview?: string | null;
|
|
173
|
+
inputs_s3_urls?: {
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
} | null;
|
|
176
|
+
last_queued_at?: string | null;
|
|
177
|
+
manifest_id?: string | null;
|
|
178
|
+
manifest_s3_id?: string | null;
|
|
179
|
+
messages?: Array<{
|
|
180
|
+
[key: string]: unknown;
|
|
181
|
+
}> | null;
|
|
182
|
+
outputs?: {
|
|
183
|
+
[key: string]: unknown;
|
|
184
|
+
} | null;
|
|
185
|
+
outputs_preview?: string | null;
|
|
186
|
+
outputs_s3_urls?: {
|
|
187
|
+
[key: string]: unknown;
|
|
188
|
+
} | null;
|
|
189
|
+
parent_run_id?: string | null;
|
|
190
|
+
parent_run_ids?: Array<string> | null;
|
|
191
|
+
price_model_id?: string | null;
|
|
192
|
+
prompt_cost?: string | null;
|
|
193
|
+
prompt_cost_details?: {
|
|
194
|
+
[key: string]: string;
|
|
195
|
+
} | null;
|
|
196
|
+
prompt_token_details?: {
|
|
197
|
+
[key: string]: number;
|
|
198
|
+
} | null;
|
|
199
|
+
prompt_tokens?: number;
|
|
200
|
+
reference_dataset_id?: string | null;
|
|
201
|
+
reference_example_id?: string | null;
|
|
202
|
+
s3_urls?: {
|
|
203
|
+
[key: string]: unknown;
|
|
204
|
+
} | null;
|
|
205
|
+
serialized?: {
|
|
206
|
+
[key: string]: unknown;
|
|
207
|
+
} | null;
|
|
208
|
+
share_token?: string | null;
|
|
209
|
+
start_time?: string;
|
|
210
|
+
tags?: Array<string> | null;
|
|
211
|
+
thread_id?: string | null;
|
|
212
|
+
total_cost?: string | null;
|
|
213
|
+
total_tokens?: number;
|
|
214
|
+
trace_first_received_at?: string | null;
|
|
215
|
+
trace_max_start_time?: string | null;
|
|
216
|
+
trace_min_start_time?: string | null;
|
|
217
|
+
trace_tier?: 'longlived' | 'shortlived' | null;
|
|
218
|
+
trace_upgrade?: boolean;
|
|
219
|
+
ttl_seconds?: number | null;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Query params for run stats.
|
|
223
|
+
*/
|
|
224
|
+
export interface RunStatsQueryParams {
|
|
225
|
+
id?: Array<string> | null;
|
|
226
|
+
/**
|
|
227
|
+
* Enum for run data source types.
|
|
228
|
+
*/
|
|
229
|
+
data_source_type?: RunsFilterDataSourceTypeEnum | null;
|
|
230
|
+
end_time?: string | null;
|
|
231
|
+
error?: boolean | null;
|
|
232
|
+
execution_order?: number | null;
|
|
233
|
+
filter?: string | null;
|
|
234
|
+
/**
|
|
235
|
+
* Group by param for run stats.
|
|
236
|
+
*/
|
|
237
|
+
group_by?: SessionsAPI.RunStatsGroupBy | null;
|
|
238
|
+
groups?: Array<string | null> | null;
|
|
239
|
+
is_root?: boolean | null;
|
|
240
|
+
parent_run?: string | null;
|
|
241
|
+
query?: string | null;
|
|
242
|
+
reference_example?: Array<string> | null;
|
|
243
|
+
/**
|
|
244
|
+
* Enum for run types.
|
|
245
|
+
*/
|
|
246
|
+
run_type?: RunTypeEnum | null;
|
|
247
|
+
search_filter?: string | null;
|
|
248
|
+
select?: Array<'run_count' | 'latency_p50' | 'latency_p99' | 'latency_avg' | 'first_token_p50' | 'first_token_p99' | 'total_tokens' | 'prompt_tokens' | 'completion_tokens' | 'median_tokens' | 'completion_tokens_p50' | 'prompt_tokens_p50' | 'tokens_p99' | 'completion_tokens_p99' | 'prompt_tokens_p99' | 'last_run_start_time' | 'feedback_stats' | 'thread_feedback_stats' | 'run_facets' | 'error_rate' | 'streaming_rate' | 'total_cost' | 'prompt_cost' | 'completion_cost' | 'cost_p50' | 'cost_p99' | 'session_feedback_stats' | 'all_run_stats' | 'all_token_stats' | 'prompt_token_details' | 'completion_token_details' | 'prompt_cost_details' | 'completion_cost_details'> | null;
|
|
249
|
+
session?: Array<string> | null;
|
|
250
|
+
skip_pagination?: boolean | null;
|
|
251
|
+
start_time?: string | null;
|
|
252
|
+
trace?: string | null;
|
|
253
|
+
trace_filter?: string | null;
|
|
254
|
+
tree_filter?: string | null;
|
|
255
|
+
use_experimental_search?: boolean;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Enum for run types.
|
|
259
|
+
*/
|
|
260
|
+
export type RunTypeEnum = 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
|
|
261
|
+
/**
|
|
262
|
+
* Enum for run data source types.
|
|
263
|
+
*/
|
|
264
|
+
export type RunsFilterDataSourceTypeEnum = 'current' | 'historical' | 'lite' | 'root_lite' | 'runs_feedbacks_rmt_wide';
|
|
265
|
+
export type RunCreateResponse = {
|
|
266
|
+
[key: string]: RunCreateResponse.item;
|
|
267
|
+
};
|
|
268
|
+
export declare namespace RunCreateResponse {
|
|
269
|
+
interface item {
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export type RunUpdateResponse = {
|
|
273
|
+
[key: string]: RunUpdateResponse.item;
|
|
274
|
+
};
|
|
275
|
+
export declare namespace RunUpdateResponse {
|
|
276
|
+
interface item {
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
export type RunIngestBatchResponse = {
|
|
280
|
+
[key: string]: RunIngestBatchResponse.item;
|
|
281
|
+
};
|
|
282
|
+
export declare namespace RunIngestBatchResponse {
|
|
283
|
+
interface item {
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
export interface RunQueryResponse {
|
|
287
|
+
cursors: {
|
|
288
|
+
[key: string]: string | null;
|
|
289
|
+
};
|
|
290
|
+
runs: Array<RunSchema>;
|
|
291
|
+
parsed_query?: string | null;
|
|
292
|
+
search_cursors?: {
|
|
293
|
+
[key: string]: unknown;
|
|
294
|
+
} | null;
|
|
295
|
+
}
|
|
296
|
+
export type RunStatsResponse = RunStatsResponse.RunStats | {
|
|
297
|
+
[key: string]: RunStatsResponse.RunStats;
|
|
298
|
+
};
|
|
299
|
+
export declare namespace RunStatsResponse {
|
|
300
|
+
interface RunStats {
|
|
301
|
+
completion_cost?: number | null;
|
|
302
|
+
completion_cost_details?: {
|
|
303
|
+
[key: string]: unknown;
|
|
304
|
+
} | null;
|
|
305
|
+
completion_token_details?: {
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
} | null;
|
|
308
|
+
completion_tokens?: number | null;
|
|
309
|
+
completion_tokens_p50?: number | null;
|
|
310
|
+
completion_tokens_p99?: number | null;
|
|
311
|
+
cost_p50?: number | null;
|
|
312
|
+
cost_p99?: number | null;
|
|
313
|
+
error_rate?: number | null;
|
|
314
|
+
feedback_stats?: {
|
|
315
|
+
[key: string]: unknown;
|
|
316
|
+
} | null;
|
|
317
|
+
first_token_p50?: number | null;
|
|
318
|
+
first_token_p99?: number | null;
|
|
319
|
+
last_run_start_time?: string | null;
|
|
320
|
+
latency_p50?: number | null;
|
|
321
|
+
latency_p99?: number | null;
|
|
322
|
+
median_tokens?: number | null;
|
|
323
|
+
prompt_cost?: number | null;
|
|
324
|
+
prompt_cost_details?: {
|
|
325
|
+
[key: string]: unknown;
|
|
326
|
+
} | null;
|
|
327
|
+
prompt_token_details?: {
|
|
328
|
+
[key: string]: unknown;
|
|
329
|
+
} | null;
|
|
330
|
+
prompt_tokens?: number | null;
|
|
331
|
+
prompt_tokens_p50?: number | null;
|
|
332
|
+
prompt_tokens_p99?: number | null;
|
|
333
|
+
run_count?: number | null;
|
|
334
|
+
run_facets?: Array<{
|
|
335
|
+
[key: string]: unknown;
|
|
336
|
+
}> | null;
|
|
337
|
+
streaming_rate?: number | null;
|
|
338
|
+
tokens_p99?: number | null;
|
|
339
|
+
total_cost?: number | null;
|
|
340
|
+
total_tokens?: number | null;
|
|
341
|
+
}
|
|
342
|
+
interface RunStats {
|
|
343
|
+
completion_cost?: number | null;
|
|
344
|
+
completion_cost_details?: {
|
|
345
|
+
[key: string]: unknown;
|
|
346
|
+
} | null;
|
|
347
|
+
completion_token_details?: {
|
|
348
|
+
[key: string]: unknown;
|
|
349
|
+
} | null;
|
|
350
|
+
completion_tokens?: number | null;
|
|
351
|
+
completion_tokens_p50?: number | null;
|
|
352
|
+
completion_tokens_p99?: number | null;
|
|
353
|
+
cost_p50?: number | null;
|
|
354
|
+
cost_p99?: number | null;
|
|
355
|
+
error_rate?: number | null;
|
|
356
|
+
feedback_stats?: {
|
|
357
|
+
[key: string]: unknown;
|
|
358
|
+
} | null;
|
|
359
|
+
first_token_p50?: number | null;
|
|
360
|
+
first_token_p99?: number | null;
|
|
361
|
+
last_run_start_time?: string | null;
|
|
362
|
+
latency_p50?: number | null;
|
|
363
|
+
latency_p99?: number | null;
|
|
364
|
+
median_tokens?: number | null;
|
|
365
|
+
prompt_cost?: number | null;
|
|
366
|
+
prompt_cost_details?: {
|
|
367
|
+
[key: string]: unknown;
|
|
368
|
+
} | null;
|
|
369
|
+
prompt_token_details?: {
|
|
370
|
+
[key: string]: unknown;
|
|
371
|
+
} | null;
|
|
372
|
+
prompt_tokens?: number | null;
|
|
373
|
+
prompt_tokens_p50?: number | null;
|
|
374
|
+
prompt_tokens_p99?: number | null;
|
|
375
|
+
run_count?: number | null;
|
|
376
|
+
run_facets?: Array<{
|
|
377
|
+
[key: string]: unknown;
|
|
378
|
+
}> | null;
|
|
379
|
+
streaming_rate?: number | null;
|
|
380
|
+
tokens_p99?: number | null;
|
|
381
|
+
total_cost?: number | null;
|
|
382
|
+
total_tokens?: number | null;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
export type RunUpdate2Response = unknown;
|
|
386
|
+
export interface RunCreateParams {
|
|
387
|
+
id?: string;
|
|
388
|
+
dotted_order?: string;
|
|
389
|
+
end_time?: string;
|
|
390
|
+
error?: string;
|
|
391
|
+
events?: Array<{
|
|
392
|
+
[key: string]: unknown;
|
|
393
|
+
}>;
|
|
394
|
+
extra?: {
|
|
395
|
+
[key: string]: unknown;
|
|
396
|
+
};
|
|
397
|
+
input_attachments?: {
|
|
398
|
+
[key: string]: unknown;
|
|
399
|
+
};
|
|
400
|
+
inputs?: {
|
|
401
|
+
[key: string]: unknown;
|
|
402
|
+
};
|
|
403
|
+
name?: string;
|
|
404
|
+
output_attachments?: {
|
|
405
|
+
[key: string]: unknown;
|
|
406
|
+
};
|
|
407
|
+
outputs?: {
|
|
408
|
+
[key: string]: unknown;
|
|
409
|
+
};
|
|
410
|
+
parent_run_id?: string;
|
|
411
|
+
reference_example_id?: string;
|
|
412
|
+
run_type?: 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
|
|
413
|
+
serialized?: {
|
|
414
|
+
[key: string]: unknown;
|
|
415
|
+
};
|
|
416
|
+
session_id?: string;
|
|
417
|
+
session_name?: string;
|
|
418
|
+
start_time?: string;
|
|
419
|
+
status?: string;
|
|
420
|
+
tags?: Array<string>;
|
|
421
|
+
trace_id?: string;
|
|
422
|
+
}
|
|
423
|
+
export interface RunRetrieveParams {
|
|
424
|
+
exclude_s3_stored_attributes?: boolean;
|
|
425
|
+
exclude_serialized?: boolean;
|
|
426
|
+
include_messages?: boolean;
|
|
427
|
+
session_id?: string | null;
|
|
428
|
+
start_time?: string | null;
|
|
429
|
+
}
|
|
430
|
+
export interface RunUpdateParams {
|
|
431
|
+
id?: string;
|
|
432
|
+
dotted_order?: string;
|
|
433
|
+
end_time?: string;
|
|
434
|
+
error?: string;
|
|
435
|
+
events?: Array<{
|
|
436
|
+
[key: string]: unknown;
|
|
437
|
+
}>;
|
|
438
|
+
extra?: {
|
|
439
|
+
[key: string]: unknown;
|
|
440
|
+
};
|
|
441
|
+
input_attachments?: {
|
|
442
|
+
[key: string]: unknown;
|
|
443
|
+
};
|
|
444
|
+
inputs?: {
|
|
445
|
+
[key: string]: unknown;
|
|
446
|
+
};
|
|
447
|
+
name?: string;
|
|
448
|
+
output_attachments?: {
|
|
449
|
+
[key: string]: unknown;
|
|
450
|
+
};
|
|
451
|
+
outputs?: {
|
|
452
|
+
[key: string]: unknown;
|
|
453
|
+
};
|
|
454
|
+
parent_run_id?: string;
|
|
455
|
+
reference_example_id?: string;
|
|
456
|
+
run_type?: 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
|
|
457
|
+
serialized?: {
|
|
458
|
+
[key: string]: unknown;
|
|
459
|
+
};
|
|
460
|
+
session_id?: string;
|
|
461
|
+
session_name?: string;
|
|
462
|
+
start_time?: string;
|
|
463
|
+
status?: string;
|
|
464
|
+
tags?: Array<string>;
|
|
465
|
+
trace_id?: string;
|
|
466
|
+
}
|
|
467
|
+
export interface RunIngestBatchParams {
|
|
468
|
+
patch?: Array<Run>;
|
|
469
|
+
post?: Array<Run>;
|
|
470
|
+
}
|
|
471
|
+
export interface RunQueryParams {
|
|
472
|
+
id?: Array<string> | null;
|
|
473
|
+
cursor?: string | null;
|
|
474
|
+
/**
|
|
475
|
+
* Enum for run data source types.
|
|
476
|
+
*/
|
|
477
|
+
data_source_type?: RunsFilterDataSourceTypeEnum | null;
|
|
478
|
+
end_time?: string | null;
|
|
479
|
+
error?: boolean | null;
|
|
480
|
+
execution_order?: number | null;
|
|
481
|
+
filter?: string | null;
|
|
482
|
+
is_root?: boolean | null;
|
|
483
|
+
limit?: number;
|
|
484
|
+
/**
|
|
485
|
+
* Enum for run start date order.
|
|
486
|
+
*/
|
|
487
|
+
order?: 'asc' | 'desc';
|
|
488
|
+
parent_run?: string | null;
|
|
489
|
+
query?: string | null;
|
|
490
|
+
reference_example?: Array<string> | null;
|
|
491
|
+
/**
|
|
492
|
+
* Enum for run types.
|
|
493
|
+
*/
|
|
494
|
+
run_type?: RunTypeEnum | null;
|
|
495
|
+
search_filter?: string | null;
|
|
496
|
+
select?: Array<'id' | 'name' | 'run_type' | 'start_time' | 'end_time' | 'status' | 'error' | 'extra' | 'events' | 'inputs' | 'inputs_preview' | 'inputs_s3_urls' | 'inputs_or_signed_url' | 'outputs' | 'outputs_preview' | 'outputs_s3_urls' | 'outputs_or_signed_url' | 's3_urls' | 'error_or_signed_url' | 'events_or_signed_url' | 'extra_or_signed_url' | 'serialized_or_signed_url' | 'parent_run_id' | 'manifest_id' | 'manifest_s3_id' | 'manifest' | 'session_id' | 'serialized' | 'reference_example_id' | 'reference_dataset_id' | 'total_tokens' | 'prompt_tokens' | 'prompt_token_details' | 'completion_tokens' | 'completion_token_details' | 'total_cost' | 'prompt_cost' | 'prompt_cost_details' | 'completion_cost' | 'completion_cost_details' | 'price_model_id' | 'first_token_time' | 'trace_id' | 'dotted_order' | 'last_queued_at' | 'feedback_stats' | 'child_run_ids' | 'parent_run_ids' | 'tags' | 'in_dataset' | 'app_path' | 'share_token' | 'trace_tier' | 'trace_first_received_at' | 'ttl_seconds' | 'trace_upgrade' | 'thread_id' | 'trace_min_max_start_time' | 'messages' | 'inserted_at'>;
|
|
497
|
+
session?: Array<string> | null;
|
|
498
|
+
skip_pagination?: boolean | null;
|
|
499
|
+
skip_prev_cursor?: boolean;
|
|
500
|
+
start_time?: string | null;
|
|
501
|
+
trace?: string | null;
|
|
502
|
+
trace_filter?: string | null;
|
|
503
|
+
tree_filter?: string | null;
|
|
504
|
+
use_experimental_search?: boolean;
|
|
505
|
+
}
|
|
506
|
+
export interface RunStatsParams {
|
|
507
|
+
id?: Array<string> | null;
|
|
508
|
+
/**
|
|
509
|
+
* Enum for run data source types.
|
|
510
|
+
*/
|
|
511
|
+
data_source_type?: RunsFilterDataSourceTypeEnum | null;
|
|
512
|
+
end_time?: string | null;
|
|
513
|
+
error?: boolean | null;
|
|
514
|
+
execution_order?: number | null;
|
|
515
|
+
filter?: string | null;
|
|
516
|
+
/**
|
|
517
|
+
* Group by param for run stats.
|
|
518
|
+
*/
|
|
519
|
+
group_by?: SessionsAPI.RunStatsGroupBy | null;
|
|
520
|
+
groups?: Array<string | null> | null;
|
|
521
|
+
is_root?: boolean | null;
|
|
522
|
+
parent_run?: string | null;
|
|
523
|
+
query?: string | null;
|
|
524
|
+
reference_example?: Array<string> | null;
|
|
525
|
+
/**
|
|
526
|
+
* Enum for run types.
|
|
527
|
+
*/
|
|
528
|
+
run_type?: RunTypeEnum | null;
|
|
529
|
+
search_filter?: string | null;
|
|
530
|
+
select?: Array<'run_count' | 'latency_p50' | 'latency_p99' | 'latency_avg' | 'first_token_p50' | 'first_token_p99' | 'total_tokens' | 'prompt_tokens' | 'completion_tokens' | 'median_tokens' | 'completion_tokens_p50' | 'prompt_tokens_p50' | 'tokens_p99' | 'completion_tokens_p99' | 'prompt_tokens_p99' | 'last_run_start_time' | 'feedback_stats' | 'thread_feedback_stats' | 'run_facets' | 'error_rate' | 'streaming_rate' | 'total_cost' | 'prompt_cost' | 'completion_cost' | 'cost_p50' | 'cost_p99' | 'session_feedback_stats' | 'all_run_stats' | 'all_token_stats' | 'prompt_token_details' | 'completion_token_details' | 'prompt_cost_details' | 'completion_cost_details'> | null;
|
|
531
|
+
session?: Array<string> | null;
|
|
532
|
+
skip_pagination?: boolean | null;
|
|
533
|
+
start_time?: string | null;
|
|
534
|
+
trace?: string | null;
|
|
535
|
+
trace_filter?: string | null;
|
|
536
|
+
tree_filter?: string | null;
|
|
537
|
+
use_experimental_search?: boolean;
|
|
538
|
+
}
|
|
539
|
+
export declare namespace Runs {
|
|
540
|
+
export { type BodyParamsForRunSchema as BodyParamsForRunSchema, type RequestBodyForRunsGenerateQuery as RequestBodyForRunsGenerateQuery, type ResponseBodyForRunsGenerateQuery as ResponseBodyForRunsGenerateQuery, type Run as Run, type RunSchema as RunSchema, type RunStatsQueryParams as RunStatsQueryParams, type RunTypeEnum as RunTypeEnum, type RunsFilterDataSourceTypeEnum as RunsFilterDataSourceTypeEnum, type RunCreateResponse as RunCreateResponse, type RunUpdateResponse as RunUpdateResponse, type RunIngestBatchResponse as RunIngestBatchResponse, type RunQueryResponse as RunQueryResponse, type RunStatsResponse as RunStatsResponse, type RunUpdate2Response as RunUpdate2Response, type RunCreateParams as RunCreateParams, type RunRetrieveParams as RunRetrieveParams, type RunUpdateParams as RunUpdateParams, type RunIngestBatchParams as RunIngestBatchParams, type RunQueryParams as RunQueryParams, type RunStatsParams as RunStatsParams, };
|
|
541
|
+
export { Rules as Rules };
|
|
542
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
import { APIResource } from '../../core/resource.js';
|
|
4
|
+
import * as RulesAPI from './rules.js';
|
|
5
|
+
import { Rules } from './rules.js';
|
|
6
|
+
import { path } from '../../internal/utils/path.js';
|
|
7
|
+
export class Runs extends APIResource {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
Object.defineProperty(this, "rules", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
configurable: true,
|
|
13
|
+
writable: true,
|
|
14
|
+
value: new RulesAPI.Rules(this._client)
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Queues a single run for ingestion. The request body must be a JSON-encoded run
|
|
19
|
+
* object that follows the Run schema.
|
|
20
|
+
*/
|
|
21
|
+
create(body, options) {
|
|
22
|
+
return this._client.post('/runs', { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get a specific run.
|
|
26
|
+
*/
|
|
27
|
+
retrieve(runID, query = {}, options) {
|
|
28
|
+
return this._client.get(path `/api/v1/runs/${runID}`, { query, ...options });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Updates a run identified by its ID. The body should contain only the fields to
|
|
32
|
+
* be changed; unknown fields are ignored.
|
|
33
|
+
*/
|
|
34
|
+
update(runID, body, options) {
|
|
35
|
+
return this._client.patch(path `/runs/${runID}`, { body, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Ingests a batch of runs in a single JSON payload. The payload must have `post`
|
|
39
|
+
* and/or `patch` arrays containing run objects. Prefer this endpoint over
|
|
40
|
+
* single‑run ingestion when submitting hundreds of runs, but `/runs/multipart`
|
|
41
|
+
* offers better handling for very large fields and attachments.
|
|
42
|
+
*/
|
|
43
|
+
ingestBatch(body, options) {
|
|
44
|
+
return this._client.post('/runs/batch', { body, ...options });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Query Runs
|
|
48
|
+
*/
|
|
49
|
+
query(body, options) {
|
|
50
|
+
return this._client.post('/api/v1/runs/query', { body, ...options });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get all runs by query in body payload.
|
|
54
|
+
*/
|
|
55
|
+
stats(body, options) {
|
|
56
|
+
return this._client.post('/api/v1/runs/stats', { body, ...options });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Update a run.
|
|
60
|
+
*/
|
|
61
|
+
update2(runID, options) {
|
|
62
|
+
return this._client.patch(path `/api/v1/runs/${runID}`, options);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
Runs.Rules = Rules;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Boxes = void 0;
|
|
6
|
+
const resource_js_1 = require("../../core/resource.cjs");
|
|
7
|
+
const headers_js_1 = require("../../internal/headers.cjs");
|
|
8
|
+
const path_js_1 = require("../../internal/utils/path.cjs");
|
|
9
|
+
class Boxes extends resource_js_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new sandbox from a snapshot. Provide at most one of `snapshot_id` or
|
|
12
|
+
* `snapshot_name`; if neither is provided, the server uses the default static
|
|
13
|
+
* blueprint.
|
|
14
|
+
*/
|
|
15
|
+
create(body, options) {
|
|
16
|
+
return this._client.post('/v2/sandboxes/boxes', { body, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve a sandbox by name. Stale provisioning sandboxes are auto-failed.
|
|
20
|
+
*/
|
|
21
|
+
retrieve(name, options) {
|
|
22
|
+
return this._client.get((0, path_js_1.path) `/v2/sandboxes/boxes/${name}`, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a sandbox's display name. The name must be unique within the tenant.
|
|
26
|
+
*/
|
|
27
|
+
update(name, body, options) {
|
|
28
|
+
return this._client.patch((0, path_js_1.path) `/v2/sandboxes/boxes/${name}`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List sandboxes for the authenticated tenant, with optional filtering, sorting,
|
|
32
|
+
* and pagination.
|
|
33
|
+
*/
|
|
34
|
+
list(query = {}, options) {
|
|
35
|
+
return this._client.get('/v2/sandboxes/boxes', { query, ...options });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Delete a sandbox by name or UUID. Tears down the sandbox runtime and removes the
|
|
39
|
+
* DB record.
|
|
40
|
+
*/
|
|
41
|
+
delete(name, options) {
|
|
42
|
+
return this._client.delete((0, path_js_1.path) `/v2/sandboxes/boxes/${name}`, {
|
|
43
|
+
...options,
|
|
44
|
+
headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create a snapshot by capturing the current state of a sandbox or promoting an
|
|
49
|
+
* existing checkpoint.
|
|
50
|
+
*/
|
|
51
|
+
createSnapshot(name, body, options) {
|
|
52
|
+
return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/snapshot`, { body, ...options });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a short-lived JWT for accessing an HTTP service running on a specific
|
|
56
|
+
* port inside a sandbox. Returns a browser_url (sets auth cookie via redirect), a
|
|
57
|
+
* service_url (for use with the X-Langsmith-Sandbox-Service-Token header), the raw
|
|
58
|
+
* token, and its expiry.
|
|
59
|
+
*/
|
|
60
|
+
generateServiceURL(name, body, options) {
|
|
61
|
+
return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/service-url`, { body, ...options });
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Retrieve the lightweight status of a sandbox for polling.
|
|
65
|
+
*/
|
|
66
|
+
getStatus(name, options) {
|
|
67
|
+
return this._client.get((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/status`, options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Start a stopped or failed sandbox. This endpoint is not idempotent.
|
|
71
|
+
*/
|
|
72
|
+
start(name, options) {
|
|
73
|
+
return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/start`, options);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Stop a ready sandbox. This endpoint is not idempotent; the filesystem is
|
|
77
|
+
* preserved for later restart.
|
|
78
|
+
*/
|
|
79
|
+
stop(name, options) {
|
|
80
|
+
return this._client.post((0, path_js_1.path) `/v2/sandboxes/boxes/${name}/stop`, {
|
|
81
|
+
...options,
|
|
82
|
+
headers: (0, headers_js_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.Boxes = Boxes;
|