@keywordsai/keywordsai-sdk 0.0.13 → 0.0.14
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/constants/datasetConstants.d.ts +16 -0
- package/dist/constants/datasetConstants.js +17 -0
- package/dist/constants/datasetConstants.js.map +1 -0
- package/dist/constants/evluatorConstants.d.ts +0 -0
- package/dist/constants/evluatorConstants.js +2 -0
- package/dist/constants/evluatorConstants.js.map +1 -0
- package/dist/constants/experimentConstants.d.ts +0 -0
- package/dist/constants/experimentConstants.js +2 -0
- package/dist/constants/experimentConstants.js.map +1 -0
- package/dist/constants/index.d.ts +3 -1
- package/dist/constants/index.js +3 -1
- package/dist/constants/index.js.map +1 -1
- package/dist/constants/logConstants.d.ts +17 -0
- package/dist/constants/logConstants.js +21 -0
- package/dist/constants/logConstants.js.map +1 -0
- package/dist/constants/promptConstants.d.ts +10 -0
- package/dist/constants/promptConstants.js +8 -0
- package/dist/constants/promptConstants.js.map +1 -0
- package/dist/types/datasetTypes.d.ts +65 -0
- package/dist/types/datasetTypes.js +2 -0
- package/dist/types/datasetTypes.js.map +1 -0
- package/dist/types/evaluatorTypes.d.ts +10 -0
- package/dist/types/evaluatorTypes.js +2 -0
- package/dist/types/evaluatorTypes.js.map +1 -0
- package/dist/types/experimentTypes.d.ts +158 -0
- package/dist/types/experimentTypes.js +10 -0
- package/dist/types/experimentTypes.js.map +1 -0
- package/dist/types/genericTypes.d.ts +18 -0
- package/dist/types/genericTypes.js +2 -0
- package/dist/types/genericTypes.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/promptTypes.d.ts +59 -0
- package/dist/types/promptTypes.js +2 -0
- package/dist/types/promptTypes.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const DATASET_TYPE_LLM: "llm";
|
|
2
|
+
export declare const DATASET_TYPE_SAMPLING: "sampling";
|
|
3
|
+
export type DatasetType = typeof DATASET_TYPE_LLM | typeof DATASET_TYPE_SAMPLING;
|
|
4
|
+
export declare const DATASET_STATUS_INITIALIZING: "initializing";
|
|
5
|
+
export declare const DATASET_STATUS_READY: "ready";
|
|
6
|
+
export declare const DATASET_STATUS_RUNNING: "running";
|
|
7
|
+
export declare const DATASET_STATUS_COMPLETED: "completed";
|
|
8
|
+
export declare const DATASET_STATUS_FAILED: "failed";
|
|
9
|
+
export declare const DATASET_STATUS_LOADING: "loading";
|
|
10
|
+
export type DatasetStatus = typeof DATASET_STATUS_INITIALIZING | typeof DATASET_STATUS_READY | typeof DATASET_STATUS_RUNNING | typeof DATASET_STATUS_COMPLETED | typeof DATASET_STATUS_FAILED | typeof DATASET_STATUS_LOADING;
|
|
11
|
+
export declare const DATASET_LLM_RUN_STATUS_PENDING: "pending";
|
|
12
|
+
export declare const DATASET_LLM_RUN_STATUS_RUNNING: "running";
|
|
13
|
+
export declare const DATASET_LLM_RUN_STATUS_COMPLETED: "completed";
|
|
14
|
+
export declare const DATASET_LLM_RUN_STATUS_FAILED: "failed";
|
|
15
|
+
export declare const DATASET_LLM_RUN_STATUS_CANCELLED: "cancelled";
|
|
16
|
+
export type DatasetLLMRunStatus = typeof DATASET_LLM_RUN_STATUS_PENDING | typeof DATASET_LLM_RUN_STATUS_RUNNING | typeof DATASET_LLM_RUN_STATUS_COMPLETED | typeof DATASET_LLM_RUN_STATUS_FAILED | typeof DATASET_LLM_RUN_STATUS_CANCELLED;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Dataset Types
|
|
2
|
+
export const DATASET_TYPE_LLM = "llm";
|
|
3
|
+
export const DATASET_TYPE_SAMPLING = "sampling";
|
|
4
|
+
// Dataset Status
|
|
5
|
+
export const DATASET_STATUS_INITIALIZING = "initializing";
|
|
6
|
+
export const DATASET_STATUS_READY = "ready";
|
|
7
|
+
export const DATASET_STATUS_RUNNING = "running";
|
|
8
|
+
export const DATASET_STATUS_COMPLETED = "completed";
|
|
9
|
+
export const DATASET_STATUS_FAILED = "failed";
|
|
10
|
+
export const DATASET_STATUS_LOADING = "loading";
|
|
11
|
+
// Eval Set LLM Run Status
|
|
12
|
+
export const DATASET_LLM_RUN_STATUS_PENDING = "pending";
|
|
13
|
+
export const DATASET_LLM_RUN_STATUS_RUNNING = "running";
|
|
14
|
+
export const DATASET_LLM_RUN_STATUS_COMPLETED = "completed";
|
|
15
|
+
export const DATASET_LLM_RUN_STATUS_FAILED = "failed";
|
|
16
|
+
export const DATASET_LLM_RUN_STATUS_CANCELLED = "cancelled";
|
|
17
|
+
//# sourceMappingURL=datasetConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasetConstants.js","sourceRoot":"","sources":["../../src/constants/datasetConstants.ts"],"names":[],"mappings":"AAAA,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAmB,CAAC;AAIzD,iBAAiB;AACjB,MAAM,CAAC,MAAM,2BAA2B,GAAG,cAAuB,CAAC;AACnE,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAgB,CAAC;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAkB,CAAC;AACzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAoB,CAAC;AAC7D,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAiB,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,SAAkB,CAAC;AAUzD,0BAA0B;AAC1B,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAkB,CAAC;AACjE,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAkB,CAAC;AACjE,MAAM,CAAC,MAAM,gCAAgC,GAAG,WAAoB,CAAC;AACrE,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAiB,CAAC;AAC/D,MAAM,CAAC,MAAM,gCAAgC,GAAG,WAAoB,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evluatorConstants.js","sourceRoot":"","sources":["../../src/constants/evluatorConstants.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experimentConstants.js","sourceRoot":"","sources":["../../src/constants/experimentConstants.ts"],"names":[],"mappings":""}
|
package/dist/constants/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare enum KeywordsLogType {
|
|
2
|
+
TEXT = "text",
|
|
3
|
+
RESPONSE = "response",
|
|
4
|
+
EMBEDDING = "embedding",
|
|
5
|
+
TRANSCRIPTION = "transcription",
|
|
6
|
+
SPEECH = "speech",
|
|
7
|
+
WORKFLOW = "workflow",
|
|
8
|
+
TASK = "task",
|
|
9
|
+
TOOL = "tool",
|
|
10
|
+
AGENT = "agent",
|
|
11
|
+
HANDOFF = "handoff",
|
|
12
|
+
GUARDRAIL = "guardrail",
|
|
13
|
+
FUNCTION = "function",
|
|
14
|
+
CUSTOM = "custom",
|
|
15
|
+
GENERATION = "generation",
|
|
16
|
+
UNKNOWN = "unknown"
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Mapping from Vercel AI SDK span types to KeywordsAI log types
|
|
2
|
+
// Define KeywordsAI log type enum
|
|
3
|
+
export var KeywordsLogType;
|
|
4
|
+
(function (KeywordsLogType) {
|
|
5
|
+
KeywordsLogType["TEXT"] = "text";
|
|
6
|
+
KeywordsLogType["RESPONSE"] = "response";
|
|
7
|
+
KeywordsLogType["EMBEDDING"] = "embedding";
|
|
8
|
+
KeywordsLogType["TRANSCRIPTION"] = "transcription";
|
|
9
|
+
KeywordsLogType["SPEECH"] = "speech";
|
|
10
|
+
KeywordsLogType["WORKFLOW"] = "workflow";
|
|
11
|
+
KeywordsLogType["TASK"] = "task";
|
|
12
|
+
KeywordsLogType["TOOL"] = "tool";
|
|
13
|
+
KeywordsLogType["AGENT"] = "agent";
|
|
14
|
+
KeywordsLogType["HANDOFF"] = "handoff";
|
|
15
|
+
KeywordsLogType["GUARDRAIL"] = "guardrail";
|
|
16
|
+
KeywordsLogType["FUNCTION"] = "function";
|
|
17
|
+
KeywordsLogType["CUSTOM"] = "custom";
|
|
18
|
+
KeywordsLogType["GENERATION"] = "generation";
|
|
19
|
+
KeywordsLogType["UNKNOWN"] = "unknown";
|
|
20
|
+
})(KeywordsLogType || (KeywordsLogType = {}));
|
|
21
|
+
//# sourceMappingURL=logConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logConstants.js","sourceRoot":"","sources":["../../src/constants/logConstants.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kCAAkC;AAClC,MAAM,CAAN,IAAY,eAgBX;AAhBD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,wCAAqB,CAAA;IACrB,0CAAuB,CAAA;IACvB,kDAA+B,CAAA;IAC/B,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,kCAAe,CAAA;IACf,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;IACvB,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,4CAAyB,CAAA;IACzB,sCAAmB,CAAA;AACrB,CAAC,EAhBW,eAAe,KAAf,eAAe,QAgB1B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type MessageRoleType = "user" | "assistant" | "system" | "tool" | "none" | "developer";
|
|
2
|
+
export type ResponseFormatType = "text" | "json" | "json_object" | "json_schema";
|
|
3
|
+
export type ToolChoiceType = "auto" | "none" | "required";
|
|
4
|
+
export type ReasoningEffortType = "low" | "medium" | "high";
|
|
5
|
+
export declare const ACTIVITY_TYPE_PROMPT_CREATION: "prompt_creation";
|
|
6
|
+
export declare const ACTIVITY_TYPE_COMMIT: "commit";
|
|
7
|
+
export declare const ACTIVITY_TYPE_UPDATE: "update";
|
|
8
|
+
export declare const ACTIVITY_TYPE_DELETE: "delete";
|
|
9
|
+
export type ActivityType = "prompt_creation" | "commit" | "update" | "delete";
|
|
10
|
+
export declare const DEFAULT_MODEL = "gpt-4o-mini";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Activity types
|
|
2
|
+
export const ACTIVITY_TYPE_PROMPT_CREATION = "prompt_creation";
|
|
3
|
+
export const ACTIVITY_TYPE_COMMIT = "commit";
|
|
4
|
+
export const ACTIVITY_TYPE_UPDATE = "update";
|
|
5
|
+
export const ACTIVITY_TYPE_DELETE = "delete";
|
|
6
|
+
// Common model names (can be extended as needed)
|
|
7
|
+
export const DEFAULT_MODEL = "gpt-4o-mini";
|
|
8
|
+
//# sourceMappingURL=promptConstants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptConstants.js","sourceRoot":"","sources":["../../src/constants/promptConstants.ts"],"names":[],"mappings":"AAQA,iBAAiB;AACjB,MAAM,CAAC,MAAM,6BAA6B,GAAG,iBAA0B,CAAC;AACxE,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAiB,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAiB,CAAC;AAItD,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { DatasetType, DatasetStatus, DatasetLLMRunStatus } from "../constants/datasetConstants.js";
|
|
2
|
+
export type FilterParamDict = Record<string, any>;
|
|
3
|
+
export interface Dataset {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type?: DatasetType;
|
|
7
|
+
description?: string;
|
|
8
|
+
created_at: string;
|
|
9
|
+
running_progress?: number;
|
|
10
|
+
running_status?: DatasetLLMRunStatus;
|
|
11
|
+
running_at?: string;
|
|
12
|
+
updated_at: string;
|
|
13
|
+
updated_by?: Record<string, any> | number | string;
|
|
14
|
+
organization: Record<string, any> | number | string;
|
|
15
|
+
initial_log_filters?: FilterParamDict;
|
|
16
|
+
log_ids?: string[];
|
|
17
|
+
unique_organization_ids?: string[];
|
|
18
|
+
timestamps?: string[];
|
|
19
|
+
log_count?: number;
|
|
20
|
+
evaluator?: string;
|
|
21
|
+
status?: DatasetStatus;
|
|
22
|
+
completed_annotation_count?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface DatasetCreate {
|
|
25
|
+
name: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
type?: DatasetType;
|
|
28
|
+
sampling?: number;
|
|
29
|
+
start_time?: string;
|
|
30
|
+
end_time?: string;
|
|
31
|
+
initial_log_filters?: FilterParamDict;
|
|
32
|
+
}
|
|
33
|
+
export interface DatasetUpdate {
|
|
34
|
+
name?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DatasetList {
|
|
38
|
+
results: Dataset[];
|
|
39
|
+
count?: number;
|
|
40
|
+
next?: string;
|
|
41
|
+
previous?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface LogManagementRequest {
|
|
44
|
+
start_time?: string;
|
|
45
|
+
end_time?: string;
|
|
46
|
+
filters: FilterParamDict;
|
|
47
|
+
}
|
|
48
|
+
export interface EvalRunRequest {
|
|
49
|
+
evaluator_slugs: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface EvalReport {
|
|
52
|
+
id: string;
|
|
53
|
+
dataset_id: string;
|
|
54
|
+
evaluator_slugs: string[];
|
|
55
|
+
status: string;
|
|
56
|
+
created_at: string;
|
|
57
|
+
updated_at: string;
|
|
58
|
+
results?: Record<string, any>;
|
|
59
|
+
}
|
|
60
|
+
export interface EvalReportList {
|
|
61
|
+
results: EvalReport[];
|
|
62
|
+
count?: number;
|
|
63
|
+
next?: string;
|
|
64
|
+
previous?: string;
|
|
65
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datasetTypes.js","sourceRoot":"","sources":["../../src/types/datasetTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PaginatedResponseType } from "./genericTypes.js";
|
|
2
|
+
export interface Evaluator {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
created_at: string;
|
|
8
|
+
updated_at: string;
|
|
9
|
+
}
|
|
10
|
+
export type EvaluatorList = PaginatedResponseType<Evaluator>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluatorTypes.js","sourceRoot":"","sources":["../../src/types/evaluatorTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { Message } from "./promptTypes.js";
|
|
2
|
+
import { ToolChoiceType } from "../constants/promptConstants.js";
|
|
3
|
+
export type StatusTypes = "ready" | "running" | "error" | "stopped" | "completed";
|
|
4
|
+
export interface FunctionTool {
|
|
5
|
+
type: "function";
|
|
6
|
+
function: {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
parameters?: Record<string, any>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export type ToolChoice = ToolChoiceType | {
|
|
13
|
+
type: "function";
|
|
14
|
+
function: {
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const UTC_EPOCH = "1970-01-01T00:00:00Z";
|
|
19
|
+
export interface ExperimentColumnType {
|
|
20
|
+
id?: string;
|
|
21
|
+
model: string;
|
|
22
|
+
name: string;
|
|
23
|
+
temperature: number;
|
|
24
|
+
max_completion_tokens: number;
|
|
25
|
+
top_p: number;
|
|
26
|
+
frequency_penalty: number;
|
|
27
|
+
presence_penalty: number;
|
|
28
|
+
tools?: FunctionTool[];
|
|
29
|
+
prompt_messages?: Message[];
|
|
30
|
+
reasoning_effort?: string;
|
|
31
|
+
stream?: boolean;
|
|
32
|
+
tool_choice?: string | ToolChoice;
|
|
33
|
+
response_format?: string | Record<string, any>;
|
|
34
|
+
}
|
|
35
|
+
export interface ExperimentLLMInferenceMetrics {
|
|
36
|
+
prompt_tokens?: number;
|
|
37
|
+
completion_tokens?: number;
|
|
38
|
+
total_tokens?: number;
|
|
39
|
+
prompt_tokens_details?: Record<string, any>;
|
|
40
|
+
completion_tokens_details?: Record<string, any>;
|
|
41
|
+
latency?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface ExperimentResultItemType {
|
|
44
|
+
id?: string;
|
|
45
|
+
column_id?: string;
|
|
46
|
+
output?: Record<string, any>;
|
|
47
|
+
error?: string;
|
|
48
|
+
ran_at?: string;
|
|
49
|
+
status?: StatusTypes;
|
|
50
|
+
evaluation_result?: Record<string, any>;
|
|
51
|
+
llm_inference_metrics?: ExperimentLLMInferenceMetrics;
|
|
52
|
+
}
|
|
53
|
+
export interface ExperimentRowType {
|
|
54
|
+
id?: string;
|
|
55
|
+
input?: Record<string, any>;
|
|
56
|
+
status?: StatusTypes;
|
|
57
|
+
results?: (ExperimentResultItemType | null)[];
|
|
58
|
+
ideal_output?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ExperimentRowV2Type {
|
|
61
|
+
id?: string;
|
|
62
|
+
inputs?: Record<string, any>;
|
|
63
|
+
items?: Record<string, ExperimentResultItemType>;
|
|
64
|
+
ideal_output?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ExperimentType {
|
|
67
|
+
id?: string;
|
|
68
|
+
column_count?: number;
|
|
69
|
+
columns?: ExperimentColumnType[];
|
|
70
|
+
created_at?: string;
|
|
71
|
+
created_by?: Record<string, any> | number | string;
|
|
72
|
+
name: string;
|
|
73
|
+
organization?: Record<string, any> | number | string;
|
|
74
|
+
row_count?: number;
|
|
75
|
+
rows?: ExperimentRowType[];
|
|
76
|
+
status?: string;
|
|
77
|
+
test_id?: string;
|
|
78
|
+
updated_at?: string;
|
|
79
|
+
updated_by?: Record<string, any> | number | string;
|
|
80
|
+
variables?: string[];
|
|
81
|
+
variable_definitions?: Record<string, any>[];
|
|
82
|
+
starred?: boolean;
|
|
83
|
+
tags?: (Record<string, any> | number | string)[];
|
|
84
|
+
description?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface CreateExperimentRequest {
|
|
87
|
+
columns: ExperimentColumnType[];
|
|
88
|
+
rows?: ExperimentRowType[];
|
|
89
|
+
name: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface ListExperimentsResponse {
|
|
93
|
+
experiments: ExperimentType[];
|
|
94
|
+
total?: number;
|
|
95
|
+
page?: number;
|
|
96
|
+
page_size?: number;
|
|
97
|
+
}
|
|
98
|
+
export interface AddExperimentRowsRequest {
|
|
99
|
+
rows: ExperimentRowType[];
|
|
100
|
+
}
|
|
101
|
+
export interface RemoveExperimentRowsRequest {
|
|
102
|
+
rows: string[];
|
|
103
|
+
}
|
|
104
|
+
export interface UpdateExperimentRowsRequest {
|
|
105
|
+
rows: ExperimentRowType[];
|
|
106
|
+
}
|
|
107
|
+
export interface AddExperimentColumnsRequest {
|
|
108
|
+
columns: ExperimentColumnType[];
|
|
109
|
+
}
|
|
110
|
+
export interface RemoveExperimentColumnsRequest {
|
|
111
|
+
columns: string[];
|
|
112
|
+
}
|
|
113
|
+
export interface UpdateExperimentColumnsRequest {
|
|
114
|
+
columns: ExperimentColumnType[];
|
|
115
|
+
}
|
|
116
|
+
export interface RunExperimentRequest {
|
|
117
|
+
columns?: ExperimentColumnType[];
|
|
118
|
+
}
|
|
119
|
+
export interface RunExperimentEvalsRequest {
|
|
120
|
+
evaluator_slugs: string[];
|
|
121
|
+
}
|
|
122
|
+
export interface Columns {
|
|
123
|
+
columns: ExperimentColumnType[];
|
|
124
|
+
}
|
|
125
|
+
export interface Rows {
|
|
126
|
+
rows: ExperimentRowType[];
|
|
127
|
+
}
|
|
128
|
+
export interface EditorType {
|
|
129
|
+
id: number;
|
|
130
|
+
name: string;
|
|
131
|
+
}
|
|
132
|
+
export interface TestCaseType {
|
|
133
|
+
description?: string;
|
|
134
|
+
name?: string;
|
|
135
|
+
headers?: string[];
|
|
136
|
+
rows?: Record<string, string | number | null>[];
|
|
137
|
+
}
|
|
138
|
+
export interface TestsetColumnDefinition {
|
|
139
|
+
field: string;
|
|
140
|
+
width?: number;
|
|
141
|
+
mapped_name?: string;
|
|
142
|
+
is_hidden?: boolean;
|
|
143
|
+
type?: "text" | "image_url" | "note";
|
|
144
|
+
}
|
|
145
|
+
export declare enum TestsetOperationType {
|
|
146
|
+
INSERT_ROWS = "insert_rows",
|
|
147
|
+
UPDATE_ROWS = "update_rows",
|
|
148
|
+
DELETE_ROWS = "delete_rows",
|
|
149
|
+
REORDER_ROWS = "reorder_rows"
|
|
150
|
+
}
|
|
151
|
+
export interface TestsetRowData {
|
|
152
|
+
row_index?: number;
|
|
153
|
+
height?: number;
|
|
154
|
+
row_data?: Record<string, string | number | null | boolean>;
|
|
155
|
+
}
|
|
156
|
+
export interface TestsetRowOperationsPayload {
|
|
157
|
+
testset_rows: TestsetRowData[];
|
|
158
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Constants
|
|
2
|
+
export const UTC_EPOCH = "1970-01-01T00:00:00Z";
|
|
3
|
+
export var TestsetOperationType;
|
|
4
|
+
(function (TestsetOperationType) {
|
|
5
|
+
TestsetOperationType["INSERT_ROWS"] = "insert_rows";
|
|
6
|
+
TestsetOperationType["UPDATE_ROWS"] = "update_rows";
|
|
7
|
+
TestsetOperationType["DELETE_ROWS"] = "delete_rows";
|
|
8
|
+
TestsetOperationType["REORDER_ROWS"] = "reorder_rows";
|
|
9
|
+
})(TestsetOperationType || (TestsetOperationType = {}));
|
|
10
|
+
//# sourceMappingURL=experimentTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experimentTypes.js","sourceRoot":"","sources":["../../src/types/experimentTypes.ts"],"names":[],"mappings":"AAkBA,YAAY;AACZ,MAAM,CAAC,MAAM,SAAS,GAAG,sBAAsB,CAAC;AAiKhD,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC5B,mDAA2B,CAAA;IAC3B,mDAA2B,CAAA;IAC3B,mDAA2B,CAAA;IAC3B,qDAA6B,CAAA;AACjC,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface RangeType {
|
|
2
|
+
min: number;
|
|
3
|
+
max: number;
|
|
4
|
+
}
|
|
5
|
+
export interface ParamType {
|
|
6
|
+
name: string;
|
|
7
|
+
type?: "string" | "number" | "boolean" | "object" | "array" | "int";
|
|
8
|
+
default?: string | number | boolean | object | any[] | null;
|
|
9
|
+
range?: RangeType;
|
|
10
|
+
description?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface PaginatedResponseType<T> {
|
|
14
|
+
results: T[];
|
|
15
|
+
count: number;
|
|
16
|
+
next?: string;
|
|
17
|
+
previous?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genericTypes.js","sourceRoot":"","sources":["../../src/types/genericTypes.ts"],"names":[],"mappings":""}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -4,3 +4,8 @@ export * from "./spanTypes.js";
|
|
|
4
4
|
export * from "./baseTypes.js";
|
|
5
5
|
export * from "./logTypes.js";
|
|
6
6
|
export * from "./tracingTypes.js";
|
|
7
|
+
export * from "./genericTypes.js";
|
|
8
|
+
export * from "./datasetTypes.js";
|
|
9
|
+
export * from "./promptTypes.js";
|
|
10
|
+
export * from "./evaluatorTypes.js";
|
|
11
|
+
export * from "./experimentTypes.js";
|
package/dist/types/index.js
CHANGED
|
@@ -4,4 +4,9 @@ export * from "./spanTypes.js";
|
|
|
4
4
|
export * from "./baseTypes.js";
|
|
5
5
|
export * from "./logTypes.js";
|
|
6
6
|
export * from "./tracingTypes.js";
|
|
7
|
+
export * from "./genericTypes.js";
|
|
8
|
+
export * from "./datasetTypes.js";
|
|
9
|
+
export * from "./promptTypes.js";
|
|
10
|
+
export * from "./evaluatorTypes.js";
|
|
11
|
+
export * from "./experimentTypes.js";
|
|
7
12
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PaginatedResponseType } from "./genericTypes.js";
|
|
2
|
+
import { MessageSchema } from "./logTypes.js";
|
|
3
|
+
import { ResponseFormatType, ToolChoiceType, ReasoningEffortType } from "../constants/promptConstants.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export type Message = z.infer<typeof MessageSchema>;
|
|
6
|
+
export interface PromptVersion {
|
|
7
|
+
id?: number | string;
|
|
8
|
+
prompt_version_id?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
created_at?: string;
|
|
11
|
+
updated_at?: string;
|
|
12
|
+
version?: number;
|
|
13
|
+
messages?: Message[];
|
|
14
|
+
edited_by?: Record<string, any>;
|
|
15
|
+
model?: string;
|
|
16
|
+
stream?: boolean;
|
|
17
|
+
temperature?: number;
|
|
18
|
+
max_tokens?: number;
|
|
19
|
+
top_p?: number;
|
|
20
|
+
frequency_penalty?: number;
|
|
21
|
+
presence_penalty?: number;
|
|
22
|
+
reasoning_effort?: ReasoningEffortType;
|
|
23
|
+
variables?: Record<string, any>;
|
|
24
|
+
readonly?: boolean;
|
|
25
|
+
fallback_models?: string[];
|
|
26
|
+
load_balance_models?: Record<string, any>[];
|
|
27
|
+
tools?: Record<string, any>[];
|
|
28
|
+
tool_choice?: ToolChoiceType | Record<string, any>;
|
|
29
|
+
response_format?: ResponseFormatType | Record<string, any>;
|
|
30
|
+
json_schema?: Record<string, any>;
|
|
31
|
+
is_enforcing_response_format?: boolean;
|
|
32
|
+
prompt?: number | string;
|
|
33
|
+
parent_prompt?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface Prompt {
|
|
36
|
+
id?: number | string;
|
|
37
|
+
name?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
prompt_id?: string;
|
|
40
|
+
prompt_slug?: string;
|
|
41
|
+
full_prompt_id?: string;
|
|
42
|
+
current_version?: PromptVersion;
|
|
43
|
+
live_version?: PromptVersion;
|
|
44
|
+
prompt_versions?: PromptVersion[];
|
|
45
|
+
prompt_activities?: Record<string, any>[];
|
|
46
|
+
commit_count?: number;
|
|
47
|
+
starred?: boolean;
|
|
48
|
+
tags?: Record<string, any>[];
|
|
49
|
+
}
|
|
50
|
+
export interface PromptCreateResponse extends Prompt {
|
|
51
|
+
}
|
|
52
|
+
export type PromptListResponse = PaginatedResponseType<Prompt>;
|
|
53
|
+
export interface PromptRetrieveResponse extends Prompt {
|
|
54
|
+
}
|
|
55
|
+
export interface PromptVersionCreateResponse extends PromptVersion {
|
|
56
|
+
}
|
|
57
|
+
export type PromptVersionListResponse = PaginatedResponseType<PromptVersion>;
|
|
58
|
+
export interface PromptVersionRetrieveResponse extends PromptVersion {
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptTypes.js","sourceRoot":"","sources":["../../src/types/promptTypes.ts"],"names":[],"mappings":""}
|