opik 1.9.11 → 1.9.13
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.cjs +23 -22
- package/dist/index.d.cts +7 -31
- package/dist/index.d.ts +7 -31
- package/dist/index.js +23 -22
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as stream from 'stream';
|
|
2
2
|
import { Logger } from 'tslog';
|
|
3
3
|
import z$1, { z } from 'zod';
|
|
4
|
-
import { LanguageModel } from 'ai';
|
|
4
|
+
import { ModelMessage, SystemModelMessage, UserModelMessage, AssistantModelMessage, ToolModelMessage, LanguageModel } from 'ai';
|
|
5
5
|
import { OpenAIProviderSettings } from '@ai-sdk/openai';
|
|
6
6
|
import { OpenAIChatModelId } from '@ai-sdk/openai/internal';
|
|
7
7
|
import { AnthropicProviderSettings } from '@ai-sdk/anthropic';
|
|
@@ -9732,14 +9732,6 @@ interface EvaluateOptions<T = Record<string, unknown>> {
|
|
|
9732
9732
|
}
|
|
9733
9733
|
declare function evaluate<T = Record<string, unknown>>(options: EvaluateOptions<T>): Promise<EvaluationResult>;
|
|
9734
9734
|
|
|
9735
|
-
type JSONValue = null | string | number | boolean | {
|
|
9736
|
-
[value: string]: JSONValue;
|
|
9737
|
-
} | Array<JSONValue>;
|
|
9738
|
-
/**
|
|
9739
|
-
* Provider-specific options.
|
|
9740
|
-
* Allows providers to pass through custom metadata and functionality.
|
|
9741
|
-
*/
|
|
9742
|
-
type ProviderOptions = Record<string, Record<string, JSONValue>>;
|
|
9743
9735
|
/**
|
|
9744
9736
|
* System message containing system instructions.
|
|
9745
9737
|
*
|
|
@@ -9747,42 +9739,26 @@ type ProviderOptions = Record<string, Record<string, JSONValue>>;
|
|
|
9747
9739
|
* to increase the resilience against prompt injection attacks,
|
|
9748
9740
|
* and because not all providers support several system messages.
|
|
9749
9741
|
*/
|
|
9750
|
-
|
|
9751
|
-
role: "system";
|
|
9752
|
-
content: string;
|
|
9753
|
-
providerOptions?: ProviderOptions;
|
|
9754
|
-
}
|
|
9742
|
+
type OpikSystemMessage = SystemModelMessage;
|
|
9755
9743
|
/**
|
|
9756
9744
|
* User message containing user input.
|
|
9757
9745
|
*/
|
|
9758
|
-
|
|
9759
|
-
role: "user";
|
|
9760
|
-
content: string;
|
|
9761
|
-
providerOptions?: ProviderOptions;
|
|
9762
|
-
}
|
|
9746
|
+
type OpikUserMessage = UserModelMessage;
|
|
9763
9747
|
/**
|
|
9764
9748
|
* Assistant message containing model response.
|
|
9765
9749
|
*/
|
|
9766
|
-
|
|
9767
|
-
role: "assistant";
|
|
9768
|
-
content: string;
|
|
9769
|
-
providerOptions?: ProviderOptions;
|
|
9770
|
-
}
|
|
9750
|
+
type OpikAssistantMessage = AssistantModelMessage;
|
|
9771
9751
|
/**
|
|
9772
9752
|
* Tool message containing tool call results.
|
|
9773
9753
|
*/
|
|
9774
|
-
|
|
9775
|
-
role: "tool";
|
|
9776
|
-
content: string;
|
|
9777
|
-
providerOptions?: ProviderOptions;
|
|
9778
|
-
}
|
|
9754
|
+
type OpikToolMessage = ToolModelMessage;
|
|
9779
9755
|
/**
|
|
9780
9756
|
* Union type of all message types.
|
|
9781
9757
|
* This is the main type to use for message arrays in LLM conversations.
|
|
9782
9758
|
*
|
|
9783
9759
|
* Provider-agnostic interface that can be adapted to any LLM provider.
|
|
9784
9760
|
*/
|
|
9785
|
-
type OpikMessage =
|
|
9761
|
+
type OpikMessage = ModelMessage;
|
|
9786
9762
|
/**
|
|
9787
9763
|
* Abstract base class for all LLM model providers in Opik evaluation system.
|
|
9788
9764
|
*
|
|
@@ -11200,4 +11176,4 @@ declare class OpikQueryLanguage {
|
|
|
11200
11176
|
private parseConnector;
|
|
11201
11177
|
}
|
|
11202
11178
|
|
|
11203
|
-
export { type AllProviderOptions, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, Contains, type DatasetPublic, type EvaluateOptions, type EvaluatePromptOptions, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, type GoogleProviderOptions, Hallucination, IsJson, type LLMJudgeModelSettings, 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, Prompt, PromptType, type
|
|
11179
|
+
export { type AllProviderOptions, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, Contains, type DatasetPublic, type EvaluateOptions, type EvaluatePromptOptions, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, type GoogleProviderOptions, Hallucination, IsJson, type LLMJudgeModelSettings, 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, Prompt, PromptType, type ProviderOptionsForModel, RegexMatch, type ScoringKeyMappingType, Span, SpanType, type SupportedModelId, Trace, Usefulness, VercelAIChatModel, createModel, createModelFromInstance, detectProvider, disableLogger, evaluate, evaluatePrompt, flushAll, generateId, getTrackContext, logger, resolveModel, setLoggerLevel, track };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as stream from 'stream';
|
|
2
2
|
import { Logger } from 'tslog';
|
|
3
3
|
import z$1, { z } from 'zod';
|
|
4
|
-
import { LanguageModel } from 'ai';
|
|
4
|
+
import { ModelMessage, SystemModelMessage, UserModelMessage, AssistantModelMessage, ToolModelMessage, LanguageModel } from 'ai';
|
|
5
5
|
import { OpenAIProviderSettings } from '@ai-sdk/openai';
|
|
6
6
|
import { OpenAIChatModelId } from '@ai-sdk/openai/internal';
|
|
7
7
|
import { AnthropicProviderSettings } from '@ai-sdk/anthropic';
|
|
@@ -9732,14 +9732,6 @@ interface EvaluateOptions<T = Record<string, unknown>> {
|
|
|
9732
9732
|
}
|
|
9733
9733
|
declare function evaluate<T = Record<string, unknown>>(options: EvaluateOptions<T>): Promise<EvaluationResult>;
|
|
9734
9734
|
|
|
9735
|
-
type JSONValue = null | string | number | boolean | {
|
|
9736
|
-
[value: string]: JSONValue;
|
|
9737
|
-
} | Array<JSONValue>;
|
|
9738
|
-
/**
|
|
9739
|
-
* Provider-specific options.
|
|
9740
|
-
* Allows providers to pass through custom metadata and functionality.
|
|
9741
|
-
*/
|
|
9742
|
-
type ProviderOptions = Record<string, Record<string, JSONValue>>;
|
|
9743
9735
|
/**
|
|
9744
9736
|
* System message containing system instructions.
|
|
9745
9737
|
*
|
|
@@ -9747,42 +9739,26 @@ type ProviderOptions = Record<string, Record<string, JSONValue>>;
|
|
|
9747
9739
|
* to increase the resilience against prompt injection attacks,
|
|
9748
9740
|
* and because not all providers support several system messages.
|
|
9749
9741
|
*/
|
|
9750
|
-
|
|
9751
|
-
role: "system";
|
|
9752
|
-
content: string;
|
|
9753
|
-
providerOptions?: ProviderOptions;
|
|
9754
|
-
}
|
|
9742
|
+
type OpikSystemMessage = SystemModelMessage;
|
|
9755
9743
|
/**
|
|
9756
9744
|
* User message containing user input.
|
|
9757
9745
|
*/
|
|
9758
|
-
|
|
9759
|
-
role: "user";
|
|
9760
|
-
content: string;
|
|
9761
|
-
providerOptions?: ProviderOptions;
|
|
9762
|
-
}
|
|
9746
|
+
type OpikUserMessage = UserModelMessage;
|
|
9763
9747
|
/**
|
|
9764
9748
|
* Assistant message containing model response.
|
|
9765
9749
|
*/
|
|
9766
|
-
|
|
9767
|
-
role: "assistant";
|
|
9768
|
-
content: string;
|
|
9769
|
-
providerOptions?: ProviderOptions;
|
|
9770
|
-
}
|
|
9750
|
+
type OpikAssistantMessage = AssistantModelMessage;
|
|
9771
9751
|
/**
|
|
9772
9752
|
* Tool message containing tool call results.
|
|
9773
9753
|
*/
|
|
9774
|
-
|
|
9775
|
-
role: "tool";
|
|
9776
|
-
content: string;
|
|
9777
|
-
providerOptions?: ProviderOptions;
|
|
9778
|
-
}
|
|
9754
|
+
type OpikToolMessage = ToolModelMessage;
|
|
9779
9755
|
/**
|
|
9780
9756
|
* Union type of all message types.
|
|
9781
9757
|
* This is the main type to use for message arrays in LLM conversations.
|
|
9782
9758
|
*
|
|
9783
9759
|
* Provider-agnostic interface that can be adapted to any LLM provider.
|
|
9784
9760
|
*/
|
|
9785
|
-
type OpikMessage =
|
|
9761
|
+
type OpikMessage = ModelMessage;
|
|
9786
9762
|
/**
|
|
9787
9763
|
* Abstract base class for all LLM model providers in Opik evaluation system.
|
|
9788
9764
|
*
|
|
@@ -11200,4 +11176,4 @@ declare class OpikQueryLanguage {
|
|
|
11200
11176
|
private parseConnector;
|
|
11201
11177
|
}
|
|
11202
11178
|
|
|
11203
|
-
export { type AllProviderOptions, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, Contains, type DatasetPublic, type EvaluateOptions, type EvaluatePromptOptions, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, type GoogleProviderOptions, Hallucination, IsJson, type LLMJudgeModelSettings, 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, Prompt, PromptType, type
|
|
11179
|
+
export { type AllProviderOptions, AnswerRelevance, type AnthropicProviderOptions, BaseLLMJudgeMetric, BaseMetric, Contains, type DatasetPublic, type EvaluateOptions, type EvaluatePromptOptions, type EvaluationResult, type EvaluationScoreResult, type EvaluationTask, type EvaluationTestCase, type EvaluationTestResult, ExactMatch, type FewShotExampleAnswerRelevanceNoContext, type FewShotExampleAnswerRelevanceWithContext, type FewShotExampleHallucination, type FewShotExampleModeration, type FilterExpression, type GoogleProviderOptions, Hallucination, IsJson, type LLMJudgeModelSettings, 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, Prompt, PromptType, type ProviderOptionsForModel, RegexMatch, type ScoringKeyMappingType, Span, SpanType, type SupportedModelId, Trace, Usefulness, VercelAIChatModel, createModel, createModelFromInstance, detectProvider, disableLogger, evaluate, evaluatePrompt, flushAll, generateId, getTrackContext, logger, resolveModel, setLoggerLevel, track };
|