opik 2.0.20 → 2.0.21

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
@@ -697,6 +697,8 @@ interface ChatCompletionRequest {
697
697
  metadata?: Record<string, string>;
698
698
  reasoningEffort?: string;
699
699
  serviceTier?: string;
700
+ logprobs?: boolean;
701
+ topLogprobs?: number;
700
702
  functions?: Function$1[];
701
703
  functionCall?: FunctionCall;
702
704
  }
@@ -1138,6 +1140,37 @@ declare const DatasetWriteVisibility: {
1138
1140
  };
1139
1141
  type DatasetWriteVisibility = (typeof DatasetWriteVisibility)[keyof typeof DatasetWriteVisibility];
1140
1142
 
1143
+ /**
1144
+ * @example
1145
+ * {}
1146
+ */
1147
+ interface EnvironmentUpdate {
1148
+ name?: string;
1149
+ description?: string;
1150
+ color?: string;
1151
+ position?: number;
1152
+ }
1153
+
1154
+ /**
1155
+ * @example
1156
+ * {
1157
+ * name: "name"
1158
+ * }
1159
+ */
1160
+ interface EnvironmentWrite {
1161
+ id?: string;
1162
+ name: string;
1163
+ description?: string;
1164
+ color?: string;
1165
+ position?: number;
1166
+ }
1167
+
1168
+ /**
1169
+ * @example
1170
+ * {}
1171
+ */
1172
+ type GetEnvironmentByIdRequest = {};
1173
+
1141
1174
  /**
1142
1175
  * @example
1143
1176
  * {
@@ -3812,6 +3845,7 @@ interface ChatCompletionChoice {
3812
3845
  message?: AssistantMessage;
3813
3846
  delta?: Delta;
3814
3847
  finishReason?: string;
3848
+ logprobs?: LogProbs;
3815
3849
  }
3816
3850
 
3817
3851
  interface ChatCompletionResponse {
@@ -4424,6 +4458,26 @@ interface Delta {
4424
4458
  functionCall?: FunctionCall;
4425
4459
  }
4426
4460
 
4461
+ interface EnvironmentPagePublic {
4462
+ page?: number;
4463
+ size?: number;
4464
+ total?: number;
4465
+ content?: EnvironmentPublic[];
4466
+ sortableBy?: string[];
4467
+ }
4468
+
4469
+ interface EnvironmentPublic {
4470
+ id?: string;
4471
+ name: string;
4472
+ description?: string;
4473
+ color?: string;
4474
+ position?: number;
4475
+ createdAt?: Date;
4476
+ createdBy?: string;
4477
+ lastUpdatedAt?: Date;
4478
+ lastUpdatedBy?: string;
4479
+ }
4480
+
4427
4481
  interface ErrorCountWithDeviation {
4428
4482
  count?: number;
4429
4483
  deviation?: number;
@@ -5471,6 +5525,16 @@ interface LogPage {
5471
5525
  total?: number;
5472
5526
  }
5473
5527
 
5528
+ interface LogProb {
5529
+ token?: string;
5530
+ logprob?: number;
5531
+ bytes?: number[];
5532
+ }
5533
+
5534
+ interface LogProbs {
5535
+ content?: LogProb[];
5536
+ }
5537
+
5474
5538
  interface ManualEvaluationRequest {
5475
5539
  /** Project ID */
5476
5540
  projectId: string;
@@ -8722,6 +8786,86 @@ declare class DatasetsClient {
8722
8786
  private __updateDatasetVersion;
8723
8787
  }
8724
8788
 
