opik 2.0.25 → 2.0.27

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/index.d.cts CHANGED
@@ -2595,6 +2595,7 @@ declare const SpanSearchStreamRequestPublicExcludeItem: {
2595
2595
  readonly Duration: "duration";
2596
2596
  readonly Ttft: "ttft";
2597
2597
  readonly Source: "source";
2598
+ readonly Environment: "environment";
2598
2599
  };
2599
2600
  type SpanSearchStreamRequestPublicExcludeItem = (typeof SpanSearchStreamRequestPublicExcludeItem)[keyof typeof SpanSearchStreamRequestPublicExcludeItem];
2600
2601
 
@@ -2975,6 +2976,7 @@ declare const TraceSearchStreamRequestPublicExcludeItem: {
2975
2976
  readonly Providers: "providers";
2976
2977
  readonly Experiment: "experiment";
2977
2978
  readonly Source: "source";
2979
+ readonly Environment: "environment";
2978
2980
  };
2979
2981
  type TraceSearchStreamRequestPublicExcludeItem = (typeof TraceSearchStreamRequestPublicExcludeItem)[keyof typeof TraceSearchStreamRequestPublicExcludeItem];
2980
2982
 
@@ -4215,6 +4217,8 @@ declare const DatasetItemFilterOperator: {
4215
4217
  readonly LessThanOrEqualTo: "<=";
4216
4218
  readonly IsEmpty: "is_empty";
4217
4219
  readonly IsNotEmpty: "is_not_empty";
4220
+ readonly In: "in";
4221
+ readonly NotIn: "not_in";
4218
4222
  };
4219
4223
  type DatasetItemFilterOperator = (typeof DatasetItemFilterOperator)[keyof typeof DatasetItemFilterOperator];
4220
4224
 
@@ -6251,9 +6255,11 @@ interface ServiceTogglesConfig {
6251
6255
  ollamaProviderEnabled: boolean;
6252
6256
  collaboratorsTabEnabled: boolean;
6253
6257
  v2WorkspaceAllowlistIds: string[];
6258
+ v1WorkspaceAllowlistIds: string[];
6254
6259
  forceWorkspaceVersion: string;
6255
6260
  defaultPageSize?: number;
6256
6261
  v2WorkspaceAllowlist?: string;
6262
+ v1WorkspaceAllowlist?: string;
6257
6263
  }
6258
6264
 
6259
6265
  interface Span$1 {
@@ -6288,6 +6294,7 @@ interface Span$1 {
6288
6294
  /** Time to first token in milliseconds */
6289
6295
  ttft?: number;
6290
6296
  source?: SpanSource;
6297
+ environment?: string;
6291
6298
  }
6292
6299
 
6293
6300
  /**
@@ -6322,6 +6329,7 @@ interface SpanExperimentItemBulkWriteView {
6322
6329
  /** Time to first token in milliseconds */
6323
6330
  ttft?: number;
6324
6331
  source?: SpanExperimentItemBulkWriteViewSource;
6332
+ environment?: string;
6325
6333
  }
6326
6334
 
