@axiom-lattice/agent-eval 2.1.9
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/.env +29 -0
- package/.turbo/turbo-build.log +20 -0
- package/CHANGELOG.md +10 -0
- package/LICENSE +201 -0
- package/dist/index.d.mts +366 -0
- package/dist/index.d.ts +366 -0
- package/dist/index.js +1092 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1055 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +51 -0
- package/src/LatticeEval.ts +615 -0
- package/src/LatticeEvalProject.ts +496 -0
- package/src/LatticeEvalSuite.ts +321 -0
- package/src/index.ts +4 -0
- package/src/test.ts +23 -0
- package/src/types.ts +160 -0
- package/tsconfig.json +33 -0
package/.env
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Server Configuration
|
|
2
|
+
PORT=4001
|
|
3
|
+
NODE_ENV=development
|
|
4
|
+
|
|
5
|
+
# Webhook Configuration (Optional)
|
|
6
|
+
WEBHOOK_URL=your_webhook_url
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# DEEPSEEK_API_KEY=sk-83fd32abdac74106a5c35cd208b4b11c
|
|
10
|
+
|
|
11
|
+
# DEEPSEEK_API_KEY2=sk-fd6982eb19b34c0a85555f5a95e9b675
|
|
12
|
+
|
|
13
|
+
# SILICONCLOUD_API_KEY=sk-omhkuwebiotihbmgthgrcrzzneundgkeqmfrxnkzeldohpfi
|
|
14
|
+
|
|
15
|
+
# VOLCENGINE_API_KEY=3c11b06b-3d48-4cce-a1c7-d9e0f5fab80c
|
|
16
|
+
VOLCENGINE_API_KEY2=a0533576-d6ed-4ca4-a308-473cbf7ebd10
|
|
17
|
+
# KIMI_API_KEY=sk-9FlkLQyuBD5ULCEGFMFgnqHA5TtV0gYPTYkfBOWAarsaWzaq
|
|
18
|
+
|
|
19
|
+
TAVILY_API_KEY=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
|
|
20
|
+
|
|
21
|
+
DATABASE_URL=postgresql://postgres_fuli:jfd4whz%40GPF2nqx7zhm@pgm-uf615169n98t95tflo.pg.rds.aliyuncs.com:5432/postgres
|
|
22
|
+
# QUEUE_NAME=simon_tasks
|
|
23
|
+
# REDIS_URL=redis://localhost:6379
|
|
24
|
+
# REDIS_PASSWORD=fina
|
|
25
|
+
|
|
26
|
+
LANGSMITH_TRACING=true
|
|
27
|
+
LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
|
|
28
|
+
LANGSMITH_API_KEY="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"
|
|
29
|
+
LANGSMITH_PROJECT=deepsearch
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
> @axiom-lattice/agent-eval@2.1.9 build /home/runner/work/agentic/agentic/packages/agent-eval
|
|
3
|
+
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
|
+
|
|
5
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
6
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
+
[34mCLI[39m tsup v8.5.0
|
|
8
|
+
[34mCLI[39m Target: es2020
|
|
9
|
+
[34mCJS[39m Build start
|
|
10
|
+
[34mESM[39m Build start
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m39.11 KB[39m
|
|
12
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m67.54 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 186ms
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m36.92 KB[39m
|
|
15
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m67.28 KB[39m
|
|
16
|
+
[32mESM[39m ⚡️ Build success in 191ms
|
|
17
|
+
[34mDTS[39m Build start
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 8789ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m10.68 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m10.68 KB[39m
|
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
import { LLMConfig } from '@axiom-lattice/protocols';
|
|
2
|
+
|
|
3
|
+
interface LatticeAgentStepConfig {
|
|
4
|
+
agent_id: string;
|
|
5
|
+
override_input_message?: string;
|
|
6
|
+
}
|
|
7
|
+
type OutputFileContent = {
|
|
8
|
+
type: "file_content";
|
|
9
|
+
file_path: string;
|
|
10
|
+
};
|
|
11
|
+
type OutputMessageContent = {
|
|
12
|
+
type: "message_content";
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
type OutputType = OutputFileContent | OutputMessageContent;
|
|
16
|
+
interface LatticeEvalProjectType {
|
|
17
|
+
projectName: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
suites: LatticeEvalSuiteType[];
|
|
21
|
+
templates?: LatticeEvalTemplate[];
|
|
22
|
+
report_config?: LatticeEvalReportConfig;
|
|
23
|
+
judge_agent_config: {
|
|
24
|
+
model: LLMConfig;
|
|
25
|
+
};
|
|
26
|
+
lattice_server_config: {
|
|
27
|
+
base_url: string;
|
|
28
|
+
api_key: string;
|
|
29
|
+
};
|
|
30
|
+
concurrency?: number;
|
|
31
|
+
}
|
|
32
|
+
type LatticeEvalLogLevel = "debug" | "info" | "warn" | "error";
|
|
33
|
+
interface LatticeEvalLogEvent {
|
|
34
|
+
ts: string;
|
|
35
|
+
level: LatticeEvalLogLevel;
|
|
36
|
+
message: string;
|
|
37
|
+
data?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
interface LatticeEvalReportConfig {
|
|
40
|
+
/**
|
|
41
|
+
* Output directory for each batch run.
|
|
42
|
+
* A subfolder will be created per batch.
|
|
43
|
+
*/
|
|
44
|
+
output_dir: string;
|
|
45
|
+
/**
|
|
46
|
+
* Optional batch id. If not set, a timestamp-based id will be generated per run.
|
|
47
|
+
*/
|
|
48
|
+
batch_id?: string;
|
|
49
|
+
/**
|
|
50
|
+
* When true, writes `report.json` into the batch folder.
|
|
51
|
+
* Defaults to true.
|
|
52
|
+
*/
|
|
53
|
+
write_report_json?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* When true, writes per-case log files into the batch folder.
|
|
56
|
+
* Defaults to true.
|
|
57
|
+
*/
|
|
58
|
+
write_case_logs?: boolean;
|
|
59
|
+
}
|
|
60
|
+
interface LatticeEvalBatchReport {
|
|
61
|
+
batch_id: string;
|
|
62
|
+
started_at: string;
|
|
63
|
+
finished_at: string;
|
|
64
|
+
project: {
|
|
65
|
+
projectName: string;
|
|
66
|
+
version?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
};
|
|
69
|
+
summary: {
|
|
70
|
+
total_cases: number;
|
|
71
|
+
passed_cases: number;
|
|
72
|
+
failed_cases: number;
|
|
73
|
+
pass_rate: number;
|
|
74
|
+
};
|
|
75
|
+
suites: Array<{
|
|
76
|
+
suiteName: string;
|
|
77
|
+
total_cases: number;
|
|
78
|
+
passed_cases: number;
|
|
79
|
+
failed_cases: number;
|
|
80
|
+
cases: Array<{
|
|
81
|
+
caseId: string;
|
|
82
|
+
pass?: boolean;
|
|
83
|
+
final_score?: number;
|
|
84
|
+
error?: string;
|
|
85
|
+
}>;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
type LatticeEvalCaseType = LatticeEvalCase | LatticeEvalCaseWithTemplate;
|
|
89
|
+
interface LatticeEvalSuiteType {
|
|
90
|
+
suiteName: string;
|
|
91
|
+
version?: string;
|
|
92
|
+
cases: LatticeEvalCaseType[];
|
|
93
|
+
}
|
|
94
|
+
interface LatticeEvalRubric {
|
|
95
|
+
dimension: string;
|
|
96
|
+
weight: number;
|
|
97
|
+
description: string;
|
|
98
|
+
}
|
|
99
|
+
interface LatticeEvalCase {
|
|
100
|
+
caseId: string;
|
|
101
|
+
input: {
|
|
102
|
+
message: string;
|
|
103
|
+
files?: Record<string, string>;
|
|
104
|
+
};
|
|
105
|
+
steps: LatticeAgentStepConfig[];
|
|
106
|
+
output: OutputType;
|
|
107
|
+
eval: {
|
|
108
|
+
content_assertion: string;
|
|
109
|
+
eval_rubrics?: LatticeEvalRubric[];
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
interface LatticeEvalCaseWithTemplate {
|
|
113
|
+
caseId: string;
|
|
114
|
+
templateId: string;
|
|
115
|
+
input: {
|
|
116
|
+
message?: string;
|
|
117
|
+
files?: Record<string, string>;
|
|
118
|
+
variables?: Record<string, string>;
|
|
119
|
+
};
|
|
120
|
+
output?: OutputType;
|
|
121
|
+
eval: {
|
|
122
|
+
content_assertion: string;
|
|
123
|
+
eval_rubrics?: LatticeEvalRubric[];
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
interface LatticeEvalTemplate {
|
|
127
|
+
templateId: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
input_schema: {
|
|
130
|
+
required_files?: string[];
|
|
131
|
+
variables?: string[];
|
|
132
|
+
};
|
|
133
|
+
default_case: Omit<LatticeEvalCase, "caseId" | "eval"> & {
|
|
134
|
+
eval?: {
|
|
135
|
+
eval_rubrics?: LatticeEvalRubric[];
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
interface LatticeEvalResult {
|
|
140
|
+
pass: boolean;
|
|
141
|
+
final_score: number;
|
|
142
|
+
dimension_results: {
|
|
143
|
+
name: string;
|
|
144
|
+
score: number;
|
|
145
|
+
reason: string;
|
|
146
|
+
}[];
|
|
147
|
+
summary: string;
|
|
148
|
+
error?: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Configuration for Lattice evaluation server
|
|
153
|
+
*/
|
|
154
|
+
interface LatticeEvalConfig {
|
|
155
|
+
base_url: string;
|
|
156
|
+
api_key?: string;
|
|
157
|
+
/**
|
|
158
|
+
* When true, prints detailed execution logs for each action.
|
|
159
|
+
* Defaults to true.
|
|
160
|
+
*/
|
|
161
|
+
verbose?: boolean;
|
|
162
|
+
}
|
|
163
|
+
interface LatticeEvalCaseRunResult {
|
|
164
|
+
caseId: string;
|
|
165
|
+
result?: LatticeEvalResult;
|
|
166
|
+
error?: string;
|
|
167
|
+
error_stack?: string;
|
|
168
|
+
duration_ms: number;
|
|
169
|
+
thread_id?: string;
|
|
170
|
+
judge_thread_id?: string;
|
|
171
|
+
test_prompt?: string;
|
|
172
|
+
final_output?: string;
|
|
173
|
+
logs: LatticeEvalLogEvent[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* LatticeEval class for evaluating Lattice evaluation cases
|
|
177
|
+
*/
|
|
178
|
+
declare class LatticeEval {
|
|
179
|
+
private config;
|
|
180
|
+
private baseUrl;
|
|
181
|
+
private verbose;
|
|
182
|
+
private inMemoryLogs;
|
|
183
|
+
private lastThreadId?;
|
|
184
|
+
private lastJudgeThreadId?;
|
|
185
|
+
private lastTestPrompt?;
|
|
186
|
+
private lastFinalOutput?;
|
|
187
|
+
private lastDurationMs;
|
|
188
|
+
getLastRunMeta(): {
|
|
189
|
+
duration_ms: number;
|
|
190
|
+
thread_id: string | undefined;
|
|
191
|
+
judge_thread_id: string | undefined;
|
|
192
|
+
test_prompt: string | undefined;
|
|
193
|
+
final_output: string | undefined;
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Create a new LatticeEval instance
|
|
197
|
+
* @param config Optional server configuration (defaults to localhost:3203)
|
|
198
|
+
*/
|
|
199
|
+
constructor(config: LatticeEvalConfig);
|
|
200
|
+
getInMemoryLogs(): LatticeEvalLogEvent[];
|
|
201
|
+
record(level: LatticeEvalLogLevel, message: string, data?: Record<string, unknown>): void;
|
|
202
|
+
private log;
|
|
203
|
+
private getKeyInfo;
|
|
204
|
+
/**
|
|
205
|
+
* Execute a single agent step and return the thread ID and response data
|
|
206
|
+
*/
|
|
207
|
+
private executeAgentStep;
|
|
208
|
+
/**
|
|
209
|
+
* Extract output content based on OutputType
|
|
210
|
+
*/
|
|
211
|
+
private extractOutput;
|
|
212
|
+
/**
|
|
213
|
+
* Evaluate a single Lattice evaluation case
|
|
214
|
+
* @param evalCase The evaluation case to run
|
|
215
|
+
* @returns Evaluation result with pass/fail status and scores
|
|
216
|
+
*/
|
|
217
|
+
evaluateCase(evalCase: LatticeEvalCase): Promise<LatticeEvalResult>;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Evaluate a single Lattice evaluation case (backward compatibility function)
|
|
221
|
+
* @param evalCase The evaluation case to run
|
|
222
|
+
* @param config Optional server configuration (defaults to localhost:3203)
|
|
223
|
+
* @returns Evaluation result with pass/fail status and scores
|
|
224
|
+
* @deprecated Use LatticeEval class instead
|
|
225
|
+
*/
|
|
226
|
+
declare function evaluateLatticeCase(evalCase: LatticeEvalCase, config?: LatticeEvalConfig): Promise<LatticeEvalResult>;
|
|
227
|
+
/**
|
|
228
|
+
* Evaluate a single Lattice evaluation case and always return logs (never throws).
|
|
229
|
+
*/
|
|
230
|
+
declare function evaluateLatticeCaseWithLogs(evalCase: LatticeEvalCase, config?: LatticeEvalConfig): Promise<LatticeEvalCaseRunResult>;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Configuration resolved from project/suite hierarchy
|
|
234
|
+
*/
|
|
235
|
+
interface ResolvedConfig {
|
|
236
|
+
lattice_server_config: {
|
|
237
|
+
base_url: string;
|
|
238
|
+
api_key?: string;
|
|
239
|
+
};
|
|
240
|
+
judge_agent_config?: {
|
|
241
|
+
model: LLMConfig;
|
|
242
|
+
};
|
|
243
|
+
concurrency: number;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Result with error handling
|
|
247
|
+
*/
|
|
248
|
+
interface CaseRunResult {
|
|
249
|
+
caseId: string;
|
|
250
|
+
result?: LatticeEvalResult;
|
|
251
|
+
error?: string;
|
|
252
|
+
logs: LatticeEvalLogEvent[];
|
|
253
|
+
duration_ms?: number;
|
|
254
|
+
thread_id?: string;
|
|
255
|
+
judge_thread_id?: string;
|
|
256
|
+
test_prompt?: string;
|
|
257
|
+
final_output?: string;
|
|
258
|
+
error_stack?: string;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* LatticeEvalSuite class manages a suite of evaluation cases
|
|
262
|
+
* with suite-level configuration
|
|
263
|
+
*/
|
|
264
|
+
declare class LatticeEvalSuite {
|
|
265
|
+
private suite;
|
|
266
|
+
private projectConfig;
|
|
267
|
+
private templates;
|
|
268
|
+
constructor(suite: LatticeEvalSuiteType, projectConfig: ResolvedConfig, templates?: Map<string, LatticeEvalTemplate>);
|
|
269
|
+
/**
|
|
270
|
+
* Get resolved configuration from project
|
|
271
|
+
*/
|
|
272
|
+
private getResolvedConfig;
|
|
273
|
+
/**
|
|
274
|
+
* Get suite name
|
|
275
|
+
*/
|
|
276
|
+
getSuiteName(): string;
|
|
277
|
+
/**
|
|
278
|
+
* Get suite version
|
|
279
|
+
*/
|
|
280
|
+
getVersion(): string | undefined;
|
|
281
|
+
/**
|
|
282
|
+
* Get all cases in this suite (resolved from templates if needed)
|
|
283
|
+
*/
|
|
284
|
+
getCases(): LatticeEvalCase[];
|
|
285
|
+
/**
|
|
286
|
+
* Get a specific case by ID (resolved from template if needed)
|
|
287
|
+
*/
|
|
288
|
+
getCase(caseId: string): LatticeEvalCase | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* Run a single case in this suite with error handling
|
|
291
|
+
* @param caseId The case ID to run
|
|
292
|
+
* @returns Case run result with error handling
|
|
293
|
+
*/
|
|
294
|
+
runCase(caseId: string): Promise<CaseRunResult>;
|
|
295
|
+
/**
|
|
296
|
+
* Run all cases in this suite with concurrency control and error isolation
|
|
297
|
+
* @param concurrency Optional concurrency limit (overrides project config)
|
|
298
|
+
* @returns Array of case run results with error handling
|
|
299
|
+
*/
|
|
300
|
+
runAllCases(concurrency?: number): Promise<CaseRunResult[]>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* LatticeEvalProject class manages a project with multiple evaluation suites
|
|
305
|
+
* with project-level configuration
|
|
306
|
+
*/
|
|
307
|
+
declare class LatticeEvalProject {
|
|
308
|
+
private project;
|
|
309
|
+
private suites;
|
|
310
|
+
private reportConfig?;
|
|
311
|
+
constructor(project: LatticeEvalProjectType);
|
|
312
|
+
/**
|
|
313
|
+
* Get project name
|
|
314
|
+
*/
|
|
315
|
+
getProjectName(): string;
|
|
316
|
+
/**
|
|
317
|
+
* Get project version
|
|
318
|
+
*/
|
|
319
|
+
getVersion(): string | undefined;
|
|
320
|
+
/**
|
|
321
|
+
* Get project description
|
|
322
|
+
*/
|
|
323
|
+
getDescription(): string | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* Get all suite names
|
|
326
|
+
*/
|
|
327
|
+
getSuiteNames(): string[];
|
|
328
|
+
/**
|
|
329
|
+
* Get a specific suite by name
|
|
330
|
+
*/
|
|
331
|
+
getSuite(suiteName: string): LatticeEvalSuite | undefined;
|
|
332
|
+
/**
|
|
333
|
+
* Run a specific case in a specific suite
|
|
334
|
+
* @param suiteName The suite name
|
|
335
|
+
* @param caseId The case ID to run
|
|
336
|
+
* @returns Case run result with error handling
|
|
337
|
+
*/
|
|
338
|
+
runCase(suiteName: string, caseId: string): Promise<CaseRunResult>;
|
|
339
|
+
/**
|
|
340
|
+
* Run all cases in a specific suite with concurrency control and error isolation
|
|
341
|
+
* @param suiteName The suite name
|
|
342
|
+
* @param concurrency Optional concurrency limit (overrides project config)
|
|
343
|
+
* @returns Array of case run results with error handling
|
|
344
|
+
*/
|
|
345
|
+
runSuite(suiteName: string, concurrency?: number): Promise<CaseRunResult[]>;
|
|
346
|
+
/**
|
|
347
|
+
* Run all cases in all suites with concurrency control and error isolation
|
|
348
|
+
* @param concurrency Optional concurrency limit (overrides project config)
|
|
349
|
+
* @returns Map of suite names to their case run results
|
|
350
|
+
*/
|
|
351
|
+
runAllSuites(concurrency?: number): Promise<Map<string, CaseRunResult[]>>;
|
|
352
|
+
/**
|
|
353
|
+
* Run all suites as a "batch", build a report, and optionally write it to disk.
|
|
354
|
+
*/
|
|
355
|
+
runAllSuitesBatch(concurrency?: number): Promise<{
|
|
356
|
+
batch_id: string;
|
|
357
|
+
batch_dir?: string;
|
|
358
|
+
results: Map<string, CaseRunResult[]>;
|
|
359
|
+
report: LatticeEvalBatchReport;
|
|
360
|
+
}>;
|
|
361
|
+
private generateCaseMarkdown;
|
|
362
|
+
private generateMarkdownSummary;
|
|
363
|
+
private maybeWriteBatchArtifacts;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export { type CaseRunResult, type LatticeAgentStepConfig, LatticeEval, type LatticeEvalBatchReport, type LatticeEvalCase, type LatticeEvalCaseRunResult, type LatticeEvalCaseType, type LatticeEvalCaseWithTemplate, type LatticeEvalConfig, type LatticeEvalLogEvent, type LatticeEvalLogLevel, LatticeEvalProject, type LatticeEvalProjectType, type LatticeEvalReportConfig, type LatticeEvalResult, type LatticeEvalRubric, LatticeEvalSuite, type LatticeEvalSuiteType, type LatticeEvalTemplate, type OutputFileContent, type OutputMessageContent, type OutputType, type ResolvedConfig, evaluateLatticeCase, evaluateLatticeCaseWithLogs };
|