8789
+ declare namespace EnvironmentsClient {
8790
+ type Options = BaseClientOptions;
8791
+ interface RequestOptions extends BaseRequestOptions {
8792
+ }
8793
+ }
8794
+ /**
8795
+ * Environment related resources
8796
+ */
8797
+ declare class EnvironmentsClient {
8798
+ protected readonly _options: NormalizedClientOptions<EnvironmentsClient.Options>;
8799
+ constructor(options?: EnvironmentsClient.Options);
8800
+ /**
8801
+ * Find environments for the workspace. Capped at the workspace limit (default 20).
8802
+ *
8803
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8804
+ *
8805
+ * @example
8806
+ * await client.environments.findEnvironments()
8807
+ */
8808
+ findEnvironments(requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPagePublic>;
8809
+ private __findEnvironments;
8810
+ /**
8811
+ * Create environment
8812
+ *
8813
+ * @param {OpikApi.EnvironmentWrite} request
8814
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8815
+ *
8816
+ * @throws {@link OpikApi.ConflictError}
8817
+ *
8818
+ * @example
8819
+ * await client.environments.createEnvironment({
8820
+ * name: "name"
8821
+ * })
8822
+ */
8823
+ createEnvironment(request: EnvironmentWrite, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
8824
+ private __createEnvironment;
8825
+ /**
8826
+ * Delete environments batch. Idempotent — missing ids are silently ignored.
8827
+ *
8828
+ * @param {OpikApi.BatchDelete} request
8829
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8830
+ *
8831
+ * @example
8832
+ * await client.environments.deleteEnvironmentsBatch({
8833
+ * ids: ["ids"]
8834
+ * })
8835
+ */
8836
+ deleteEnvironmentsBatch(request: BatchDelete, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
8837
+ private __deleteEnvironmentsBatch;
8838
+ /**
8839
+ * Get environment by id
8840
+ *
8841
+ * @param {string} id
8842
+ * @param {OpikApi.GetEnvironmentByIdRequest} request
8843
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8844
+ *
8845
+ * @throws {@link OpikApi.NotFoundError}
8846
+ *
8847
+ * @example
8848
+ * await client.environments.getEnvironmentById("id")
8849
+ */
8850
+ getEnvironmentById(id: string, request?: GetEnvironmentByIdRequest, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPublic>;
8851
+ private __getEnvironmentById;
8852
+ /**
8853
+ * Update environment by id
8854
+ *
8855
+ * @param {string} id
8856
+ * @param {OpikApi.EnvironmentUpdate} request
8857
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8858
+ *
8859
+ * @throws {@link OpikApi.NotFoundError}
8860
+ * @throws {@link OpikApi.ConflictError}
8861
+ *
8862
+ * @example
8863
+ * await client.environments.updateEnvironment("id")
8864
+ */
8865
+ updateEnvironment(id: string, request?: EnvironmentUpdate, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
8866
+ private __updateEnvironment;
8867
+ }
8868
+
8725
8869
  declare namespace ExperimentsClient {
8726
8870
  type Options = BaseClientOptions;
8727
8871
  interface RequestOptions extends BaseRequestOptions {
@@ -11652,6 +11796,7 @@ declare class OpikApiClient {
11652
11796
  protected _chatCompletions: ChatCompletionsClient | undefined;
11653
11797
  protected _dashboards: DashboardsClient | undefined;
11654
11798
  protected _datasets: DatasetsClient | undefined;
11799
+ protected _environments: EnvironmentsClient | undefined;
11655
11800
  protected _experiments: ExperimentsClient | undefined;
11656
11801
  protected _feedbackDefinitions: FeedbackDefinitionsClient | undefined;
11657
11802
  protected _guardrails: GuardrailsClient | undefined;
@@ -11687,6 +11832,7 @@ declare class OpikApiClient {
11687
11832
  get chatCompletions(): ChatCompletionsClient;
11688
11833
  get dashboards(): DashboardsClient;
11689
11834
  get datasets(): DatasetsClient;
11835
+ get environments(): EnvironmentsClient;
11690
11836
  get experiments(): ExperimentsClient;
11691
11837
  get feedbackDefinitions(): FeedbackDefinitionsClient;
11692
11838
  get guardrails(): GuardrailsClient;
package/dist/index.d.ts CHANGED
@@ -697,6 +697,8 @@ interface ChatCompletionRequest {
697
697
  metadata?: Record<string, string>;
698
698
  reasoningEffort?: string;
699
699
  serviceTier?: string;
700
+ logprobs?: boolean;
701
+ topLogprobs?: number;
700
702
  functions?: Function$1[];
701
703
  functionCall?: FunctionCall;
702
704
  }
@@ -1138,6 +1140,37 @@ declare const DatasetWriteVisibility: {
1138
1140
  };
1139
1141
  type DatasetWriteVisibility = (typeof DatasetWriteVisibility)[keyof typeof DatasetWriteVisibility];
1140
1142
 
1143
+ /**
1144
+ * @example
1145
+ * {}
1146
+ */
1147
+ interface EnvironmentUpdate {
1148
+ name?: string;
1149
+ description?: string;
1150
+ color?: string;
1151
+ position?: number;
1152
+ }
1153
+
1154
+ /**
1155
+ * @example
1156
+ * {
1157
+ * name: "name"
1158
+ * }
1159
+ */
1160
+ interface EnvironmentWrite {
1161
+ id?: string;
1162
+ name: string;
1163
+ description?: string;
1164
+ color?: string;
1165
+ position?: number;
1166
+ }
1167
+
1168
+ /**
1169
+ * @example
1170
+ * {}
1171
+ */
1172
+ type GetEnvironmentByIdRequest = {};
1173
+
1141
1174
  /**
1142
1175
  * @example
1143
1176
  * {
@@ -3812,6 +3845,7 @@ interface ChatCompletionChoice {
3812
3845
  message?: AssistantMessage;
3813
3846
  delta?: Delta;
3814
3847
  finishReason?: string;
3848
+ logprobs?: LogProbs;
3815
3849
  }
3816
3850
 
3817
3851
  interface ChatCompletionResponse {
@@ -4424,6 +4458,26 @@ interface Delta {
4424
4458
  functionCall?: FunctionCall;
4425
4459
  }
4426
4460
 
4461
+ interface EnvironmentPagePublic {
4462
+ page?: number;
4463
+ size?: number;
4464
+ total?: number;
4465
+ content?: EnvironmentPublic[];
4466
+ sortableBy?: string[];
4467
+ }
4468
+
4469
+ interface EnvironmentPublic {
4470
+ id?: string;
4471
+ name: string;
4472
+ description?: string;
4473
+ color?: string;
4474
+ position?: number;
4475
+ createdAt?: Date;
4476
+ createdBy?: string;
4477
+ lastUpdatedAt?: Date;
4478
+ lastUpdatedBy?: string;
4479
+ }
4480
+
4427
4481
  interface ErrorCountWithDeviation {
4428
4482
  count?: number;
4429
4483
  deviation?: number;
@@ -5471,6 +5525,16 @@ interface LogPage {
5471
5525
  total?: number;
5472
5526
  }
5473
5527
 
5528
+ interface LogProb {
5529
+ token?: string;
5530
+ logprob?: number;
5531
+ bytes?: number[];
5532
+ }
5533
+
5534
+ interface LogProbs {
5535
+ content?: LogProb[];
5536
+ }
5537
+
5474
5538
  interface ManualEvaluationRequest {
5475
5539
  /** Project ID */
5476
5540
  projectId: string;
@@ -8722,6 +8786,86 @@ declare class DatasetsClient {
8722
8786
  private __updateDatasetVersion;
8723
8787
  }
8724
8788
 
8789
+ declare namespace EnvironmentsClient {
8790
+ type Options = BaseClientOptions;
8791
+ interface RequestOptions extends BaseRequestOptions {
8792
+ }
8793
+ }
8794
+ /**
8795
+ * Environment related resources
8796
+ */
8797
+ declare class EnvironmentsClient {
8798
+ protected readonly _options: NormalizedClientOptions<EnvironmentsClient.Options>;
8799
+ constructor(options?: EnvironmentsClient.Options);
8800
+ /**
8801
+ * Find environments for the workspace. Capped at the workspace limit (default 20).
8802
+ *
8803
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8804
+ *
8805
+ * @example
8806
+ * await client.environments.findEnvironments()
8807
+ */
8808
+ findEnvironments(requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPagePublic>;
8809
+ private __findEnvironments;
8810
+ /**
8811
+ * Create environment
8812
+ *
8813
+ * @param {OpikApi.EnvironmentWrite} request
8814
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8815
+ *
8816
+ * @throws {@link OpikApi.ConflictError}
8817
+ *
8818
+ * @example
8819
+ * await client.environments.createEnvironment({
8820
+ * name: "name"
8821
+ * })
8822
+ */
8823
+ createEnvironment(request: EnvironmentWrite, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
8824
+ private __createEnvironment;
8825
+ /**
8826
+ * Delete environments batch. Idempotent — missing ids are silently ignored.
8827
+ *
8828
+ * @param {OpikApi.BatchDelete} request
8829
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8830
+ *
8831
+ * @example
8832
+ * await client.environments.deleteEnvironmentsBatch({
8833
+ * ids: ["ids"]
8834
+ * })
8835
+ */
8836
+ deleteEnvironmentsBatch(request: BatchDelete, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
8837
+ private __deleteEnvironmentsBatch;
8838
+ /**
8839
+ * Get environment by id
8840
+ *
8841
+ * @param {string} id
8842
+ * @param {OpikApi.GetEnvironmentByIdRequest} request
8843
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8844
+ *
8845
+ * @throws {@link OpikApi.NotFoundError}
8846
+ *
8847
+ * @example
8848
+ * await client.environments.getEnvironmentById("id")
8849
+ */
8850
+ getEnvironmentById(id: string, request?: GetEnvironmentByIdRequest, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPublic>;
8851
+ private __getEnvironmentById;
8852
+ /**
8853
+ * Update environment by id
8854
+ *
8855
+ * @param {string} id
8856
+ * @param {OpikApi.EnvironmentUpdate} request
8857
+ * @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
8858
+ *
8859
+ * @throws {@link OpikApi.NotFoundError}
8860
+ * @throws {@link OpikApi.ConflictError}
8861
+ *
8862
+ * @example
8863
+ * await client.environments.updateEnvironment("id")
8864
+ */
8865
+ updateEnvironment(id: string, request?: EnvironmentUpdate, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
8866
+ private __updateEnvironment;
8867
+ }
8868
+
8725
8869
  declare namespace ExperimentsClient {
8726
8870
  type Options = BaseClientOptions;
8727
8871
  interface RequestOptions extends BaseRequestOptions {
@@ -11652,6 +11796,7 @@ declare class OpikApiClient {
11652
11796
  protected _chatCompletions: ChatCompletionsClient | undefined;
11653
11797
  protected _dashboards: DashboardsClient | undefined;
11654
11798
  protected _datasets: DatasetsClient | undefined;
11799
+ protected _environments: EnvironmentsClient | undefined;
11655
11800
  protected _experiments: ExperimentsClient | undefined;
11656
11801
  protected _feedbackDefinitions: FeedbackDefinitionsClient | undefined;
11657
11802
  protected _guardrails: GuardrailsClient | undefined;
@@ -11687,6 +11832,7 @@ declare class OpikApiClient {
11687
11832
  get chatCompletions(): ChatCompletionsClient;
11688
11833
  get dashboards(): DashboardsClient;
11689
11834
  get datasets(): DatasetsClient;
11835
+ get environments(): EnvironmentsClient;
11690
11836
  get experiments(): ExperimentsClient;
11691
11837
  get feedbackDefinitions(): FeedbackDefinitionsClient;
11692
11838
  get guardrails(): GuardrailsClient;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import {Ea}from'./chunk-2HP64V53.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-2HP64V53.js';Ea();
1
+ import {Ea}from'./chunk-XQEUQ5J4.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-XQEUQ5J4.js';Ea();
@@ -1 +1 @@
1
- import {ya}from'./chunk-2HP64V53.js';export{y as DEFAULT_EXECUTION_POLICY,xa as TestSuite,z as TestSuiteResult,A as buildSuiteResult,R as deserializeEvaluators,U as evaluateTestSuite,S as resolveExecutionPolicy,T as resolveItemExecutionPolicy,V as runTests,Q as serializeEvaluators}from'./chunk-2HP64V53.js';ya();
1
+ import {ya}from'./chunk-XQEUQ5J4.js';export{y as DEFAULT_EXECUTION_POLICY,xa as TestSuite,z as TestSuiteResult,A as buildSuiteResult,R as deserializeEvaluators,U as evaluateTestSuite,S as resolveExecutionPolicy,T as resolveItemExecutionPolicy,V as runTests,Q as serializeEvaluators}from'./chunk-XQEUQ5J4.js';ya();
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.20",
4
+ "version": "2.0.21",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/comet-ml/opik.git",