6327
6335
  declare const SpanExperimentItemBulkWriteViewSource: {
@@ -6360,6 +6368,8 @@ declare const SpanFilterOperator: {
6360
6368
  readonly LessThanOrEqualTo: "<=";
6361
6369
  readonly IsEmpty: "is_empty";
6362
6370
  readonly IsNotEmpty: "is_not_empty";
6371
+ readonly In: "in";
6372
+ readonly NotIn: "not_in";
6363
6373
  };
6364
6374
  type SpanFilterOperator = (typeof SpanFilterOperator)[keyof typeof SpanFilterOperator];
6365
6375
 
@@ -6383,6 +6393,8 @@ declare const SpanFilterPublicOperator: {
6383
6393
  readonly LessThanOrEqualTo: "<=";
6384
6394
  readonly IsEmpty: "is_empty";
6385
6395
  readonly IsNotEmpty: "is_not_empty";
6396
+ readonly In: "in";
6397
+ readonly NotIn: "not_in";
6386
6398
  };
6387
6399
  type SpanFilterPublicOperator = (typeof SpanFilterPublicOperator)[keyof typeof SpanFilterPublicOperator];
6388
6400
 
@@ -6406,6 +6418,8 @@ declare const SpanFilterWriteOperator: {
6406
6418
  readonly LessThanOrEqualTo: "<=";
6407
6419
  readonly IsEmpty: "is_empty";
6408
6420
  readonly IsNotEmpty: "is_not_empty";
6421
+ readonly In: "in";
6422
+ readonly NotIn: "not_in";
6409
6423
  };
6410
6424
  type SpanFilterWriteOperator = (typeof SpanFilterWriteOperator)[keyof typeof SpanFilterWriteOperator];
6411
6425
 
@@ -6470,6 +6484,7 @@ interface SpanPublic {
6470
6484
  /** Time to first token in milliseconds */
6471
6485
  ttft?: number;
6472
6486
  source?: SpanPublicSource;
6487
+ environment?: string;
6473
6488
  }
6474
6489
 
6475
6490
  declare const SpanPublicSource: {
@@ -6534,6 +6549,7 @@ interface SpanUpdate$1 {
6534
6549
  errorInfo?: ErrorInfo;
6535
6550
  ttft?: number;
6536
6551
  source?: SpanUpdateSource;
6552
+ environment?: string;
6537
6553
  }
6538
6554
 
6539
6555
  declare const SpanUpdateSource: {
@@ -6591,6 +6607,7 @@ interface SpanWrite {
6591
6607
  /** Time to first token in milliseconds */
6592
6608
  ttft?: number;
6593
6609
  source?: SpanWriteSource;
6610
+ environment?: string;
6594
6611
  }
6595
6612
 
6596
6613
  declare const SpanWriteSource: {
@@ -6737,6 +6754,7 @@ interface Trace$1 {
6737
6754
  providers?: string[];
6738
6755
  experiment?: ExperimentItemReference;
6739
6756
  source?: TraceSource;
6757
+ environment?: string;
6740
6758
  }
6741
6759
 
6742
6760
  interface TraceCountResponse {
@@ -6775,6 +6793,7 @@ interface TraceExperimentItemBulkWriteView {
6775
6793
  ttft?: number;
6776
6794
  threadId?: string;
6777
6795
  source?: TraceExperimentItemBulkWriteViewSource;
6796
+ environment?: string;
6778
6797
  }
6779
6798
 
6780
6799
  declare const TraceExperimentItemBulkWriteViewSource: {
@@ -6805,6 +6824,8 @@ declare const TraceFilterOperator: {
6805
6824
  readonly LessThanOrEqualTo: "<=";
6806
6825
  readonly IsEmpty: "is_empty";
6807
6826
  readonly IsNotEmpty: "is_not_empty";
6827
+ readonly In: "in";
6828
+ readonly NotIn: "not_in";
6808
6829
  };
6809
6830
  type TraceFilterOperator = (typeof TraceFilterOperator)[keyof typeof TraceFilterOperator];
6810
6831
 
@@ -6828,6 +6849,8 @@ declare const TraceFilterPublicOperator: {
6828
6849
  readonly LessThanOrEqualTo: "<=";
6829
6850
  readonly IsEmpty: "is_empty";
6830
6851
  readonly IsNotEmpty: "is_not_empty";
6852
+ readonly In: "in";
6853
+ readonly NotIn: "not_in";
6831
6854
  };
6832
6855
  type TraceFilterPublicOperator = (typeof TraceFilterPublicOperator)[keyof typeof TraceFilterPublicOperator];
6833
6856
 
@@ -6851,6 +6874,8 @@ declare const TraceFilterWriteOperator: {
6851
6874
  readonly LessThanOrEqualTo: "<=";
6852
6875
  readonly IsEmpty: "is_empty";
6853
6876
  readonly IsNotEmpty: "is_not_empty";
6877
+ readonly In: "in";
6878
+ readonly NotIn: "not_in";
6854
6879
  };
6855
6880
  type TraceFilterWriteOperator = (typeof TraceFilterWriteOperator)[keyof typeof TraceFilterWriteOperator];
6856
6881
 
@@ -6897,6 +6922,7 @@ interface TracePublic {
6897
6922
  providers?: string[];
6898
6923
  experiment?: ExperimentItemReferencePublic;
6899
6924
  source?: TracePublicSource;
6925
+ environment?: string;
6900
6926
  }
6901
6927
 
6902
6928
  declare const TracePublicSource: {
@@ -6941,6 +6967,7 @@ interface TraceThread {
6941
6967
  lastUpdatedBy?: string;
6942
6968
  createdBy?: string;
6943
6969
  createdAt?: Date;
6970
+ environment?: string;
6944
6971
  }
6945
6972
 
6946
6973
  interface TraceThreadFilter {
@@ -6963,6 +6990,8 @@ declare const TraceThreadFilterOperator: {
6963
6990
  readonly LessThanOrEqualTo: "<=";
6964
6991
  readonly IsEmpty: "is_empty";
6965
6992
  readonly IsNotEmpty: "is_not_empty";
6993
+ readonly In: "in";
6994
+ readonly NotIn: "not_in";
6966
6995
  };
6967
6996
  type TraceThreadFilterOperator = (typeof TraceThreadFilterOperator)[keyof typeof TraceThreadFilterOperator];
6968
6997
 
@@ -6986,6 +7015,8 @@ declare const TraceThreadFilterPublicOperator: {
6986
7015
  readonly LessThanOrEqualTo: "<=";
6987
7016
  readonly IsEmpty: "is_empty";
6988
7017
  readonly IsNotEmpty: "is_not_empty";
7018
+ readonly In: "in";
7019
+ readonly NotIn: "not_in";
6989
7020
  };
6990
7021
  type TraceThreadFilterPublicOperator = (typeof TraceThreadFilterPublicOperator)[keyof typeof TraceThreadFilterPublicOperator];
6991
7022
 
@@ -7009,6 +7040,8 @@ declare const TraceThreadFilterWriteOperator: {
7009
7040
  readonly LessThanOrEqualTo: "<=";
7010
7041
  readonly IsEmpty: "is_empty";
7011
7042
  readonly IsNotEmpty: "is_not_empty";
7043
+ readonly In: "in";
7044
+ readonly NotIn: "not_in";
7012
7045
  };
7013
7046
  type TraceThreadFilterWriteOperator = (typeof TraceThreadFilterWriteOperator)[keyof typeof TraceThreadFilterWriteOperator];
7014
7047
 
@@ -7089,6 +7122,7 @@ interface TraceUpdate {
7089
7122
  threadId?: string;
7090
7123
  ttft?: number;
7091
7124
  source?: TraceUpdateSource;
7125
+ environment?: string;
7092
7126
  }
7093
7127
 
7094
7128
  declare const TraceUpdateSource: {
@@ -7122,6 +7156,7 @@ interface TraceWrite {
7122
7156
  ttft?: number;
7123
7157
  threadId?: string;
7124
7158
  source?: TraceWriteSource;
7159
+ environment?: string;
7125
7160
  }
7126
7161
 
7127
7162
  declare const TraceWriteSource: {
@@ -12910,7 +12945,11 @@ type EvaluationResult = {
12910
12945
  experimentId: string;
12911
12946
  /** Name of the experiment */
12912
12947
  experimentName?: string;
12913
- /** Test results for all evaluated items */
12948
+ /**
12949
+ * Test results for all evaluated items, including failed ones.
12950
+ * Items whose task threw will have a synthetic score named
12951
+ * {@link TASK_ERROR_SCORE_NAME} with `scoringFailed: true`.
12952
+ */
12914
12953
  testResults: EvaluationTestResult[];
12915
12954
  /** Optional URL to view detailed results in the Opik platform */
12916
12955
  resultUrl?: string;
@@ -12930,6 +12969,18 @@ type EvaluationError = {
12930
12969
  /** Original error object, if available */
12931
12970
  error?: Error;
12932
12971
  };
12972
+ /**
12973
+ * Reserved score name injected into failed task runs.
12974
+ *
12975
+ * When a task throws, the engine adds a synthetic score with this name and
12976
+ * `scoringFailed: true` so failed items remain visible in experiment results.
12977
+ * Consumers can filter on this name to distinguish task-level failures from
12978
+ * real metric scores.
12979
+ *
12980
+ * Note: coordinate with the Python SDK before renaming — picking a stable,
12981
+ * collision-resistant name (OPIK-6437).
12982
+ */
12983
+ declare const TASK_ERROR_SCORE_NAME = "__opik_task_error__";
12933
12984
  /**
12934
12985
  * Represents the result of a metric calculation.
12935
12986
  */
@@ -12940,7 +12991,12 @@ type EvaluationScoreResult = {
12940
12991
  value: number;
12941
12992
  /** Optional reason for the score */
12942
12993
  reason?: string;
12943
- /** Whether the scoring failed */
12994
+ /**
12995
+ * Whether the scoring failed due to a task-level error rather than a metric
12996
+ * failure. When `true`, `name` will equal {@link TASK_ERROR_SCORE_NAME},
12997
+ * which is a reserved name injected by the engine — user-defined metrics
12998
+ * should never produce a score with that name.
12999
+ */
12944
13000
  scoringFailed?: boolean;
12945
13001
  /** Optional category name for grouping scores */
12946
13002
  categoryName?: string;
@@ -16423,4 +16479,4 @@ interface DistributedTraceHeaders {
16423
16479
  */
16424
16480
  declare function getDistributedTraceHeaders(): DistributedTraceHeaders | null;
16425
16481
 
16426
- export { AgentTaskCompletionJudge, AgentToolCorrectnessJudge, type AllProviderOptions, AnnotationQueuePublicScope as AnnotationQueueScope, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, BaseSuiteEvaluator, ChatPrompt, ComplianceRiskJudge, type Config, ConfigMismatchError, ConfigNotFoundError, Contains, type CreateTestSuiteOptions, DEFAULT_EXECUTION_POLICY, Dataset, type DatasetPublic, DatasetVersion, DatasetVersionNotFoundError, type DatasetVersionPublic, DemographicBiasJudge, DialogueHelpfulnessJudge, type DistributedTraceHeaders, type ErrorInfo, type EvaluateOptions, type EvaluatePromptOptions, type EvaluateTestSuiteOptions, type EvaluationError, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type ExecutionPolicy, type FeedbackScoreData, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, GEval, GEvalPreset, GenderBiasJudge, type GoogleProviderOptions, Hallucination, IsJson, type ItemResult, LLMJudge, type LLMJudgeConfig, type LLMJudgeModelSettings, type LLMJudgeOptions, type LLMJudgeResponseFormat, ModelConfigurationError, ModelError, ModelGenerationError, Moderation, OPIK_PARENT_SPAN_ID_HEADER, OPIK_TRACE_ID_HEADER, type OpenAIProviderOptions, OpikClient as Opik, type OpikAssistantMessage, OpikBaseModel, type OpikConfig, type OpikMessage, OpikQueryLanguage, SpanType as OpikSpanType, type OpikSystemMessage, type OpikToolMessage, type OpikUserMessage, type Param, PoliticalBiasJudge, Prompt, PromptType, PromptUncertaintyJudge, type ProviderOptionsForModel, QARelevanceJudge, type RawTestSuiteItem, RegexMatch, RegionalBiasJudge, type RegistryEntry, ReligiousBiasJudge, ResponseSchema, type RunTestsOptions, SYSTEM_PROMPT, type ScoringKeyMappingType, Span, SpanType, SummarizationCoherenceJudge, SummarizationConsistencyJudge, type SupportedModelId, TestSuite, type TestSuiteItem, TestSuiteResult, ThreadsAnnotationQueue, Trace, TracesAnnotationQueue, USER_PROMPT_TEMPLATE, type UpdateTestSuiteItem, type UpdateTestSuiteOptions, Usefulness, VercelAIChatModel, activateRunner, agentConfigContext, buildSuiteResult, createModel, createModelFromInstance, deserializeEvaluators, detectProvider, disableLogger, evaluate, evaluatePrompt, evaluateTestSuite, flushAll, generateId, getDistributedTraceHeaders, getGlobalClient, getTrackContext, logger, resetGlobalClient, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setGlobalClient, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
16482
+ export { AgentTaskCompletionJudge, AgentToolCorrectnessJudge, type AllProviderOptions, AnnotationQueuePublicScope as AnnotationQueueScope, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, BaseSuiteEvaluator, ChatPrompt, ComplianceRiskJudge, type Config, ConfigMismatchError, ConfigNotFoundError, Contains, type CreateTestSuiteOptions, DEFAULT_EXECUTION_POLICY, Dataset, type DatasetPublic, DatasetVersion, DatasetVersionNotFoundError, type DatasetVersionPublic, DemographicBiasJudge, DialogueHelpfulnessJudge, type DistributedTraceHeaders, type ErrorInfo, type EvaluateOptions, type EvaluatePromptOptions, type EvaluateTestSuiteOptions, type EvaluationError, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type ExecutionPolicy, type FeedbackScoreData, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, GEval, GEvalPreset, GenderBiasJudge, type GoogleProviderOptions, Hallucination, IsJson, type ItemResult, LLMJudge, type LLMJudgeConfig, type LLMJudgeModelSettings, type LLMJudgeOptions, type LLMJudgeResponseFormat, ModelConfigurationError, ModelError, ModelGenerationError, Moderation, OPIK_PARENT_SPAN_ID_HEADER, OPIK_TRACE_ID_HEADER, type OpenAIProviderOptions, OpikClient as Opik, type OpikAssistantMessage, OpikBaseModel, type OpikConfig, type OpikMessage, OpikQueryLanguage, SpanType as OpikSpanType, type OpikSystemMessage, type OpikToolMessage, type OpikUserMessage, type Param, PoliticalBiasJudge, Prompt, PromptType, PromptUncertaintyJudge, type ProviderOptionsForModel, QARelevanceJudge, type RawTestSuiteItem, RegexMatch, RegionalBiasJudge, type RegistryEntry, ReligiousBiasJudge, ResponseSchema, type RunTestsOptions, SYSTEM_PROMPT, type ScoringKeyMappingType, Span, SpanType, SummarizationCoherenceJudge, SummarizationConsistencyJudge, type SupportedModelId, TASK_ERROR_SCORE_NAME, TestSuite, type TestSuiteItem, TestSuiteResult, ThreadsAnnotationQueue, Trace, TracesAnnotationQueue, USER_PROMPT_TEMPLATE, type UpdateTestSuiteItem, type UpdateTestSuiteOptions, Usefulness, VercelAIChatModel, activateRunner, agentConfigContext, buildSuiteResult, createModel, createModelFromInstance, deserializeEvaluators, detectProvider, disableLogger, evaluate, evaluatePrompt, evaluateTestSuite, flushAll, generateId, getDistributedTraceHeaders, getGlobalClient, getTrackContext, logger, resetGlobalClient, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setGlobalClient, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
package/dist/index.d.ts CHANGED
@@ -2595,6 +2595,7 @@ declare const SpanSearchStreamRequestPublicExcludeItem: {
2595
2595
  readonly Duration: "duration";
2596
2596
  readonly Ttft: "ttft";
2597
2597
  readonly Source: "source";
2598
+ readonly Environment: "environment";
2598
2599
  };
2599
2600
  type SpanSearchStreamRequestPublicExcludeItem = (typeof SpanSearchStreamRequestPublicExcludeItem)[keyof typeof SpanSearchStreamRequestPublicExcludeItem];
2600
2601
 
@@ -2975,6 +2976,7 @@ declare const TraceSearchStreamRequestPublicExcludeItem: {
2975
2976
  readonly Providers: "providers";
2976
2977
  readonly Experiment: "experiment";
2977
2978
  readonly Source: "source";
2979
+ readonly Environment: "environment";
2978
2980
  };
2979
2981
  type TraceSearchStreamRequestPublicExcludeItem = (typeof TraceSearchStreamRequestPublicExcludeItem)[keyof typeof TraceSearchStreamRequestPublicExcludeItem];
2980
2982
 
@@ -4215,6 +4217,8 @@ declare const DatasetItemFilterOperator: {
4215
4217
  readonly LessThanOrEqualTo: "<=";
4216
4218
  readonly IsEmpty: "is_empty";
4217
4219
  readonly IsNotEmpty: "is_not_empty";
4220
+ readonly In: "in";
4221
+ readonly NotIn: "not_in";
4218
4222
  };
4219
4223
  type DatasetItemFilterOperator = (typeof DatasetItemFilterOperator)[keyof typeof DatasetItemFilterOperator];
4220
4224
 
@@ -6251,9 +6255,11 @@ interface ServiceTogglesConfig {
6251
6255
  ollamaProviderEnabled: boolean;
6252
6256
  collaboratorsTabEnabled: boolean;
6253
6257
  v2WorkspaceAllowlistIds: string[];
6258
+ v1WorkspaceAllowlistIds: string[];
6254
6259
  forceWorkspaceVersion: string;
6255
6260
  defaultPageSize?: number;
6256
6261
  v2WorkspaceAllowlist?: string;
6262
+ v1WorkspaceAllowlist?: string;
6257
6263
  }
6258
6264
 
6259
6265
  interface Span$1 {
@@ -6288,6 +6294,7 @@ interface Span$1 {
6288
6294
  /** Time to first token in milliseconds */
6289
6295
  ttft?: number;
6290
6296
  source?: SpanSource;
6297
+ environment?: string;
6291
6298
  }
6292
6299
 
6293
6300
  /**
@@ -6322,6 +6329,7 @@ interface SpanExperimentItemBulkWriteView {
6322
6329
  /** Time to first token in milliseconds */
6323
6330
  ttft?: number;
6324
6331
  source?: SpanExperimentItemBulkWriteViewSource;
6332
+ environment?: string;
6325
6333
  }
6326
6334
 
6327
6335
  declare const SpanExperimentItemBulkWriteViewSource: {
@@ -6360,6 +6368,8 @@ declare const SpanFilterOperator: {
6360
6368
  readonly LessThanOrEqualTo: "<=";
6361
6369
  readonly IsEmpty: "is_empty";
6362
6370
  readonly IsNotEmpty: "is_not_empty";
6371
+ readonly In: "in";
6372
+ readonly NotIn: "not_in";
6363
6373
  };
6364
6374
  type SpanFilterOperator = (typeof SpanFilterOperator)[keyof typeof SpanFilterOperator];
6365
6375
 
@@ -6383,6 +6393,8 @@ declare const SpanFilterPublicOperator: {
6383
6393
  readonly LessThanOrEqualTo: "<=";
6384
6394
  readonly IsEmpty: "is_empty";
6385
6395
  readonly IsNotEmpty: "is_not_empty";
6396
+ readonly In: "in";
6397
+ readonly NotIn: "not_in";
6386
6398
  };
6387
6399
  type SpanFilterPublicOperator = (typeof SpanFilterPublicOperator)[keyof typeof SpanFilterPublicOperator];
6388
6400
 
@@ -6406,6 +6418,8 @@ declare const SpanFilterWriteOperator: {
6406
6418
  readonly LessThanOrEqualTo: "<=";
6407
6419
  readonly IsEmpty: "is_empty";
6408
6420
  readonly IsNotEmpty: "is_not_empty";
6421
+ readonly In: "in";
6422
+ readonly NotIn: "not_in";
6409
6423
  };
6410
6424
  type SpanFilterWriteOperator = (typeof SpanFilterWriteOperator)[keyof typeof SpanFilterWriteOperator];
6411
6425
 
@@ -6470,6 +6484,7 @@ interface SpanPublic {
6470
6484
  /** Time to first token in milliseconds */
6471
6485
  ttft?: number;
6472
6486
  source?: SpanPublicSource;
6487
+ environment?: string;
6473
6488
  }
6474
6489
 
6475
6490
  declare const SpanPublicSource: {
@@ -6534,6 +6549,7 @@ interface SpanUpdate$1 {
6534
6549
  errorInfo?: ErrorInfo;
6535
6550
  ttft?: number;
6536
6551
  source?: SpanUpdateSource;
6552
+ environment?: string;
6537
6553
  }
6538
6554
 
6539
6555
  declare const SpanUpdateSource: {
@@ -6591,6 +6607,7 @@ interface SpanWrite {
6591
6607
  /** Time to first token in milliseconds */
6592
6608
  ttft?: number;
6593
6609
  source?: SpanWriteSource;
6610
+ environment?: string;
6594
6611
  }
6595
6612
 
6596
6613
  declare const SpanWriteSource: {
@@ -6737,6 +6754,7 @@ interface Trace$1 {
6737
6754
  providers?: string[];
6738
6755
  experiment?: ExperimentItemReference;
6739
6756
  source?: TraceSource;
6757
+ environment?: string;
6740
6758
  }
6741
6759
 
6742
6760
  interface TraceCountResponse {
@@ -6775,6 +6793,7 @@ interface TraceExperimentItemBulkWriteView {
6775
6793
  ttft?: number;
6776
6794
  threadId?: string;
6777
6795
  source?: TraceExperimentItemBulkWriteViewSource;
6796
+ environment?: string;
6778
6797
  }
6779
6798
 
6780
6799
  declare const TraceExperimentItemBulkWriteViewSource: {
@@ -6805,6 +6824,8 @@ declare const TraceFilterOperator: {
6805
6824
  readonly LessThanOrEqualTo: "<=";
6806
6825
  readonly IsEmpty: "is_empty";
6807
6826
  readonly IsNotEmpty: "is_not_empty";
6827
+ readonly In: "in";
6828
+ readonly NotIn: "not_in";
6808
6829
  };
6809
6830
  type TraceFilterOperator = (typeof TraceFilterOperator)[keyof typeof TraceFilterOperator];
6810
6831
 
@@ -6828,6 +6849,8 @@ declare const TraceFilterPublicOperator: {
6828
6849
  readonly LessThanOrEqualTo: "<=";
6829
6850
  readonly IsEmpty: "is_empty";
6830
6851
  readonly IsNotEmpty: "is_not_empty";
6852
+ readonly In: "in";
6853
+ readonly NotIn: "not_in";
6831
6854
  };
6832
6855
  type TraceFilterPublicOperator = (typeof TraceFilterPublicOperator)[keyof typeof TraceFilterPublicOperator];
6833
6856
 
@@ -6851,6 +6874,8 @@ declare const TraceFilterWriteOperator: {
6851
6874
  readonly LessThanOrEqualTo: "<=";
6852
6875
  readonly IsEmpty: "is_empty";
6853
6876
  readonly IsNotEmpty: "is_not_empty";
6877
+ readonly In: "in";
6878
+ readonly NotIn: "not_in";
6854
6879
  };
6855
6880
  type TraceFilterWriteOperator = (typeof TraceFilterWriteOperator)[keyof typeof TraceFilterWriteOperator];
6856
6881
 
@@ -6897,6 +6922,7 @@ interface TracePublic {
6897
6922
  providers?: string[];
6898
6923
  experiment?: ExperimentItemReferencePublic;
6899
6924
  source?: TracePublicSource;
6925
+ environment?: string;
6900
6926
  }
6901
6927
 
6902
6928
  declare const TracePublicSource: {
@@ -6941,6 +6967,7 @@ interface TraceThread {
6941
6967
  lastUpdatedBy?: string;
6942
6968
  createdBy?: string;
6943
6969
  createdAt?: Date;
6970
+ environment?: string;
6944
6971
  }
6945
6972
 
6946
6973
  interface TraceThreadFilter {
@@ -6963,6 +6990,8 @@ declare const TraceThreadFilterOperator: {
6963
6990
  readonly LessThanOrEqualTo: "<=";
6964
6991
  readonly IsEmpty: "is_empty";
6965
6992
  readonly IsNotEmpty: "is_not_empty";
6993
+ readonly In: "in";
6994
+ readonly NotIn: "not_in";
6966
6995
  };
6967
6996
  type TraceThreadFilterOperator = (typeof TraceThreadFilterOperator)[keyof typeof TraceThreadFilterOperator];
6968
6997
 
@@ -6986,6 +7015,8 @@ declare const TraceThreadFilterPublicOperator: {
6986
7015
  readonly LessThanOrEqualTo: "<=";
6987
7016
  readonly IsEmpty: "is_empty";
6988
7017
  readonly IsNotEmpty: "is_not_empty";
7018
+ readonly In: "in";
7019
+ readonly NotIn: "not_in";
6989
7020
  };
6990
7021
  type TraceThreadFilterPublicOperator = (typeof TraceThreadFilterPublicOperator)[keyof typeof TraceThreadFilterPublicOperator];
6991
7022
 
@@ -7009,6 +7040,8 @@ declare const TraceThreadFilterWriteOperator: {
7009
7040
  readonly LessThanOrEqualTo: "<=";
7010
7041
  readonly IsEmpty: "is_empty";
7011
7042
  readonly IsNotEmpty: "is_not_empty";
7043
+ readonly In: "in";
7044
+ readonly NotIn: "not_in";
7012
7045
  };
7013
7046
  type TraceThreadFilterWriteOperator = (typeof TraceThreadFilterWriteOperator)[keyof typeof TraceThreadFilterWriteOperator];
7014
7047
 
@@ -7089,6 +7122,7 @@ interface TraceUpdate {
7089
7122
  threadId?: string;
7090
7123
  ttft?: number;
7091
7124
  source?: TraceUpdateSource;
7125
+ environment?: string;
7092
7126
  }
7093
7127
 
7094
7128
  declare const TraceUpdateSource: {
@@ -7122,6 +7156,7 @@ interface TraceWrite {
7122
7156
  ttft?: number;
7123
7157
  threadId?: string;
7124
7158
  source?: TraceWriteSource;
7159
+ environment?: string;
7125
7160
  }
7126
7161
 
7127
7162
  declare const TraceWriteSource: {
@@ -12910,7 +12945,11 @@ type EvaluationResult = {
12910
12945
  experimentId: string;
12911
12946
  /** Name of the experiment */
12912
12947
  experimentName?: string;
12913
- /** Test results for all evaluated items */
12948
+ /**
12949
+ * Test results for all evaluated items, including failed ones.
12950
+ * Items whose task threw will have a synthetic score named
12951
+ * {@link TASK_ERROR_SCORE_NAME} with `scoringFailed: true`.
12952
+ */
12914
12953
  testResults: EvaluationTestResult[];
12915
12954
  /** Optional URL to view detailed results in the Opik platform */
12916
12955
  resultUrl?: string;
@@ -12930,6 +12969,18 @@ type EvaluationError = {
12930
12969
  /** Original error object, if available */
12931
12970
  error?: Error;
12932
12971
  };
12972
+ /**
12973
+ * Reserved score name injected into failed task runs.
12974
+ *
12975
+ * When a task throws, the engine adds a synthetic score with this name and
12976
+ * `scoringFailed: true` so failed items remain visible in experiment results.
12977
+ * Consumers can filter on this name to distinguish task-level failures from
12978
+ * real metric scores.
12979
+ *
12980
+ * Note: coordinate with the Python SDK before renaming — picking a stable,
12981
+ * collision-resistant name (OPIK-6437).
12982
+ */
12983
+ declare const TASK_ERROR_SCORE_NAME = "__opik_task_error__";
12933
12984
  /**
12934
12985
  * Represents the result of a metric calculation.
12935
12986
  */
@@ -12940,7 +12991,12 @@ type EvaluationScoreResult = {
12940
12991
  value: number;
12941
12992
  /** Optional reason for the score */
12942
12993
  reason?: string;
12943
- /** Whether the scoring failed */
12994
+ /**
12995
+ * Whether the scoring failed due to a task-level error rather than a metric
12996
+ * failure. When `true`, `name` will equal {@link TASK_ERROR_SCORE_NAME},
12997
+ * which is a reserved name injected by the engine — user-defined metrics
12998
+ * should never produce a score with that name.
12999
+ */
12944
13000
  scoringFailed?: boolean;
12945
13001
  /** Optional category name for grouping scores */
12946
13002
  categoryName?: string;
@@ -16423,4 +16479,4 @@ interface DistributedTraceHeaders {
16423
16479
  */
16424
16480
  declare function getDistributedTraceHeaders(): DistributedTraceHeaders | null;
16425
16481
 
16426
- export { AgentTaskCompletionJudge, AgentToolCorrectnessJudge, type AllProviderOptions, AnnotationQueuePublicScope as AnnotationQueueScope, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, BaseSuiteEvaluator, ChatPrompt, ComplianceRiskJudge, type Config, ConfigMismatchError, ConfigNotFoundError, Contains, type CreateTestSuiteOptions, DEFAULT_EXECUTION_POLICY, Dataset, type DatasetPublic, DatasetVersion, DatasetVersionNotFoundError, type DatasetVersionPublic, DemographicBiasJudge, DialogueHelpfulnessJudge, type DistributedTraceHeaders, type ErrorInfo, type EvaluateOptions, type EvaluatePromptOptions, type EvaluateTestSuiteOptions, type EvaluationError, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type ExecutionPolicy, type FeedbackScoreData, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, GEval, GEvalPreset, GenderBiasJudge, type GoogleProviderOptions, Hallucination, IsJson, type ItemResult, LLMJudge, type LLMJudgeConfig, type LLMJudgeModelSettings, type LLMJudgeOptions, type LLMJudgeResponseFormat, ModelConfigurationError, ModelError, ModelGenerationError, Moderation, OPIK_PARENT_SPAN_ID_HEADER, OPIK_TRACE_ID_HEADER, type OpenAIProviderOptions, OpikClient as Opik, type OpikAssistantMessage, OpikBaseModel, type OpikConfig, type OpikMessage, OpikQueryLanguage, SpanType as OpikSpanType, type OpikSystemMessage, type OpikToolMessage, type OpikUserMessage, type Param, PoliticalBiasJudge, Prompt, PromptType, PromptUncertaintyJudge, type ProviderOptionsForModel, QARelevanceJudge, type RawTestSuiteItem, RegexMatch, RegionalBiasJudge, type RegistryEntry, ReligiousBiasJudge, ResponseSchema, type RunTestsOptions, SYSTEM_PROMPT, type ScoringKeyMappingType, Span, SpanType, SummarizationCoherenceJudge, SummarizationConsistencyJudge, type SupportedModelId, TestSuite, type TestSuiteItem, TestSuiteResult, ThreadsAnnotationQueue, Trace, TracesAnnotationQueue, USER_PROMPT_TEMPLATE, type UpdateTestSuiteItem, type UpdateTestSuiteOptions, Usefulness, VercelAIChatModel, activateRunner, agentConfigContext, buildSuiteResult, createModel, createModelFromInstance, deserializeEvaluators, detectProvider, disableLogger, evaluate, evaluatePrompt, evaluateTestSuite, flushAll, generateId, getDistributedTraceHeaders, getGlobalClient, getTrackContext, logger, resetGlobalClient, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setGlobalClient, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
16482
+ export { AgentTaskCompletionJudge, AgentToolCorrectnessJudge, type AllProviderOptions, AnnotationQueuePublicScope as AnnotationQueueScope, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, BaseSuiteEvaluator, ChatPrompt, ComplianceRiskJudge, type Config, ConfigMismatchError, ConfigNotFoundError, Contains, type CreateTestSuiteOptions, DEFAULT_EXECUTION_POLICY, Dataset, type DatasetPublic, DatasetVersion, DatasetVersionNotFoundError, type DatasetVersionPublic, DemographicBiasJudge, DialogueHelpfulnessJudge, type DistributedTraceHeaders, type ErrorInfo, type EvaluateOptions, type EvaluatePromptOptions, type EvaluateTestSuiteOptions, type EvaluationError, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type ExecutionPolicy, type FeedbackScoreData, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, GEval, GEvalPreset, GenderBiasJudge, type GoogleProviderOptions, Hallucination, IsJson, type ItemResult, LLMJudge, type LLMJudgeConfig, type LLMJudgeModelSettings, type LLMJudgeOptions, type LLMJudgeResponseFormat, ModelConfigurationError, ModelError, ModelGenerationError, Moderation, OPIK_PARENT_SPAN_ID_HEADER, OPIK_TRACE_ID_HEADER, type OpenAIProviderOptions, OpikClient as Opik, type OpikAssistantMessage, OpikBaseModel, type OpikConfig, type OpikMessage, OpikQueryLanguage, SpanType as OpikSpanType, type OpikSystemMessage, type OpikToolMessage, type OpikUserMessage, type Param, PoliticalBiasJudge, Prompt, PromptType, PromptUncertaintyJudge, type ProviderOptionsForModel, QARelevanceJudge, type RawTestSuiteItem, RegexMatch, RegionalBiasJudge, type RegistryEntry, ReligiousBiasJudge, ResponseSchema, type RunTestsOptions, SYSTEM_PROMPT, type ScoringKeyMappingType, Span, SpanType, SummarizationCoherenceJudge, SummarizationConsistencyJudge, type SupportedModelId, TASK_ERROR_SCORE_NAME, TestSuite, type TestSuiteItem, TestSuiteResult, ThreadsAnnotationQueue, Trace, TracesAnnotationQueue, USER_PROMPT_TEMPLATE, type UpdateTestSuiteItem, type UpdateTestSuiteOptions, Usefulness, VercelAIChatModel, activateRunner, agentConfigContext, buildSuiteResult, createModel, createModelFromInstance, deserializeEvaluators, detectProvider, disableLogger, evaluate, evaluatePrompt, evaluateTestSuite, flushAll, generateId, getDistributedTraceHeaders, getGlobalClient, getTrackContext, logger, resetGlobalClient, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setGlobalClient, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import {Ea}from'./chunk-CFMWKPCO.js';export{ra as AgentTaskCompletionJudge,qa as AgentToolCorrectnessJudge,ea as AnswerRelevance,aa as BaseLLMJudgeMetric,B as BaseMetric,C as BaseSuiteEvaluator,p as ChatPrompt,ta as ComplianceRiskJudge,i as ConfigMismatchError,h as ConfigNotFoundError,Z as Contains,y as DEFAULT_EXECUTION_POLICY,j as Dataset,f as DatasetVersion,g as DatasetVersionNotFoundError,la as DemographicBiasJudge,ja as DialogueHelpfulnessJudge,Y as ExactMatch,fa as GEval,ga as GEvalPreset,na as GenderBiasJudge,da as Hallucination,$ as IsJson,P as LLMJudge,G as ModelConfigurationError,E as ModelError,F as ModelGenerationError,ba as Moderation,Ba as OPIK_PARENT_SPAN_ID_HEADER,Aa as OPIK_TRACE_ID_HEADER,za as Opik,D as OpikBaseModel,q as OpikQueryLanguage,d as OpikSpanType,ma as PoliticalBiasJudge,o as Prompt,k as PromptType,sa as PromptUncertaintyJudge,ka as QARelevanceJudge,_ as RegexMatch,pa as RegionalBiasJudge,oa as ReligiousBiasJudge,O as ResponseSchema,M as SYSTEM_PROMPT,ia as SummarizationCoherenceJudge,ha as SummarizationConsistencyJudge,xa as TestSuite,z as TestSuiteResult,s as ThreadsAnnotationQueue,r as TracesAnnotationQueue,N as USER_PROMPT_TEMPLATE,ca as Usefulness,I as VercelAIChatModel,v as activateRunner,t as agentConfigContext,A as buildSuiteResult,J as createModel,K as createModelFromInstance,R as deserializeEvaluators,H as detectProvider,c as disableLogger,W as evaluate,X as evaluatePrompt,U as evaluateTestSuite,u as flushAll,e as generateId,Ca as getDistributedTraceHeaders,l as getGlobalClient,w as getTrackContext,a as logger,n as resetGlobalClient,ua as resolveEvaluators,S as resolveExecutionPolicy,T as resolveItemExecutionPolicy,L as resolveModel,V as runTests,Q as serializeEvaluators,m as setGlobalClient,b as setLoggerLevel,x as track,va as validateEvaluators,wa as validateExecutionPolicy,Da as z}from'./chunk-CFMWKPCO.js';Ea();
1
+ import {Fa}from'./chunk-MGI4PR45.js';export{sa as AgentTaskCompletionJudge,ra as AgentToolCorrectnessJudge,fa as AnswerRelevance,ba as BaseLLMJudgeMetric,C as BaseMetric,D as BaseSuiteEvaluator,p as ChatPrompt,ua as ComplianceRiskJudge,i as ConfigMismatchError,h as ConfigNotFoundError,_ as Contains,y as DEFAULT_EXECUTION_POLICY,j as Dataset,f as DatasetVersion,g as DatasetVersionNotFoundError,ma as DemographicBiasJudge,ka as DialogueHelpfulnessJudge,Z as ExactMatch,ga as GEval,ha as GEvalPreset,oa as GenderBiasJudge,ea as Hallucination,aa as IsJson,Q as LLMJudge,H as ModelConfigurationError,F as ModelError,G as ModelGenerationError,ca as Moderation,Ca as OPIK_PARENT_SPAN_ID_HEADER,Ba as OPIK_TRACE_ID_HEADER,Aa as Opik,E as OpikBaseModel,q as OpikQueryLanguage,d as OpikSpanType,na as PoliticalBiasJudge,o as Prompt,k as PromptType,ta as PromptUncertaintyJudge,la as QARelevanceJudge,$ as RegexMatch,qa as RegionalBiasJudge,pa as ReligiousBiasJudge,P as ResponseSchema,N as SYSTEM_PROMPT,ja as SummarizationCoherenceJudge,ia as SummarizationConsistencyJudge,B as TASK_ERROR_SCORE_NAME,ya as TestSuite,z as TestSuiteResult,s as ThreadsAnnotationQueue,r as TracesAnnotationQueue,O as USER_PROMPT_TEMPLATE,da as Usefulness,J as VercelAIChatModel,v as activateRunner,t as agentConfigContext,A as buildSuiteResult,K as createModel,L as createModelFromInstance,S as deserializeEvaluators,I as detectProvider,c as disableLogger,X as evaluate,Y as evaluatePrompt,V as evaluateTestSuite,u as flushAll,e as generateId,Da as getDistributedTraceHeaders,l as getGlobalClient,w as getTrackContext,a as logger,n as resetGlobalClient,va as resolveEvaluators,T as resolveExecutionPolicy,U as resolveItemExecutionPolicy,M as resolveModel,W as runTests,R as serializeEvaluators,m as setGlobalClient,b as setLoggerLevel,x as track,wa as validateEvaluators,xa as validateExecutionPolicy,Ea as z}from'./chunk-MGI4PR45.js';Fa();
@@ -0,0 +1 @@
1
+ import {za}from'./chunk-MGI4PR45.js';export{y as DEFAULT_EXECUTION_POLICY,ya as TestSuite,z as TestSuiteResult,A as buildSuiteResult,S as deserializeEvaluators,V as evaluateTestSuite,T as resolveExecutionPolicy,U as resolveItemExecutionPolicy,W as runTests,R as serializeEvaluators}from'./chunk-MGI4PR45.js';za();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opik",
3
3
  "description": "Opik TypeScript and JavaScript SDK",
4
- "version": "2.0.25",
4
+ "version": "2.0.27",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/comet-ml/opik.git",