opik 2.0.1 → 2.0.2
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/chunk-FTTQJ4TO.js +404 -0
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +72 -48
- package/dist/index.d.ts +72 -48
- package/dist/index.js +1 -1
- package/dist/suite-2DEGP66I.js +1 -0
- package/package.json +1 -1
- package/dist/chunk-HRNPUK4B.js +0 -404
- package/dist/suite-RWWP3MWS.js +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -11854,21 +11854,52 @@ interface BasePromptData {
|
|
|
11854
11854
|
* Provides common functionality for versioning, property updates, and deletion.
|
|
11855
11855
|
*/
|
|
11856
11856
|
declare abstract class BasePrompt {
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11857
|
+
private _id;
|
|
11858
|
+
private _versionId;
|
|
11859
|
+
private _commit;
|
|
11860
|
+
private _synced;
|
|
11861
|
+
private _changeDescription;
|
|
11862
|
+
private _projectName;
|
|
11860
11863
|
readonly type: PromptType;
|
|
11861
|
-
readonly changeDescription: string | undefined;
|
|
11862
11864
|
readonly templateStructure: PromptTemplateStructure;
|
|
11863
|
-
readonly projectName: string | undefined;
|
|
11864
|
-
/** Whether the prompt has been successfully synced with the backend. */
|
|
11865
|
-
readonly synced: boolean;
|
|
11866
11865
|
protected _name: string;
|
|
11867
11866
|
protected _description: string | undefined;
|
|
11868
11867
|
protected _tags: string[];
|
|
11869
11868
|
protected readonly _metadata: JsonNode | undefined;
|
|
11870
11869
|
protected readonly opik: OpikClient;
|
|
11871
|
-
|
|
11870
|
+
/** Pending background sync promise, set when constructed without synced:true. */
|
|
11871
|
+
protected _pendingSync: Promise<void> | null;
|
|
11872
|
+
get id(): string | undefined;
|
|
11873
|
+
get versionId(): string | undefined;
|
|
11874
|
+
get commit(): string | undefined;
|
|
11875
|
+
/** Whether the prompt has been successfully synced with the backend. */
|
|
11876
|
+
get synced(): boolean;
|
|
11877
|
+
get changeDescription(): string | undefined;
|
|
11878
|
+
get projectName(): string | undefined;
|
|
11879
|
+
constructor(data: BasePromptData, opik?: OpikClient);
|
|
11880
|
+
/**
|
|
11881
|
+
* Updates internal state after a successful background sync.
|
|
11882
|
+
*/
|
|
11883
|
+
protected updateSyncState(result: {
|
|
11884
|
+
promptId?: string;
|
|
11885
|
+
versionId?: string;
|
|
11886
|
+
commit?: string;
|
|
11887
|
+
changeDescription?: string;
|
|
11888
|
+
tags?: string[];
|
|
11889
|
+
projectName?: string;
|
|
11890
|
+
}): void;
|
|
11891
|
+
/**
|
|
11892
|
+
* Shared background-sync helper for subclass constructors.
|
|
11893
|
+
* Calls the provided create function, then only updates sync state when the
|
|
11894
|
+
* returned instance is truly synced (has id, versionId, and commit populated).
|
|
11895
|
+
* If the create call throws, or returns an unsynced instance, _synced stays false.
|
|
11896
|
+
*/
|
|
11897
|
+
protected _syncViaCreate<T extends BasePrompt>(create: () => Promise<T>): Promise<void>;
|
|
11898
|
+
/**
|
|
11899
|
+
* Resolves when initialization completes.
|
|
11900
|
+
* Returns immediately if the prompt was already persisted (e.g. retrieved from backend).
|
|
11901
|
+
*/
|
|
11902
|
+
ready(): Promise<void>;
|
|
11872
11903
|
get name(): string;
|
|
11873
11904
|
get description(): string | undefined;
|
|
11874
11905
|
get tags(): readonly string[] | undefined;
|
|
@@ -11924,10 +11955,10 @@ declare abstract class BasePrompt {
|
|
|
11924
11955
|
*/
|
|
11925
11956
|
protected retrieveVersionByCommit(commit: string): Promise<PromptVersionDetail | null>;
|
|
11926
11957
|
/**
|
|
11927
|
-
* Throws an error if the prompt has not been synced with the backend.
|
|
11928
|
-
*
|
|
11958
|
+
* Throws an error if the prompt has not been successfully synced with the backend.
|
|
11959
|
+
* Used internally before backend operations to ensure we have a valid prompt ID.
|
|
11929
11960
|
*/
|
|
11930
|
-
protected
|
|
11961
|
+
protected ensureSynced(operation: string): void;
|
|
11931
11962
|
/**
|
|
11932
11963
|
* Get a specific version by commit hash.
|
|
11933
11964
|
* Returns a new instance of the appropriate prompt type.
|
|
@@ -11966,9 +11997,12 @@ declare class Prompt extends BasePrompt {
|
|
|
11966
11997
|
readonly prompt: string;
|
|
11967
11998
|
/**
|
|
11968
11999
|
* Creates a new Prompt instance.
|
|
11969
|
-
*
|
|
12000
|
+
* All operations work seamlessly without requiring manual configuration.
|
|
11970
12001
|
*/
|
|
12002
|
+
constructor(data: PromptData);
|
|
12003
|
+
/** @deprecated Passing an opik client is deprecated. */
|
|
11971
12004
|
constructor(data: PromptData, opik: OpikClient);
|
|
12005
|
+
private _performSync;
|
|
11972
12006
|
/**
|
|
11973
12007
|
* Returns the template string for this text prompt.
|
|
11974
12008
|
* Alias for the `prompt` property for consistency with ChatPrompt.
|
|
@@ -12040,23 +12074,6 @@ declare class Prompt extends BasePrompt {
|
|
|
12040
12074
|
* ```
|
|
12041
12075
|
*/
|
|
12042
12076
|
useVersion(version: PromptVersion): Promise<Prompt>;
|
|
12043
|
-
/**
|
|
12044
|
-
* Get a Prompt with a specific version by commit hash.
|
|
12045
|
-
*
|
|
12046
|
-
* @param commit - Commit hash (8-char short form or full)
|
|
12047
|
-
* @returns Prompt instance representing that version, or null if not found
|
|
12048
|
-
*
|
|
12049
|
-
* @example
|
|
12050
|
-
* ```typescript
|
|
12051
|
-
* const prompt = await client.getPrompt({ name: "greeting" });
|
|
12052
|
-
*
|
|
12053
|
-
* // Get a specific version directly as a Prompt
|
|
12054
|
-
* const versionedPrompt = await prompt.getVersion("abc123de");
|
|
12055
|
-
* if (versionedPrompt) {
|
|
12056
|
-
* const text = versionedPrompt.format({ name: "Alice" });
|
|
12057
|
-
* }
|
|
12058
|
-
* ```
|
|
12059
|
-
*/
|
|
12060
12077
|
/**
|
|
12061
12078
|
* Synchronize the prompt with the backend.
|
|
12062
12079
|
*
|
|
@@ -12066,6 +12083,12 @@ declare class Prompt extends BasePrompt {
|
|
|
12066
12083
|
* @returns Promise resolving to a new synced Prompt instance, or this instance if sync fails
|
|
12067
12084
|
*/
|
|
12068
12085
|
syncWithBackend(): Promise<Prompt>;
|
|
12086
|
+
/**
|
|
12087
|
+
* Get a Prompt with a specific version by commit hash.
|
|
12088
|
+
*
|
|
12089
|
+
* @param commit - Commit hash (8-char short form or full)
|
|
12090
|
+
* @returns Prompt instance representing that version, or null if not found
|
|
12091
|
+
*/
|
|
12069
12092
|
getVersion(commit: string): Promise<Prompt | null>;
|
|
12070
12093
|
}
|
|
12071
12094
|
|
|
@@ -13141,9 +13164,12 @@ declare class ChatPrompt extends BasePrompt {
|
|
|
13141
13164
|
private readonly chatTemplate;
|
|
13142
13165
|
/**
|
|
13143
13166
|
* Creates a new ChatPrompt instance.
|
|
13144
|
-
*
|
|
13167
|
+
* All operations work seamlessly without requiring manual configuration.
|
|
13145
13168
|
*/
|
|
13169
|
+
constructor(data: ChatPromptData);
|
|
13170
|
+
/** @deprecated Passing an opik client is deprecated. */
|
|
13146
13171
|
constructor(data: ChatPromptData, opik: OpikClient);
|
|
13172
|
+
private _performSync;
|
|
13147
13173
|
/**
|
|
13148
13174
|
* Returns the template messages for this chat prompt.
|
|
13149
13175
|
* Alias for the `messages` property for consistency with Prompt.
|
|
@@ -13224,23 +13250,6 @@ declare class ChatPrompt extends BasePrompt {
|
|
|
13224
13250
|
* ```
|
|
13225
13251
|
*/
|
|
13226
13252
|
useVersion(version: PromptVersion): Promise<ChatPrompt>;
|
|
13227
|
-
/**
|
|
13228
|
-
* Get a ChatPrompt with a specific version by commit hash.
|
|
13229
|
-
*
|
|
13230
|
-
* @param commit - Commit hash (8-char short form or full)
|
|
13231
|
-
* @returns ChatPrompt instance representing that version, or null if not found
|
|
13232
|
-
*
|
|
13233
|
-
* @example
|
|
13234
|
-
* ```typescript
|
|
13235
|
-
* const chatPrompt = await client.getChatPrompt({ name: "greeting" });
|
|
13236
|
-
*
|
|
13237
|
-
* // Get a specific version directly as a ChatPrompt
|
|
13238
|
-
* const versionedPrompt = await chatPrompt.getVersion("abc123de");
|
|
13239
|
-
* if (versionedPrompt) {
|
|
13240
|
-
* const messages = versionedPrompt.format({ name: "Alice" });
|
|
13241
|
-
* }
|
|
13242
|
-
* ```
|
|
13243
|
-
*/
|
|
13244
13253
|
/**
|
|
13245
13254
|
* Synchronize the chat prompt with the backend.
|
|
13246
13255
|
*
|
|
@@ -13250,6 +13259,12 @@ declare class ChatPrompt extends BasePrompt {
|
|
|
13250
13259
|
* @returns Promise resolving to a new synced ChatPrompt instance, or this instance if sync fails
|
|
13251
13260
|
*/
|
|
13252
13261
|
syncWithBackend(): Promise<ChatPrompt>;
|
|
13262
|
+
/**
|
|
13263
|
+
* Get a ChatPrompt with a specific version by commit hash.
|
|
13264
|
+
*
|
|
13265
|
+
* @param commit - Commit hash (8-char short form or full)
|
|
13266
|
+
* @returns ChatPrompt instance representing that version, or null if not found
|
|
13267
|
+
*/
|
|
13253
13268
|
getVersion(commit: string): Promise<ChatPrompt | null>;
|
|
13254
13269
|
}
|
|
13255
13270
|
|
|
@@ -13948,6 +13963,11 @@ declare class OpikClient {
|
|
|
13948
13963
|
* Throws ConfigMismatchError on the first mismatch found.
|
|
13949
13964
|
*/
|
|
13950
13965
|
private _validatePromptProjects;
|
|
13966
|
+
/**
|
|
13967
|
+
* Waits for all unsynced BasePrompt values in `values` to finish syncing,
|
|
13968
|
+
* with a timeout. Returns true only when every prompt is synced.
|
|
13969
|
+
*/
|
|
13970
|
+
private _allPromptsSynced;
|
|
13951
13971
|
private _makeFallbackConfig;
|
|
13952
13972
|
/**
|
|
13953
13973
|
* Fetches a blueprint from the backend (or returns the cached one).
|
|
@@ -15861,6 +15881,10 @@ declare class DatasetVersionNotFoundError extends OpikError {
|
|
|
15861
15881
|
constructor(versionName: string, datasetName: string);
|
|
15862
15882
|
}
|
|
15863
15883
|
|
|
15884
|
+
declare function getGlobalClient(): OpikClient;
|
|
15885
|
+
declare function setGlobalClient(client: OpikClient): void;
|
|
15886
|
+
declare function resetGlobalClient(): void;
|
|
15887
|
+
|
|
15864
15888
|
/**
|
|
15865
15889
|
* Type definitions for OQL (Opik Query Language) parser
|
|
15866
15890
|
*/
|
|
@@ -15989,4 +16013,4 @@ declare class ConfigMismatchError extends OpikError {
|
|
|
15989
16013
|
|
|
15990
16014
|
declare function activateRunner(): void;
|
|
15991
16015
|
|
|
15992
|
-
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 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, 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, 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, getTrackContext, logger, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
|
|
16016
|
+
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 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, 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, 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, getGlobalClient, getTrackContext, logger, resetGlobalClient, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setGlobalClient, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
|
package/dist/index.d.ts
CHANGED
|
@@ -11854,21 +11854,52 @@ interface BasePromptData {
|
|
|
11854
11854
|
* Provides common functionality for versioning, property updates, and deletion.
|
|
11855
11855
|
*/
|
|
11856
11856
|
declare abstract class BasePrompt {
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11857
|
+
private _id;
|
|
11858
|
+
private _versionId;
|
|
11859
|
+
private _commit;
|
|
11860
|
+
private _synced;
|
|
11861
|
+
private _changeDescription;
|
|
11862
|
+
private _projectName;
|
|
11860
11863
|
readonly type: PromptType;
|
|
11861
|
-
readonly changeDescription: string | undefined;
|
|
11862
11864
|
readonly templateStructure: PromptTemplateStructure;
|
|
11863
|
-
readonly projectName: string | undefined;
|
|
11864
|
-
/** Whether the prompt has been successfully synced with the backend. */
|
|
11865
|
-
readonly synced: boolean;
|
|
11866
11865
|
protected _name: string;
|
|
11867
11866
|
protected _description: string | undefined;
|
|
11868
11867
|
protected _tags: string[];
|
|
11869
11868
|
protected readonly _metadata: JsonNode | undefined;
|
|
11870
11869
|
protected readonly opik: OpikClient;
|
|
11871
|
-
|
|
11870
|
+
/** Pending background sync promise, set when constructed without synced:true. */
|
|
11871
|
+
protected _pendingSync: Promise<void> | null;
|
|
11872
|
+
get id(): string | undefined;
|
|
11873
|
+
get versionId(): string | undefined;
|
|
11874
|
+
get commit(): string | undefined;
|
|
11875
|
+
/** Whether the prompt has been successfully synced with the backend. */
|
|
11876
|
+
get synced(): boolean;
|
|
11877
|
+
get changeDescription(): string | undefined;
|
|
11878
|
+
get projectName(): string | undefined;
|
|
11879
|
+
constructor(data: BasePromptData, opik?: OpikClient);
|
|
11880
|
+
/**
|
|
11881
|
+
* Updates internal state after a successful background sync.
|
|
11882
|
+
*/
|
|
11883
|
+
protected updateSyncState(result: {
|
|
11884
|
+
promptId?: string;
|
|
11885
|
+
versionId?: string;
|
|
11886
|
+
commit?: string;
|
|
11887
|
+
changeDescription?: string;
|
|
11888
|
+
tags?: string[];
|
|
11889
|
+
projectName?: string;
|
|
11890
|
+
}): void;
|
|
11891
|
+
/**
|
|
11892
|
+
* Shared background-sync helper for subclass constructors.
|
|
11893
|
+
* Calls the provided create function, then only updates sync state when the
|
|
11894
|
+
* returned instance is truly synced (has id, versionId, and commit populated).
|
|
11895
|
+
* If the create call throws, or returns an unsynced instance, _synced stays false.
|
|
11896
|
+
*/
|
|
11897
|
+
protected _syncViaCreate<T extends BasePrompt>(create: () => Promise<T>): Promise<void>;
|
|
11898
|
+
/**
|
|
11899
|
+
* Resolves when initialization completes.
|
|
11900
|
+
* Returns immediately if the prompt was already persisted (e.g. retrieved from backend).
|
|
11901
|
+
*/
|
|
11902
|
+
ready(): Promise<void>;
|
|
11872
11903
|
get name(): string;
|
|
11873
11904
|
get description(): string | undefined;
|
|
11874
11905
|
get tags(): readonly string[] | undefined;
|
|
@@ -11924,10 +11955,10 @@ declare abstract class BasePrompt {
|
|
|
11924
11955
|
*/
|
|
11925
11956
|
protected retrieveVersionByCommit(commit: string): Promise<PromptVersionDetail | null>;
|
|
11926
11957
|
/**
|
|
11927
|
-
* Throws an error if the prompt has not been synced with the backend.
|
|
11928
|
-
*
|
|
11958
|
+
* Throws an error if the prompt has not been successfully synced with the backend.
|
|
11959
|
+
* Used internally before backend operations to ensure we have a valid prompt ID.
|
|
11929
11960
|
*/
|
|
11930
|
-
protected
|
|
11961
|
+
protected ensureSynced(operation: string): void;
|
|
11931
11962
|
/**
|
|
11932
11963
|
* Get a specific version by commit hash.
|
|
11933
11964
|
* Returns a new instance of the appropriate prompt type.
|
|
@@ -11966,9 +11997,12 @@ declare class Prompt extends BasePrompt {
|
|
|
11966
11997
|
readonly prompt: string;
|
|
11967
11998
|
/**
|
|
11968
11999
|
* Creates a new Prompt instance.
|
|
11969
|
-
*
|
|
12000
|
+
* All operations work seamlessly without requiring manual configuration.
|
|
11970
12001
|
*/
|
|
12002
|
+
constructor(data: PromptData);
|
|
12003
|
+
/** @deprecated Passing an opik client is deprecated. */
|
|
11971
12004
|
constructor(data: PromptData, opik: OpikClient);
|
|
12005
|
+
private _performSync;
|
|
11972
12006
|
/**
|
|
11973
12007
|
* Returns the template string for this text prompt.
|
|
11974
12008
|
* Alias for the `prompt` property for consistency with ChatPrompt.
|
|
@@ -12040,23 +12074,6 @@ declare class Prompt extends BasePrompt {
|
|
|
12040
12074
|
* ```
|
|
12041
12075
|
*/
|
|
12042
12076
|
useVersion(version: PromptVersion): Promise<Prompt>;
|
|
12043
|
-
/**
|
|
12044
|
-
* Get a Prompt with a specific version by commit hash.
|
|
12045
|
-
*
|
|
12046
|
-
* @param commit - Commit hash (8-char short form or full)
|
|
12047
|
-
* @returns Prompt instance representing that version, or null if not found
|
|
12048
|
-
*
|
|
12049
|
-
* @example
|
|
12050
|
-
* ```typescript
|
|
12051
|
-
* const prompt = await client.getPrompt({ name: "greeting" });
|
|
12052
|
-
*
|
|
12053
|
-
* // Get a specific version directly as a Prompt
|
|
12054
|
-
* const versionedPrompt = await prompt.getVersion("abc123de");
|
|
12055
|
-
* if (versionedPrompt) {
|
|
12056
|
-
* const text = versionedPrompt.format({ name: "Alice" });
|
|
12057
|
-
* }
|
|
12058
|
-
* ```
|
|
12059
|
-
*/
|
|
12060
12077
|
/**
|
|
12061
12078
|
* Synchronize the prompt with the backend.
|
|
12062
12079
|
*
|
|
@@ -12066,6 +12083,12 @@ declare class Prompt extends BasePrompt {
|
|
|
12066
12083
|
* @returns Promise resolving to a new synced Prompt instance, or this instance if sync fails
|
|
12067
12084
|
*/
|
|
12068
12085
|
syncWithBackend(): Promise<Prompt>;
|
|
12086
|
+
/**
|
|
12087
|
+
* Get a Prompt with a specific version by commit hash.
|
|
12088
|
+
*
|
|
12089
|
+
* @param commit - Commit hash (8-char short form or full)
|
|
12090
|
+
* @returns Prompt instance representing that version, or null if not found
|
|
12091
|
+
*/
|
|
12069
12092
|
getVersion(commit: string): Promise<Prompt | null>;
|
|
12070
12093
|
}
|
|
12071
12094
|
|
|
@@ -13141,9 +13164,12 @@ declare class ChatPrompt extends BasePrompt {
|
|
|
13141
13164
|
private readonly chatTemplate;
|
|
13142
13165
|
/**
|
|
13143
13166
|
* Creates a new ChatPrompt instance.
|
|
13144
|
-
*
|
|
13167
|
+
* All operations work seamlessly without requiring manual configuration.
|
|
13145
13168
|
*/
|
|
13169
|
+
constructor(data: ChatPromptData);
|
|
13170
|
+
/** @deprecated Passing an opik client is deprecated. */
|
|
13146
13171
|
constructor(data: ChatPromptData, opik: OpikClient);
|
|
13172
|
+
private _performSync;
|
|
13147
13173
|
/**
|
|
13148
13174
|
* Returns the template messages for this chat prompt.
|
|
13149
13175
|
* Alias for the `messages` property for consistency with Prompt.
|
|
@@ -13224,23 +13250,6 @@ declare class ChatPrompt extends BasePrompt {
|
|
|
13224
13250
|
* ```
|
|
13225
13251
|
*/
|
|
13226
13252
|
useVersion(version: PromptVersion): Promise<ChatPrompt>;
|
|
13227
|
-
/**
|
|
13228
|
-
* Get a ChatPrompt with a specific version by commit hash.
|
|
13229
|
-
*
|
|
13230
|
-
* @param commit - Commit hash (8-char short form or full)
|
|
13231
|
-
* @returns ChatPrompt instance representing that version, or null if not found
|
|
13232
|
-
*
|
|
13233
|
-
* @example
|
|
13234
|
-
* ```typescript
|
|
13235
|
-
* const chatPrompt = await client.getChatPrompt({ name: "greeting" });
|
|
13236
|
-
*
|
|
13237
|
-
* // Get a specific version directly as a ChatPrompt
|
|
13238
|
-
* const versionedPrompt = await chatPrompt.getVersion("abc123de");
|
|
13239
|
-
* if (versionedPrompt) {
|
|
13240
|
-
* const messages = versionedPrompt.format({ name: "Alice" });
|
|
13241
|
-
* }
|
|
13242
|
-
* ```
|
|
13243
|
-
*/
|
|
13244
13253
|
/**
|
|
13245
13254
|
* Synchronize the chat prompt with the backend.
|
|
13246
13255
|
*
|
|
@@ -13250,6 +13259,12 @@ declare class ChatPrompt extends BasePrompt {
|
|
|
13250
13259
|
* @returns Promise resolving to a new synced ChatPrompt instance, or this instance if sync fails
|
|
13251
13260
|
*/
|
|
13252
13261
|
syncWithBackend(): Promise<ChatPrompt>;
|
|
13262
|
+
/**
|
|
13263
|
+
* Get a ChatPrompt with a specific version by commit hash.
|
|
13264
|
+
*
|
|
13265
|
+
* @param commit - Commit hash (8-char short form or full)
|
|
13266
|
+
* @returns ChatPrompt instance representing that version, or null if not found
|
|
13267
|
+
*/
|
|
13253
13268
|
getVersion(commit: string): Promise<ChatPrompt | null>;
|
|
13254
13269
|
}
|
|
13255
13270
|
|
|
@@ -13948,6 +13963,11 @@ declare class OpikClient {
|
|
|
13948
13963
|
* Throws ConfigMismatchError on the first mismatch found.
|
|
13949
13964
|
*/
|
|
13950
13965
|
private _validatePromptProjects;
|
|
13966
|
+
/**
|
|
13967
|
+
* Waits for all unsynced BasePrompt values in `values` to finish syncing,
|
|
13968
|
+
* with a timeout. Returns true only when every prompt is synced.
|
|
13969
|
+
*/
|
|
13970
|
+
private _allPromptsSynced;
|
|
13951
13971
|
private _makeFallbackConfig;
|
|
13952
13972
|
/**
|
|
13953
13973
|
* Fetches a blueprint from the backend (or returns the cached one).
|
|
@@ -15861,6 +15881,10 @@ declare class DatasetVersionNotFoundError extends OpikError {
|
|
|
15861
15881
|
constructor(versionName: string, datasetName: string);
|
|
15862
15882
|
}
|
|
15863
15883
|
|
|
15884
|
+
declare function getGlobalClient(): OpikClient;
|
|
15885
|
+
declare function setGlobalClient(client: OpikClient): void;
|
|
15886
|
+
declare function resetGlobalClient(): void;
|
|
15887
|
+
|
|
15864
15888
|
/**
|
|
15865
15889
|
* Type definitions for OQL (Opik Query Language) parser
|
|
15866
15890
|
*/
|
|
@@ -15989,4 +16013,4 @@ declare class ConfigMismatchError extends OpikError {
|
|
|
15989
16013
|
|
|
15990
16014
|
declare function activateRunner(): void;
|
|
15991
16015
|
|
|
15992
|
-
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 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, 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, 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, getTrackContext, logger, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
|
|
16016
|
+
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 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, 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, 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, getGlobalClient, getTrackContext, logger, resetGlobalClient, resolveEvaluators, resolveExecutionPolicy, resolveItemExecutionPolicy, resolveModel, runTests, serializeEvaluators, setGlobalClient, setLoggerLevel, track, validateEvaluators, validateExecutionPolicy };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
import {Ba}from'./chunk-FTTQJ4TO.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,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,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,Aa as z}from'./chunk-FTTQJ4TO.js';Ba();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {ya}from'./chunk-FTTQJ4TO.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-FTTQJ4TO.js';ya();
|