opik 1.7.28 → 1.7.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Client-C7xyHzcm.d.cts → Client-CB3-ejaS.d.cts} +106 -14
- package/dist/{Client-C7xyHzcm.d.ts → Client-CB3-ejaS.d.ts} +106 -14
- package/dist/chunk-PEQD6RFM.js +4 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/vercel/index.cjs +4 -4
- package/dist/vercel/index.d.cts +1 -1
- package/dist/vercel/index.d.ts +1 -1
- package/dist/vercel/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2JWQNC3A.js +0 -4
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import * as stream from 'stream';
|
|
2
2
|
|
|
3
|
-
interface OpikConfig {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
apiUrl?: string;
|
|
6
|
-
projectName: string;
|
|
7
|
-
workspaceName: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
3
|
/**
|
|
11
4
|
* This file was auto-generated by Fern from our API Definition.
|
|
12
5
|
*/
|
|
@@ -1196,6 +1189,7 @@ interface GetTraceThreadsRequest {
|
|
|
1196
1189
|
projectId?: string;
|
|
1197
1190
|
truncate?: boolean;
|
|
1198
1191
|
filters?: string;
|
|
1192
|
+
sorting?: string;
|
|
1199
1193
|
}
|
|
1200
1194
|
|
|
1201
1195
|
/**
|
|
@@ -1247,6 +1241,24 @@ interface ExperimentsRedirectRequest {
|
|
|
1247
1241
|
path: string;
|
|
1248
1242
|
}
|
|
1249
1243
|
|
|
1244
|
+
/**
|
|
1245
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
1246
|
+
*/
|
|
1247
|
+
/**
|
|
1248
|
+
* @example
|
|
1249
|
+
* {
|
|
1250
|
+
* datasetId: "dataset_id",
|
|
1251
|
+
* optimizationId: "optimization_id",
|
|
1252
|
+
* path: "path"
|
|
1253
|
+
* }
|
|
1254
|
+
*/
|
|
1255
|
+
interface OptimizationsRedirectRequest {
|
|
1256
|
+
datasetId: string;
|
|
1257
|
+
optimizationId: string;
|
|
1258
|
+
workspaceName?: string;
|
|
1259
|
+
path: string;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1250
1262
|
/**
|
|
1251
1263
|
* This file was auto-generated by Fern from our API Definition.
|
|
1252
1264
|
*/
|
|
@@ -1962,6 +1974,15 @@ interface Comment {
|
|
|
1962
1974
|
lastUpdatedBy?: string;
|
|
1963
1975
|
}
|
|
1964
1976
|
|
|
1977
|
+
/**
|
|
1978
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
1979
|
+
*/
|
|
1980
|
+
type ExperimentItemTraceVisibilityMode = "default" | "hidden";
|
|
1981
|
+
declare const ExperimentItemTraceVisibilityMode: {
|
|
1982
|
+
readonly Default: "default";
|
|
1983
|
+
readonly Hidden: "hidden";
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1965
1986
|
/**
|
|
1966
1987
|
* This file was auto-generated by Fern from our API Definition.
|
|
1967
1988
|
*/
|
|
@@ -1982,6 +2003,7 @@ interface ExperimentItem {
|
|
|
1982
2003
|
lastUpdatedAt?: Date;
|
|
1983
2004
|
createdBy?: string;
|
|
1984
2005
|
lastUpdatedBy?: string;
|
|
2006
|
+
traceVisibilityMode?: ExperimentItemTraceVisibilityMode;
|
|
1985
2007
|
}
|
|
1986
2008
|
|
|
1987
2009
|
/**
|
|
@@ -2116,6 +2138,15 @@ interface DatasetItemCompare {
|
|
|
2116
2138
|
lastUpdatedBy?: string;
|
|
2117
2139
|
}
|
|
2118
2140
|
|
|
2141
|
+
/**
|
|
2142
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
2143
|
+
*/
|
|
2144
|
+
type ExperimentItemCompareTraceVisibilityMode = "default" | "hidden";
|
|
2145
|
+
declare const ExperimentItemCompareTraceVisibilityMode: {
|
|
2146
|
+
readonly Default: "default";
|
|
2147
|
+
readonly Hidden: "hidden";
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2119
2150
|
/**
|
|
2120
2151
|
* This file was auto-generated by Fern from our API Definition.
|
|
2121
2152
|
*/
|
|
@@ -2136,6 +2167,7 @@ interface ExperimentItemCompare {
|
|
|
2136
2167
|
lastUpdatedAt?: Date;
|
|
2137
2168
|
createdBy?: string;
|
|
2138
2169
|
lastUpdatedBy?: string;
|
|
2170
|
+
traceVisibilityMode?: ExperimentItemCompareTraceVisibilityMode;
|
|
2139
2171
|
}
|
|
2140
2172
|
|
|
2141
2173
|
/**
|
|
@@ -2243,6 +2275,16 @@ interface DatasetItemPublic {
|
|
|
2243
2275
|
/**
|
|
2244
2276
|
* This file was auto-generated by Fern from our API Definition.
|
|
2245
2277
|
*/
|
|
2278
|
+
type ExperimentItemPublicTraceVisibilityMode = "default" | "hidden";
|
|
2279
|
+
declare const ExperimentItemPublicTraceVisibilityMode: {
|
|
2280
|
+
readonly Default: "default";
|
|
2281
|
+
readonly Hidden: "hidden";
|
|
2282
|
+
};
|
|
2283
|
+
|
|
2284
|
+
/**
|
|
2285
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
2286
|
+
*/
|
|
2287
|
+
|
|
2246
2288
|
interface ExperimentItemPublic {
|
|
2247
2289
|
id?: string;
|
|
2248
2290
|
experimentId: string;
|
|
@@ -2252,6 +2294,7 @@ interface ExperimentItemPublic {
|
|
|
2252
2294
|
lastUpdatedAt?: Date;
|
|
2253
2295
|
createdBy?: string;
|
|
2254
2296
|
lastUpdatedBy?: string;
|
|
2297
|
+
traceVisibilityMode?: ExperimentItemPublicTraceVisibilityMode;
|
|
2255
2298
|
}
|
|
2256
2299
|
|
|
2257
2300
|
/**
|
|
@@ -2496,6 +2539,7 @@ interface Trace$1 {
|
|
|
2496
2539
|
duration?: number;
|
|
2497
2540
|
threadId?: string;
|
|
2498
2541
|
visibilityMode?: TraceVisibilityMode;
|
|
2542
|
+
llmSpanCount?: number;
|
|
2499
2543
|
}
|
|
2500
2544
|
|
|
2501
2545
|
/**
|
|
@@ -2513,6 +2557,7 @@ interface ErrorInfoExperimentItemBulkWriteView {
|
|
|
2513
2557
|
|
|
2514
2558
|
interface ExperimentItemBulkRecordExperimentItemBulkWriteView {
|
|
2515
2559
|
datasetItemId: string;
|
|
2560
|
+
evaluateTaskResult?: JsonListStringExperimentItemBulkWriteView;
|
|
2516
2561
|
trace?: TraceExperimentItemBulkWriteView;
|
|
2517
2562
|
spans?: SpanExperimentItemBulkWriteView[];
|
|
2518
2563
|
feedbackScores?: FeedbackScoreExperimentItemBulkWriteView[];
|
|
@@ -2593,6 +2638,9 @@ interface SpanExperimentItemBulkWriteView {
|
|
|
2593
2638
|
* This file was auto-generated by Fern from our API Definition.
|
|
2594
2639
|
*/
|
|
2595
2640
|
|
|
2641
|
+
/**
|
|
2642
|
+
* Please provide either none, only one of evaluate_task_result or trace, but never both
|
|
2643
|
+
*/
|
|
2596
2644
|
interface TraceExperimentItemBulkWriteView {
|
|
2597
2645
|
id?: string;
|
|
2598
2646
|
/** If null, the default project is used */
|
|
@@ -3691,6 +3739,7 @@ interface TracePublic {
|
|
|
3691
3739
|
duration?: number;
|
|
3692
3740
|
threadId?: string;
|
|
3693
3741
|
visibilityMode?: TracePublicVisibilityMode;
|
|
3742
|
+
llmSpanCount?: number;
|
|
3694
3743
|
}
|
|
3695
3744
|
|
|
3696
3745
|
/**
|
|
@@ -3706,6 +3755,8 @@ interface TraceThread {
|
|
|
3706
3755
|
firstMessage?: JsonNode;
|
|
3707
3756
|
lastMessage?: JsonNode;
|
|
3708
3757
|
numberOfMessages?: number;
|
|
3758
|
+
totalEstimatedCost?: number;
|
|
3759
|
+
usage?: Record<string, number>;
|
|
3709
3760
|
lastUpdatedAt?: Date;
|
|
3710
3761
|
createdBy?: string;
|
|
3711
3762
|
createdAt?: Date;
|
|
@@ -3720,6 +3771,7 @@ interface TraceThreadPage {
|
|
|
3720
3771
|
size?: number;
|
|
3721
3772
|
total?: number;
|
|
3722
3773
|
content?: TraceThread[];
|
|
3774
|
+
sortableBy?: string[];
|
|
3723
3775
|
}
|
|
3724
3776
|
|
|
3725
3777
|
/**
|
|
@@ -6229,6 +6281,24 @@ declare class Redirect {
|
|
|
6229
6281
|
*/
|
|
6230
6282
|
experimentsRedirect(request: ExperimentsRedirectRequest, requestOptions?: Redirect.RequestOptions): HttpResponsePromise<void>;
|
|
6231
6283
|
private __experimentsRedirect;
|
|
6284
|
+
/**
|
|
6285
|
+
* Create optimization redirect url
|
|
6286
|
+
*
|
|
6287
|
+
* @param {OpikApi.OptimizationsRedirectRequest} request
|
|
6288
|
+
* @param {Redirect.RequestOptions} requestOptions - Request-specific configuration.
|
|
6289
|
+
*
|
|
6290
|
+
* @throws {@link OpikApi.BadRequestError}
|
|
6291
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
6292
|
+
*
|
|
6293
|
+
* @example
|
|
6294
|
+
* await client.redirect.optimizationsRedirect({
|
|
6295
|
+
* datasetId: "dataset_id",
|
|
6296
|
+
* optimizationId: "optimization_id",
|
|
6297
|
+
* path: "path"
|
|
6298
|
+
* })
|
|
6299
|
+
*/
|
|
6300
|
+
optimizationsRedirect(request: OptimizationsRedirectRequest, requestOptions?: Redirect.RequestOptions): HttpResponsePromise<void>;
|
|
6301
|
+
private __optimizationsRedirect;
|
|
6232
6302
|
/**
|
|
6233
6303
|
* Create project redirect url
|
|
6234
6304
|
*
|
|
@@ -6340,6 +6410,19 @@ declare class OpikApiClient {
|
|
|
6340
6410
|
}>;
|
|
6341
6411
|
}
|
|
6342
6412
|
|
|
6413
|
+
type RequestOptions = OpikApiClient.RequestOptions;
|
|
6414
|
+
|
|
6415
|
+
interface OpikConfig {
|
|
6416
|
+
apiKey: string;
|
|
6417
|
+
apiUrl?: string;
|
|
6418
|
+
projectName: string;
|
|
6419
|
+
workspaceName: string;
|
|
6420
|
+
requestOptions?: RequestOptions;
|
|
6421
|
+
}
|
|
6422
|
+
interface ConstructorOpikConfig extends OpikConfig {
|
|
6423
|
+
headers?: Record<string, string>;
|
|
6424
|
+
}
|
|
6425
|
+
|
|
6343
6426
|
interface SavedSpan extends Span$1 {
|
|
6344
6427
|
id: string;
|
|
6345
6428
|
}
|
|
@@ -6406,12 +6489,21 @@ declare abstract class BatchQueue<EntityData = object, EntityId = string> {
|
|
|
6406
6489
|
flush: () => Promise<void>;
|
|
6407
6490
|
}
|
|
6408
6491
|
|
|
6492
|
+
interface OpikApiClientTempOptions extends OpikApiClient.Options {
|
|
6493
|
+
requestOptions?: RequestOptions;
|
|
6494
|
+
}
|
|
6495
|
+
declare class OpikApiClientTemp extends OpikApiClient {
|
|
6496
|
+
requestOptions: RequestOptions;
|
|
6497
|
+
constructor(options?: OpikApiClientTempOptions);
|
|
6498
|
+
setHeaders: (headers: Record<string, string>) => void;
|
|
6499
|
+
}
|
|
6500
|
+
|
|
6409
6501
|
type SpanUpdate = Partial<SavedSpan> & {
|
|
6410
6502
|
traceId: string;
|
|
6411
6503
|
};
|
|
6412
6504
|
declare class SpanBatchQueue extends BatchQueue<SavedSpan> {
|
|
6413
6505
|
private readonly api;
|
|
6414
|
-
constructor(api:
|
|
6506
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6415
6507
|
protected getId(entity: SavedSpan): string;
|
|
6416
6508
|
protected createEntities(spans: SavedSpan[]): Promise<void>;
|
|
6417
6509
|
protected getEntity(id: string): Promise<SavedSpan>;
|
|
@@ -6425,7 +6517,7 @@ type FeedbackScoreId$1 = {
|
|
|
6425
6517
|
};
|
|
6426
6518
|
declare class SpanFeedbackScoresBatchQueue extends BatchQueue<FeedbackScoreBatchItem, FeedbackScoreId$1> {
|
|
6427
6519
|
private readonly api;
|
|
6428
|
-
constructor(api:
|
|
6520
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6429
6521
|
protected getId(entity: FeedbackScoreBatchItem): {
|
|
6430
6522
|
id: string;
|
|
6431
6523
|
name: string;
|
|
@@ -6438,7 +6530,7 @@ declare class SpanFeedbackScoresBatchQueue extends BatchQueue<FeedbackScoreBatch
|
|
|
6438
6530
|
|
|
6439
6531
|
declare class TraceBatchQueue extends BatchQueue<SavedTrace> {
|
|
6440
6532
|
private readonly api;
|
|
6441
|
-
constructor(api:
|
|
6533
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6442
6534
|
protected getId(entity: SavedTrace): string;
|
|
6443
6535
|
protected createEntities(traces: SavedTrace[]): Promise<void>;
|
|
6444
6536
|
protected getEntity(id: string): Promise<SavedTrace>;
|
|
@@ -6452,7 +6544,7 @@ type FeedbackScoreId = {
|
|
|
6452
6544
|
};
|
|
6453
6545
|
declare class TraceFeedbackScoresBatchQueue extends BatchQueue<FeedbackScoreBatchItem, FeedbackScoreId> {
|
|
6454
6546
|
private readonly api;
|
|
6455
|
-
constructor(api:
|
|
6547
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6456
6548
|
protected getId(entity: FeedbackScoreBatchItem): {
|
|
6457
6549
|
id: string;
|
|
6458
6550
|
name: string;
|
|
@@ -6475,7 +6567,7 @@ declare class DatasetBatchQueue extends BatchQueue<DatasetWrite> {
|
|
|
6475
6567
|
* @param api The OpikApiClient instance used to communicate with the API
|
|
6476
6568
|
* @param delay Optional delay in milliseconds before flushing the queue (defaults to 300ms)
|
|
6477
6569
|
*/
|
|
6478
|
-
constructor(api:
|
|
6570
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6479
6571
|
/**
|
|
6480
6572
|
* Gets the ID of a dataset entity.
|
|
6481
6573
|
*
|
|
@@ -6594,7 +6686,7 @@ interface TraceData extends Omit<Trace$1, "startTime"> {
|
|
|
6594
6686
|
startTime?: Date;
|
|
6595
6687
|
}
|
|
6596
6688
|
declare class OpikClient {
|
|
6597
|
-
api:
|
|
6689
|
+
api: OpikApiClientTemp;
|
|
6598
6690
|
config: OpikConfig;
|
|
6599
6691
|
spanBatchQueue: SpanBatchQueue;
|
|
6600
6692
|
traceBatchQueue: TraceBatchQueue;
|
|
@@ -6602,7 +6694,7 @@ declare class OpikClient {
|
|
|
6602
6694
|
traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
|
|
6603
6695
|
datasetBatchQueue: DatasetBatchQueue;
|
|
6604
6696
|
private lastProjectNameLogged;
|
|
6605
|
-
constructor(explicitConfig?: Partial<
|
|
6697
|
+
constructor(explicitConfig?: Partial<ConstructorOpikConfig>);
|
|
6606
6698
|
private displayTraceLog;
|
|
6607
6699
|
trace: (traceData: TraceData) => Trace;
|
|
6608
6700
|
/**
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import * as stream from 'stream';
|
|
2
2
|
|
|
3
|
-
interface OpikConfig {
|
|
4
|
-
apiKey: string;
|
|
5
|
-
apiUrl?: string;
|
|
6
|
-
projectName: string;
|
|
7
|
-
workspaceName: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
3
|
/**
|
|
11
4
|
* This file was auto-generated by Fern from our API Definition.
|
|
12
5
|
*/
|
|
@@ -1196,6 +1189,7 @@ interface GetTraceThreadsRequest {
|
|
|
1196
1189
|
projectId?: string;
|
|
1197
1190
|
truncate?: boolean;
|
|
1198
1191
|
filters?: string;
|
|
1192
|
+
sorting?: string;
|
|
1199
1193
|
}
|
|
1200
1194
|
|
|
1201
1195
|
/**
|
|
@@ -1247,6 +1241,24 @@ interface ExperimentsRedirectRequest {
|
|
|
1247
1241
|
path: string;
|
|
1248
1242
|
}
|
|
1249
1243
|
|
|
1244
|
+
/**
|
|
1245
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
1246
|
+
*/
|
|
1247
|
+
/**
|
|
1248
|
+
* @example
|
|
1249
|
+
* {
|
|
1250
|
+
* datasetId: "dataset_id",
|
|
1251
|
+
* optimizationId: "optimization_id",
|
|
1252
|
+
* path: "path"
|
|
1253
|
+
* }
|
|
1254
|
+
*/
|
|
1255
|
+
interface OptimizationsRedirectRequest {
|
|
1256
|
+
datasetId: string;
|
|
1257
|
+
optimizationId: string;
|
|
1258
|
+
workspaceName?: string;
|
|
1259
|
+
path: string;
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1250
1262
|
/**
|
|
1251
1263
|
* This file was auto-generated by Fern from our API Definition.
|
|
1252
1264
|
*/
|
|
@@ -1962,6 +1974,15 @@ interface Comment {
|
|
|
1962
1974
|
lastUpdatedBy?: string;
|
|
1963
1975
|
}
|
|
1964
1976
|
|
|
1977
|
+
/**
|
|
1978
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
1979
|
+
*/
|
|
1980
|
+
type ExperimentItemTraceVisibilityMode = "default" | "hidden";
|
|
1981
|
+
declare const ExperimentItemTraceVisibilityMode: {
|
|
1982
|
+
readonly Default: "default";
|
|
1983
|
+
readonly Hidden: "hidden";
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1965
1986
|
/**
|
|
1966
1987
|
* This file was auto-generated by Fern from our API Definition.
|
|
1967
1988
|
*/
|
|
@@ -1982,6 +2003,7 @@ interface ExperimentItem {
|
|
|
1982
2003
|
lastUpdatedAt?: Date;
|
|
1983
2004
|
createdBy?: string;
|
|
1984
2005
|
lastUpdatedBy?: string;
|
|
2006
|
+
traceVisibilityMode?: ExperimentItemTraceVisibilityMode;
|
|
1985
2007
|
}
|
|
1986
2008
|
|
|
1987
2009
|
/**
|
|
@@ -2116,6 +2138,15 @@ interface DatasetItemCompare {
|
|
|
2116
2138
|
lastUpdatedBy?: string;
|
|
2117
2139
|
}
|
|
2118
2140
|
|
|
2141
|
+
/**
|
|
2142
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
2143
|
+
*/
|
|
2144
|
+
type ExperimentItemCompareTraceVisibilityMode = "default" | "hidden";
|
|
2145
|
+
declare const ExperimentItemCompareTraceVisibilityMode: {
|
|
2146
|
+
readonly Default: "default";
|
|
2147
|
+
readonly Hidden: "hidden";
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2119
2150
|
/**
|
|
2120
2151
|
* This file was auto-generated by Fern from our API Definition.
|
|
2121
2152
|
*/
|
|
@@ -2136,6 +2167,7 @@ interface ExperimentItemCompare {
|
|
|
2136
2167
|
lastUpdatedAt?: Date;
|
|
2137
2168
|
createdBy?: string;
|
|
2138
2169
|
lastUpdatedBy?: string;
|
|
2170
|
+
traceVisibilityMode?: ExperimentItemCompareTraceVisibilityMode;
|
|
2139
2171
|
}
|
|
2140
2172
|
|
|
2141
2173
|
/**
|
|
@@ -2243,6 +2275,16 @@ interface DatasetItemPublic {
|
|
|
2243
2275
|
/**
|
|
2244
2276
|
* This file was auto-generated by Fern from our API Definition.
|
|
2245
2277
|
*/
|
|
2278
|
+
type ExperimentItemPublicTraceVisibilityMode = "default" | "hidden";
|
|
2279
|
+
declare const ExperimentItemPublicTraceVisibilityMode: {
|
|
2280
|
+
readonly Default: "default";
|
|
2281
|
+
readonly Hidden: "hidden";
|
|
2282
|
+
};
|
|
2283
|
+
|
|
2284
|
+
/**
|
|
2285
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
2286
|
+
*/
|
|
2287
|
+
|
|
2246
2288
|
interface ExperimentItemPublic {
|
|
2247
2289
|
id?: string;
|
|
2248
2290
|
experimentId: string;
|
|
@@ -2252,6 +2294,7 @@ interface ExperimentItemPublic {
|
|
|
2252
2294
|
lastUpdatedAt?: Date;
|
|
2253
2295
|
createdBy?: string;
|
|
2254
2296
|
lastUpdatedBy?: string;
|
|
2297
|
+
traceVisibilityMode?: ExperimentItemPublicTraceVisibilityMode;
|
|
2255
2298
|
}
|
|
2256
2299
|
|
|
2257
2300
|
/**
|
|
@@ -2496,6 +2539,7 @@ interface Trace$1 {
|
|
|
2496
2539
|
duration?: number;
|
|
2497
2540
|
threadId?: string;
|
|
2498
2541
|
visibilityMode?: TraceVisibilityMode;
|
|
2542
|
+
llmSpanCount?: number;
|
|
2499
2543
|
}
|
|
2500
2544
|
|
|
2501
2545
|
/**
|
|
@@ -2513,6 +2557,7 @@ interface ErrorInfoExperimentItemBulkWriteView {
|
|
|
2513
2557
|
|
|
2514
2558
|
interface ExperimentItemBulkRecordExperimentItemBulkWriteView {
|
|
2515
2559
|
datasetItemId: string;
|
|
2560
|
+
evaluateTaskResult?: JsonListStringExperimentItemBulkWriteView;
|
|
2516
2561
|
trace?: TraceExperimentItemBulkWriteView;
|
|
2517
2562
|
spans?: SpanExperimentItemBulkWriteView[];
|
|
2518
2563
|
feedbackScores?: FeedbackScoreExperimentItemBulkWriteView[];
|
|
@@ -2593,6 +2638,9 @@ interface SpanExperimentItemBulkWriteView {
|
|
|
2593
2638
|
* This file was auto-generated by Fern from our API Definition.
|
|
2594
2639
|
*/
|
|
2595
2640
|
|
|
2641
|
+
/**
|
|
2642
|
+
* Please provide either none, only one of evaluate_task_result or trace, but never both
|
|
2643
|
+
*/
|
|
2596
2644
|
interface TraceExperimentItemBulkWriteView {
|
|
2597
2645
|
id?: string;
|
|
2598
2646
|
/** If null, the default project is used */
|
|
@@ -3691,6 +3739,7 @@ interface TracePublic {
|
|
|
3691
3739
|
duration?: number;
|
|
3692
3740
|
threadId?: string;
|
|
3693
3741
|
visibilityMode?: TracePublicVisibilityMode;
|
|
3742
|
+
llmSpanCount?: number;
|
|
3694
3743
|
}
|
|
3695
3744
|
|
|
3696
3745
|
/**
|
|
@@ -3706,6 +3755,8 @@ interface TraceThread {
|
|
|
3706
3755
|
firstMessage?: JsonNode;
|
|
3707
3756
|
lastMessage?: JsonNode;
|
|
3708
3757
|
numberOfMessages?: number;
|
|
3758
|
+
totalEstimatedCost?: number;
|
|
3759
|
+
usage?: Record<string, number>;
|
|
3709
3760
|
lastUpdatedAt?: Date;
|
|
3710
3761
|
createdBy?: string;
|
|
3711
3762
|
createdAt?: Date;
|
|
@@ -3720,6 +3771,7 @@ interface TraceThreadPage {
|
|
|
3720
3771
|
size?: number;
|
|
3721
3772
|
total?: number;
|
|
3722
3773
|
content?: TraceThread[];
|
|
3774
|
+
sortableBy?: string[];
|
|
3723
3775
|
}
|
|
3724
3776
|
|
|
3725
3777
|
/**
|
|
@@ -6229,6 +6281,24 @@ declare class Redirect {
|
|
|
6229
6281
|
*/
|
|
6230
6282
|
experimentsRedirect(request: ExperimentsRedirectRequest, requestOptions?: Redirect.RequestOptions): HttpResponsePromise<void>;
|
|
6231
6283
|
private __experimentsRedirect;
|
|
6284
|
+
/**
|
|
6285
|
+
* Create optimization redirect url
|
|
6286
|
+
*
|
|
6287
|
+
* @param {OpikApi.OptimizationsRedirectRequest} request
|
|
6288
|
+
* @param {Redirect.RequestOptions} requestOptions - Request-specific configuration.
|
|
6289
|
+
*
|
|
6290
|
+
* @throws {@link OpikApi.BadRequestError}
|
|
6291
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
6292
|
+
*
|
|
6293
|
+
* @example
|
|
6294
|
+
* await client.redirect.optimizationsRedirect({
|
|
6295
|
+
* datasetId: "dataset_id",
|
|
6296
|
+
* optimizationId: "optimization_id",
|
|
6297
|
+
* path: "path"
|
|
6298
|
+
* })
|
|
6299
|
+
*/
|
|
6300
|
+
optimizationsRedirect(request: OptimizationsRedirectRequest, requestOptions?: Redirect.RequestOptions): HttpResponsePromise<void>;
|
|
6301
|
+
private __optimizationsRedirect;
|
|
6232
6302
|
/**
|
|
6233
6303
|
* Create project redirect url
|
|
6234
6304
|
*
|
|
@@ -6340,6 +6410,19 @@ declare class OpikApiClient {
|
|
|
6340
6410
|
}>;
|
|
6341
6411
|
}
|
|
6342
6412
|
|
|
6413
|
+
type RequestOptions = OpikApiClient.RequestOptions;
|
|
6414
|
+
|
|
6415
|
+
interface OpikConfig {
|
|
6416
|
+
apiKey: string;
|
|
6417
|
+
apiUrl?: string;
|
|
6418
|
+
projectName: string;
|
|
6419
|
+
workspaceName: string;
|
|
6420
|
+
requestOptions?: RequestOptions;
|
|
6421
|
+
}
|
|
6422
|
+
interface ConstructorOpikConfig extends OpikConfig {
|
|
6423
|
+
headers?: Record<string, string>;
|
|
6424
|
+
}
|
|
6425
|
+
|
|
6343
6426
|
interface SavedSpan extends Span$1 {
|
|
6344
6427
|
id: string;
|
|
6345
6428
|
}
|
|
@@ -6406,12 +6489,21 @@ declare abstract class BatchQueue<EntityData = object, EntityId = string> {
|
|
|
6406
6489
|
flush: () => Promise<void>;
|
|
6407
6490
|
}
|
|
6408
6491
|
|
|
6492
|
+
interface OpikApiClientTempOptions extends OpikApiClient.Options {
|
|
6493
|
+
requestOptions?: RequestOptions;
|
|
6494
|
+
}
|
|
6495
|
+
declare class OpikApiClientTemp extends OpikApiClient {
|
|
6496
|
+
requestOptions: RequestOptions;
|
|
6497
|
+
constructor(options?: OpikApiClientTempOptions);
|
|
6498
|
+
setHeaders: (headers: Record<string, string>) => void;
|
|
6499
|
+
}
|
|
6500
|
+
|
|
6409
6501
|
type SpanUpdate = Partial<SavedSpan> & {
|
|
6410
6502
|
traceId: string;
|
|
6411
6503
|
};
|
|
6412
6504
|
declare class SpanBatchQueue extends BatchQueue<SavedSpan> {
|
|
6413
6505
|
private readonly api;
|
|
6414
|
-
constructor(api:
|
|
6506
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6415
6507
|
protected getId(entity: SavedSpan): string;
|
|
6416
6508
|
protected createEntities(spans: SavedSpan[]): Promise<void>;
|
|
6417
6509
|
protected getEntity(id: string): Promise<SavedSpan>;
|
|
@@ -6425,7 +6517,7 @@ type FeedbackScoreId$1 = {
|
|
|
6425
6517
|
};
|
|
6426
6518
|
declare class SpanFeedbackScoresBatchQueue extends BatchQueue<FeedbackScoreBatchItem, FeedbackScoreId$1> {
|
|
6427
6519
|
private readonly api;
|
|
6428
|
-
constructor(api:
|
|
6520
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6429
6521
|
protected getId(entity: FeedbackScoreBatchItem): {
|
|
6430
6522
|
id: string;
|
|
6431
6523
|
name: string;
|
|
@@ -6438,7 +6530,7 @@ declare class SpanFeedbackScoresBatchQueue extends BatchQueue<FeedbackScoreBatch
|
|
|
6438
6530
|
|
|
6439
6531
|
declare class TraceBatchQueue extends BatchQueue<SavedTrace> {
|
|
6440
6532
|
private readonly api;
|
|
6441
|
-
constructor(api:
|
|
6533
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6442
6534
|
protected getId(entity: SavedTrace): string;
|
|
6443
6535
|
protected createEntities(traces: SavedTrace[]): Promise<void>;
|
|
6444
6536
|
protected getEntity(id: string): Promise<SavedTrace>;
|
|
@@ -6452,7 +6544,7 @@ type FeedbackScoreId = {
|
|
|
6452
6544
|
};
|
|
6453
6545
|
declare class TraceFeedbackScoresBatchQueue extends BatchQueue<FeedbackScoreBatchItem, FeedbackScoreId> {
|
|
6454
6546
|
private readonly api;
|
|
6455
|
-
constructor(api:
|
|
6547
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6456
6548
|
protected getId(entity: FeedbackScoreBatchItem): {
|
|
6457
6549
|
id: string;
|
|
6458
6550
|
name: string;
|
|
@@ -6475,7 +6567,7 @@ declare class DatasetBatchQueue extends BatchQueue<DatasetWrite> {
|
|
|
6475
6567
|
* @param api The OpikApiClient instance used to communicate with the API
|
|
6476
6568
|
* @param delay Optional delay in milliseconds before flushing the queue (defaults to 300ms)
|
|
6477
6569
|
*/
|
|
6478
|
-
constructor(api:
|
|
6570
|
+
constructor(api: OpikApiClientTemp, delay?: number);
|
|
6479
6571
|
/**
|
|
6480
6572
|
* Gets the ID of a dataset entity.
|
|
6481
6573
|
*
|
|
@@ -6594,7 +6686,7 @@ interface TraceData extends Omit<Trace$1, "startTime"> {
|
|
|
6594
6686
|
startTime?: Date;
|
|
6595
6687
|
}
|
|
6596
6688
|
declare class OpikClient {
|
|
6597
|
-
api:
|
|
6689
|
+
api: OpikApiClientTemp;
|
|
6598
6690
|
config: OpikConfig;
|
|
6599
6691
|
spanBatchQueue: SpanBatchQueue;
|
|
6600
6692
|
traceBatchQueue: TraceBatchQueue;
|
|
@@ -6602,7 +6694,7 @@ declare class OpikClient {
|
|
|
6602
6694
|
traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
|
|
6603
6695
|
datasetBatchQueue: DatasetBatchQueue;
|
|
6604
6696
|
private lastProjectNameLogged;
|
|
6605
|
-
constructor(explicitConfig?: Partial<
|
|
6697
|
+
constructor(explicitConfig?: Partial<ConstructorOpikConfig>);
|
|
6606
6698
|
private displayTraceLog;
|
|
6607
6699
|
trace: (traceData: TraceData) => Trace;
|
|
6608
6700
|
/**
|