@langwatch/mcp-server 0.8.0 → 0.10.0
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/CHANGELOG.md +40 -0
- package/LICENSE +7 -0
- package/dist/archive-project-HZBRPR2S.js +19 -0
- package/dist/{archive-scenario-YKGLJ4MZ.js → archive-scenario-P5RRITRM.js} +3 -3
- package/dist/{archive-suite-QFNDO3Y3.js → archive-suite-NUUFD2EM.js} +3 -3
- package/dist/{assign-prompt-tag-Y2B4CBBT.js → assign-prompt-tag-FKCCZPML.js} +2 -2
- package/dist/{chunk-YH2IBTEL.js → chunk-42ZHHHIJ.js} +14 -3
- package/dist/chunk-ADSJ2FDA.js +44 -0
- package/dist/{chunk-L6QENXYA.js → chunk-BB7EOKHR.js} +2 -2
- package/dist/chunk-BBJ5WAJB.js +24 -0
- package/dist/{chunk-PZUWCWOS.js → chunk-BYWYM2RP.js} +2 -2
- package/dist/{chunk-NACSR6B7.js → chunk-CCM4ZFGF.js} +2 -2
- package/dist/{chunk-FBRKHHJV.js → chunk-CHKCEZBP.js} +2 -2
- package/dist/{chunk-B57MZ4WI.js → chunk-FVDAZ4XG.js} +763 -90
- package/dist/{chunk-PO7FM7IX.js → chunk-HKY3GW45.js} +2 -2
- package/dist/{chunk-KZNBCKWG.js → chunk-JHOSVOHT.js} +2 -2
- package/dist/{chunk-HDJDFKZR.js → chunk-R7C7OUVG.js} +2 -2
- package/dist/{chunk-OVQF3D5R.js → chunk-TROIWSEQ.js} +2 -2
- package/dist/{chunk-CPUPGDNA.js → chunk-X2SEURT2.js} +2 -2
- package/dist/{chunk-YI3OG4PI.js → chunk-XC62KJIT.js} +3 -3
- package/dist/{create-agent-YRSDH7P7.js → create-agent-K5Q7BFGZ.js} +3 -3
- package/dist/{create-annotation-FYQNKMVJ.js → create-annotation-KN3GE3DK.js} +3 -3
- package/dist/create-api-key-OQI5PUNQ.js +26 -0
- package/dist/{create-dashboard-CORBR4YQ.js → create-dashboard-G4QA5AXP.js} +3 -3
- package/dist/{create-dataset-ZC63T6BB.js → create-dataset-WQSC37N7.js} +3 -3
- package/dist/{create-dataset-records-ILVNVKVR.js → create-dataset-records-B4RL3FLC.js} +3 -3
- package/dist/{create-evaluator-2AU3PXFB.js → create-evaluator-YFFQIR7E.js} +3 -3
- package/dist/create-mcp-server.d.ts +3 -1
- package/dist/create-mcp-server.js +2 -1
- package/dist/create-project-CUVQ67VN.js +44 -0
- package/dist/{create-prompt-NKRJ47YY.js → create-prompt-NGXKSP4X.js} +2 -2
- package/dist/{create-prompt-tag-S4JX3ULL.js → create-prompt-tag-IUKYPVHH.js} +2 -2
- package/dist/{create-scenario-BPRF75KF.js → create-scenario-FNBXALH3.js} +3 -3
- package/dist/{create-suite-4YN7D6K2.js → create-suite-DJEPD4ZB.js} +3 -3
- package/dist/{delete-agent-Y72R2YQA.js → delete-agent-TJI5XBBM.js} +3 -3
- package/dist/{delete-annotation-UHWDMHSH.js → delete-annotation-KRP53TUU.js} +3 -3
- package/dist/{delete-dashboard-LPWT36KN.js → delete-dashboard-N5SZJIR3.js} +3 -3
- package/dist/{delete-dataset-GGPQRHKX.js → delete-dataset-KDUOHL2P.js} +3 -3
- package/dist/{delete-dataset-records-LTG5LT26.js → delete-dataset-records-DM4W3PAW.js} +3 -3
- package/dist/{delete-evaluator-F7QLXDHU.js → delete-evaluator-7ZATLJOA.js} +3 -3
- package/dist/{delete-prompt-tag-B5UKZL45.js → delete-prompt-tag-I6HNMSVJ.js} +2 -2
- package/dist/{delete-workflow-4DGUDIDE.js → delete-workflow-QEO74JQR.js} +3 -3
- package/dist/{get-agent-YEVICUX4.js → get-agent-3KDWCP5N.js} +3 -3
- package/dist/{get-analytics-3W5CMU3F.js → get-analytics-GPVJX7SF.js} +2 -2
- package/dist/{get-dashboard-NCQHN6MW.js → get-dashboard-YPTIE5YY.js} +3 -3
- package/dist/{get-dataset-KBK6PH36.js → get-dataset-6DQFYITM.js} +3 -3
- package/dist/{get-evaluator-QDUL5LXR.js → get-evaluator-PCM6XQAU.js} +3 -3
- package/dist/get-project-JCMWXVLU.js +26 -0
- package/dist/{get-prompt-XCSSNRKR.js → get-prompt-5XAGWWBG.js} +2 -2
- package/dist/{get-scenario-FNRKOY7E.js → get-scenario-7XBCDZWX.js} +3 -3
- package/dist/{get-simulation-run-WOEKUF7K.js → get-simulation-run-AV24FJWI.js} +3 -3
- package/dist/{get-suite-U5AOD5TC.js → get-suite-4DBVHFEM.js} +3 -3
- package/dist/{get-trace-MUWEJM2Z.js → get-trace-MRBDS3HJ.js} +2 -2
- package/dist/{get-workflow-SOA7MT7L.js → get-workflow-UR4Y6UFX.js} +3 -3
- package/dist/{http-server-7DMOCB75.js → http-server-XUQLIFE7.js} +5 -3
- package/dist/index.js +1175 -222
- package/dist/{langwatch-api-annotations-Q57NDUVR.js → langwatch-api-annotations-ZJDRB4JH.js} +3 -3
- package/dist/{langwatch-api-dashboards-VBWWXV3Y.js → langwatch-api-dashboards-WARLI6NF.js} +3 -3
- package/dist/{langwatch-api-monitors-L3IY7FDT.js → langwatch-api-monitors-4XKXHYCG.js} +2 -2
- package/dist/{langwatch-api-secrets-S5HHF3XR.js → langwatch-api-secrets-6SHK5G7Q.js} +2 -2
- package/dist/{langwatch-api-triggers-ME33QE26.js → langwatch-api-triggers-5SX6R2WU.js} +2 -2
- package/dist/{langwatch-api-workflows-4CJQAYP2.js → langwatch-api-workflows-NLJENNXE.js} +3 -3
- package/dist/{list-agents-3HGIBJFM.js → list-agents-NECO7MPI.js} +3 -3
- package/dist/{list-annotations-KWXYVEPI.js → list-annotations-3OJEO774.js} +3 -3
- package/dist/list-api-keys-AWW7ROLB.js +37 -0
- package/dist/{list-dashboards-VQ2LH666.js → list-dashboards-DVPVVVKW.js} +3 -3
- package/dist/{list-dataset-records-RNRGROJP.js → list-dataset-records-I4BYORF5.js} +3 -3
- package/dist/{list-datasets-I4A2LT2S.js → list-datasets-WUAE5HGX.js} +3 -3
- package/dist/{list-evaluators-AKKRJ5MX.js → list-evaluators-B6OSVAM2.js} +3 -3
- package/dist/{list-model-providers-DVFEHFHZ.js → list-model-providers-NL6IP4UZ.js} +3 -3
- package/dist/list-projects-5FHMJ4PQ.js +42 -0
- package/dist/{list-prompt-tags-PL5OISUA.js → list-prompt-tags-Z2DD6FLQ.js} +2 -2
- package/dist/{list-prompts-7VTFWE2Z.js → list-prompts-VNXKHK7T.js} +2 -2
- package/dist/{list-scenarios-5BZWZ6ZN.js → list-scenarios-CFZHXL76.js} +3 -3
- package/dist/{list-simulation-runs-WCZ6RLPE.js → list-simulation-runs-AM2BXLBW.js} +3 -3
- package/dist/{list-suites-RRQ2JX5Y.js → list-suites-ZDOHAAXF.js} +3 -3
- package/dist/{list-workflows-UQB5FCX5.js → list-workflows-WBRBKLIT.js} +3 -3
- package/dist/{rename-prompt-tag-TURD6KYU.js → rename-prompt-tag-A4RJUK7Z.js} +2 -2
- package/dist/revoke-api-key-ZSPSPF5G.js +15 -0
- package/dist/{run-agent-BEJ4K4CM.js → run-agent-JFNDY7MR.js} +3 -3
- package/dist/{run-suite-U7V432G2.js → run-suite-TH7LO5TJ.js} +3 -3
- package/dist/{run-workflow-5WX7DK5T.js → run-workflow-CK3JP5U2.js} +3 -3
- package/dist/{search-traces-ZCHNOMTX.js → search-traces-3BBVYPC3.js} +2 -2
- package/dist/{set-model-provider-6CFHMCNE.js → set-model-provider-WOC5FNMV.js} +3 -3
- package/dist/{update-agent-UE6UWLZP.js → update-agent-YMEV5MTL.js} +3 -3
- package/dist/{update-dataset-4XQZZE4S.js → update-dataset-EYT5POFM.js} +3 -3
- package/dist/{update-dataset-record-GNNM5TKM.js → update-dataset-record-VFF5JTX4.js} +3 -3
- package/dist/{update-evaluator-LHVDXIZD.js → update-evaluator-6IJHFG2E.js} +3 -3
- package/dist/update-project-OIT4WPFI.js +24 -0
- package/dist/{update-prompt-3XEHECJ7.js → update-prompt-ZU2DD6KM.js} +2 -2
- package/dist/{update-scenario-DFPREYCD.js → update-scenario-3VUTPDRU.js} +3 -3
- package/dist/{update-suite-RATU5THO.js → update-suite-C6JFDQHL.js} +3 -3
- package/package.json +2 -2
- package/pnpm-workspace.yaml +7 -0
- package/pyproject.toml +3 -0
- package/src/__tests__/experiment-list-tools.unit.test.ts +157 -0
- package/src/__tests__/experiment-status.unit.test.ts +194 -0
- package/src/__tests__/get-experiment-results.unit.test.ts +313 -0
- package/src/__tests__/project-api-key-tools.unit.test.ts +451 -0
- package/src/create-mcp-server.d.ts +3 -1
- package/src/create-mcp-server.ts +263 -13
- package/src/http-server.ts +5 -0
- package/src/langwatch-api-api-keys.ts +54 -0
- package/src/langwatch-api-projects.ts +82 -0
- package/src/langwatch-api.ts +17 -3
- package/src/tools/archive-project.ts +14 -0
- package/src/tools/create-api-key.ts +29 -0
- package/src/tools/create-project.ts +45 -0
- package/src/tools/experiment-run-status.ts +36 -0
- package/src/tools/get-experiment-results.ts +306 -0
- package/src/tools/get-project.ts +20 -0
- package/src/tools/list-api-keys.ts +33 -0
- package/src/tools/list-experiment-runs.ts +142 -0
- package/src/tools/list-experiments.ts +95 -0
- package/src/tools/list-projects.ts +41 -0
- package/src/tools/revoke-api-key.ts +9 -0
- package/src/tools/run-experiment.ts +182 -0
- package/src/tools/update-project.ts +22 -0
- package/uv.lock +7 -3
- package/dist/run-evaluation-AJ7WZNQD.js +0 -64
- package/src/tools/run-evaluation.ts +0 -87
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { LangWatchApiError, makeRequest } from "../langwatch-api.js";
|
|
2
|
+
import { deriveRunStatus } from "./experiment-run-status.js";
|
|
3
|
+
|
|
4
|
+
interface EvaluationRunResponse {
|
|
5
|
+
runId: string;
|
|
6
|
+
status: string;
|
|
7
|
+
total: number;
|
|
8
|
+
runUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface EvaluationStatusResponse {
|
|
12
|
+
runId: string;
|
|
13
|
+
status: string;
|
|
14
|
+
progress: number;
|
|
15
|
+
total: number;
|
|
16
|
+
startedAt?: number;
|
|
17
|
+
finishedAt?: number;
|
|
18
|
+
summary?: {
|
|
19
|
+
totalCells?: number;
|
|
20
|
+
completedCells?: number;
|
|
21
|
+
failedCells?: number;
|
|
22
|
+
duration?: number;
|
|
23
|
+
runUrl?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function handleRunExperiment(params: {
|
|
28
|
+
slug: string;
|
|
29
|
+
}): Promise<string> {
|
|
30
|
+
const result = (await makeRequest(
|
|
31
|
+
"POST",
|
|
32
|
+
`/api/experiments/${encodeURIComponent(params.slug)}/run`,
|
|
33
|
+
)) as EvaluationRunResponse;
|
|
34
|
+
|
|
35
|
+
const lines: string[] = [];
|
|
36
|
+
lines.push(`Evaluation started!\n`);
|
|
37
|
+
lines.push(`**Run ID**: ${result.runId}`);
|
|
38
|
+
lines.push(`**Status**: ${result.status}`);
|
|
39
|
+
lines.push(`**Total cells**: ${result.total}`);
|
|
40
|
+
if (result.runUrl) lines.push(`**View at**: ${result.runUrl}`);
|
|
41
|
+
lines.push("");
|
|
42
|
+
lines.push(
|
|
43
|
+
`> Use \`platform_experiment_status\` with run ID "${result.runId}" to check progress.`,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return lines.join("\n");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface ResultsForStatus {
|
|
50
|
+
progress?: number | null;
|
|
51
|
+
total?: number | null;
|
|
52
|
+
dataset?: unknown[];
|
|
53
|
+
timestamps: {
|
|
54
|
+
createdAt?: number | null;
|
|
55
|
+
updatedAt?: number | null;
|
|
56
|
+
finishedAt?: number | null;
|
|
57
|
+
stoppedAt?: number | null;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// SDK-logged runs (langwatch.experiment + evaluation.log) never populate the
|
|
62
|
+
// Redis run-state that GET /runs/:runId reads, so that endpoint 404s for them.
|
|
63
|
+
// Their data lives only in ClickHouse, reachable through the results endpoint,
|
|
64
|
+
// so we derive the status from there as a fallback. experimentSlug is required
|
|
65
|
+
// because runId is not unique across experiments once the Redis state expires.
|
|
66
|
+
async function statusFromResults(params: {
|
|
67
|
+
runId: string;
|
|
68
|
+
experimentSlug?: string;
|
|
69
|
+
}): Promise<string | null> {
|
|
70
|
+
const search = new URLSearchParams();
|
|
71
|
+
if (params.experimentSlug) search.set("experimentSlug", params.experimentSlug);
|
|
72
|
+
const qs = search.toString() ? `?${search.toString()}` : "";
|
|
73
|
+
|
|
74
|
+
let results: ResultsForStatus;
|
|
75
|
+
try {
|
|
76
|
+
results = (await makeRequest(
|
|
77
|
+
"GET",
|
|
78
|
+
`/api/experiments/runs/${encodeURIComponent(params.runId)}/results${qs}`,
|
|
79
|
+
)) as ResultsForStatus;
|
|
80
|
+
} catch (error) {
|
|
81
|
+
// Only a genuine "no such run" is a fallback miss (-> guidance). Real
|
|
82
|
+
// 5xx / auth / network errors must propagate, not be masked as not-found.
|
|
83
|
+
const code = error instanceof LangWatchApiError ? error.status : undefined;
|
|
84
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
85
|
+
if (code === 404 || (code === undefined && /404|not found/i.test(message))) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const status = deriveRunStatus(results.timestamps);
|
|
92
|
+
const total = results.total ?? results.dataset?.length ?? 0;
|
|
93
|
+
const progress = results.progress ?? results.dataset?.length ?? 0;
|
|
94
|
+
|
|
95
|
+
const lines: string[] = [];
|
|
96
|
+
lines.push(`# Evaluation Run ${params.runId}\n`);
|
|
97
|
+
lines.push(`**Status**: ${status}`);
|
|
98
|
+
lines.push(`**Progress**: ${progress}/${total} cells`);
|
|
99
|
+
if (results.timestamps.createdAt) {
|
|
100
|
+
lines.push(
|
|
101
|
+
`**Started**: ${new Date(results.timestamps.createdAt).toISOString()}`,
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
if (results.timestamps.finishedAt) {
|
|
105
|
+
lines.push(
|
|
106
|
+
`**Finished**: ${new Date(results.timestamps.finishedAt).toISOString()}`,
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
if (results.timestamps.stoppedAt) {
|
|
110
|
+
lines.push(
|
|
111
|
+
`**Stopped**: ${new Date(results.timestamps.stoppedAt).toISOString()}`,
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
lines.push("");
|
|
115
|
+
lines.push(
|
|
116
|
+
"> Use `platform_experiment_results` to fetch the per-row scores (partial results are available even while running).",
|
|
117
|
+
);
|
|
118
|
+
return lines.join("\n");
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export async function handleExperimentStatus(params: {
|
|
122
|
+
runId: string;
|
|
123
|
+
experimentSlug?: string;
|
|
124
|
+
}): Promise<string> {
|
|
125
|
+
let status: EvaluationStatusResponse;
|
|
126
|
+
try {
|
|
127
|
+
status = (await makeRequest(
|
|
128
|
+
"GET",
|
|
129
|
+
`/api/experiments/runs/${encodeURIComponent(params.runId)}`,
|
|
130
|
+
)) as EvaluationStatusResponse;
|
|
131
|
+
} catch (error) {
|
|
132
|
+
const code =
|
|
133
|
+
error instanceof LangWatchApiError ? error.status : undefined;
|
|
134
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
135
|
+
if (code === 404 || /404|not found/i.test(message)) {
|
|
136
|
+
const fallback = await statusFromResults(params);
|
|
137
|
+
if (fallback) return fallback;
|
|
138
|
+
return [
|
|
139
|
+
`# Evaluation Run ${params.runId}`,
|
|
140
|
+
"",
|
|
141
|
+
"**Status**: not found",
|
|
142
|
+
"",
|
|
143
|
+
`Could not find run \`${params.runId}\`. SDK-logged runs and runs older than 24h are not in the live run-state and must be resolved by experiment slug.`,
|
|
144
|
+
"",
|
|
145
|
+
"> Pass `experimentSlug`: discover it with `platform_experiment_list`, then use `platform_experiment_list_runs` for the run ids. Or fetch the rows directly with `platform_experiment_results`.",
|
|
146
|
+
].join("\n");
|
|
147
|
+
}
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const lines: string[] = [];
|
|
152
|
+
lines.push(`# Evaluation Run ${status.runId}\n`);
|
|
153
|
+
lines.push(`**Status**: ${status.status}`);
|
|
154
|
+
lines.push(`**Progress**: ${status.progress}/${status.total} cells`);
|
|
155
|
+
|
|
156
|
+
if (status.startedAt) {
|
|
157
|
+
lines.push(`**Started**: ${new Date(status.startedAt).toISOString()}`);
|
|
158
|
+
}
|
|
159
|
+
if (status.finishedAt) {
|
|
160
|
+
lines.push(`**Finished**: ${new Date(status.finishedAt).toISOString()}`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (status.summary) {
|
|
164
|
+
lines.push("\n## Summary\n");
|
|
165
|
+
if (status.summary.completedCells !== undefined) {
|
|
166
|
+
lines.push(`**Completed**: ${status.summary.completedCells}`);
|
|
167
|
+
}
|
|
168
|
+
if (status.summary.failedCells) {
|
|
169
|
+
lines.push(`**Failed**: ${status.summary.failedCells}`);
|
|
170
|
+
}
|
|
171
|
+
if (status.summary.duration) {
|
|
172
|
+
lines.push(
|
|
173
|
+
`**Duration**: ${(status.summary.duration / 1000).toFixed(1)}s`,
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
if (status.summary.runUrl) {
|
|
177
|
+
lines.push(`**View results**: ${status.summary.runUrl}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return lines.join("\n");
|
|
182
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { updateProject as apiUpdateProject } from "../langwatch-api-projects.js";
|
|
2
|
+
|
|
3
|
+
export async function handleUpdateProject(params: {
|
|
4
|
+
id: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
framework?: string;
|
|
8
|
+
piiRedactionLevel?: "STRICT" | "ESSENTIAL" | "DISABLED";
|
|
9
|
+
}): Promise<string> {
|
|
10
|
+
const project = await apiUpdateProject(params);
|
|
11
|
+
|
|
12
|
+
const lines: string[] = [];
|
|
13
|
+
lines.push(`Project updated successfully!\n`);
|
|
14
|
+
lines.push(`**Name**: ${project.name}`);
|
|
15
|
+
lines.push(`**ID**: ${project.id}`);
|
|
16
|
+
lines.push(`**Slug**: ${project.slug}`);
|
|
17
|
+
lines.push(`**Language**: ${project.language}`);
|
|
18
|
+
lines.push(`**Framework**: ${project.framework}`);
|
|
19
|
+
lines.push(`**PII Redaction**: ${project.piiRedactionLevel}`);
|
|
20
|
+
|
|
21
|
+
return lines.join("\n");
|
|
22
|
+
}
|
package/uv.lock
CHANGED
|
@@ -6,6 +6,10 @@ resolution-markers = [
|
|
|
6
6
|
"python_full_version < '3.12'",
|
|
7
7
|
]
|
|
8
8
|
|
|
9
|
+
[options]
|
|
10
|
+
exclude-newer = "2026-05-10T06:01:42.280437Z"
|
|
11
|
+
exclude-newer-span = "P7D"
|
|
12
|
+
|
|
9
13
|
[[package]]
|
|
10
14
|
name = "aiohappyeyeballs"
|
|
11
15
|
version = "2.6.1"
|
|
@@ -985,7 +989,7 @@ examples = [
|
|
|
985
989
|
{ name = "langchain-openai", specifier = ">=0.3.0,<1.0.0" },
|
|
986
990
|
{ name = "langchain-text-splitters", specifier = ">=0.3.0,<1.0.0" },
|
|
987
991
|
{ name = "langgraph", specifier = ">=1.0.0,<2.0.0" },
|
|
988
|
-
{ name = "langsmith", specifier = ">=0.
|
|
992
|
+
{ name = "langsmith", specifier = ">=0.8.0" },
|
|
989
993
|
{ name = "litellm", specifier = ">=1.52.1" },
|
|
990
994
|
{ name = "nltk", specifier = ">=3.9.4" },
|
|
991
995
|
{ name = "openai", specifier = ">=1.68.2,<2.8.0" },
|
|
@@ -998,7 +1002,7 @@ examples = [
|
|
|
998
1002
|
{ name = "pydantic", specifier = ">=2.11.0" },
|
|
999
1003
|
{ name = "pypdf", specifier = ">=6.8.0" },
|
|
1000
1004
|
{ name = "pytest", specifier = ">=7.4.2,<8.0.0" },
|
|
1001
|
-
{ name = "python-dotenv", specifier = "==1.2.
|
|
1005
|
+
{ name = "python-dotenv", specifier = "==1.2.2" },
|
|
1002
1006
|
{ name = "strands-agents", extras = ["otel"], specifier = ">=1.14.0,<2.0.0" },
|
|
1003
1007
|
{ name = "streamlit", specifier = ">=1.37.1,<2.0.0" },
|
|
1004
1008
|
{ name = "unstructured", extras = ["pdf"], specifier = ">=0.18.18" },
|
|
@@ -1007,7 +1011,7 @@ examples = [
|
|
|
1007
1011
|
tests = [
|
|
1008
1012
|
{ name = "factory-boy", specifier = ">=3.3.3" },
|
|
1009
1013
|
{ name = "pytest-asyncio", specifier = ">=0.21.2" },
|
|
1010
|
-
{ name = "python-dotenv", specifier = "==1.2.
|
|
1014
|
+
{ name = "python-dotenv", specifier = "==1.2.2" },
|
|
1011
1015
|
]
|
|
1012
1016
|
|
|
1013
1017
|
[[package]]
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
makeRequest
|
|
3
|
-
} from "./chunk-YH2IBTEL.js";
|
|
4
|
-
import "./chunk-KOO5733S.js";
|
|
5
|
-
|
|
6
|
-
// src/tools/run-evaluation.ts
|
|
7
|
-
async function handleRunEvaluation(params) {
|
|
8
|
-
const result = await makeRequest(
|
|
9
|
-
"POST",
|
|
10
|
-
`/api/evaluations/v3/${encodeURIComponent(params.slug)}/run`
|
|
11
|
-
);
|
|
12
|
-
const lines = [];
|
|
13
|
-
lines.push(`Evaluation started!
|
|
14
|
-
`);
|
|
15
|
-
lines.push(`**Run ID**: ${result.runId}`);
|
|
16
|
-
lines.push(`**Status**: ${result.status}`);
|
|
17
|
-
lines.push(`**Total cells**: ${result.total}`);
|
|
18
|
-
if (result.runUrl) lines.push(`**View at**: ${result.runUrl}`);
|
|
19
|
-
lines.push("");
|
|
20
|
-
lines.push(
|
|
21
|
-
`> Use \`platform_evaluation_status\` with run ID "${result.runId}" to check progress.`
|
|
22
|
-
);
|
|
23
|
-
return lines.join("\n");
|
|
24
|
-
}
|
|
25
|
-
async function handleEvaluationStatus(params) {
|
|
26
|
-
const status = await makeRequest(
|
|
27
|
-
"GET",
|
|
28
|
-
`/api/evaluations/v3/runs/${encodeURIComponent(params.runId)}`
|
|
29
|
-
);
|
|
30
|
-
const lines = [];
|
|
31
|
-
lines.push(`# Evaluation Run ${status.runId}
|
|
32
|
-
`);
|
|
33
|
-
lines.push(`**Status**: ${status.status}`);
|
|
34
|
-
lines.push(`**Progress**: ${status.progress}/${status.total} cells`);
|
|
35
|
-
if (status.startedAt) {
|
|
36
|
-
lines.push(`**Started**: ${new Date(status.startedAt).toISOString()}`);
|
|
37
|
-
}
|
|
38
|
-
if (status.finishedAt) {
|
|
39
|
-
lines.push(`**Finished**: ${new Date(status.finishedAt).toISOString()}`);
|
|
40
|
-
}
|
|
41
|
-
if (status.summary) {
|
|
42
|
-
lines.push("\n## Summary\n");
|
|
43
|
-
if (status.summary.completedCells !== void 0) {
|
|
44
|
-
lines.push(`**Completed**: ${status.summary.completedCells}`);
|
|
45
|
-
}
|
|
46
|
-
if (status.summary.failedCells) {
|
|
47
|
-
lines.push(`**Failed**: ${status.summary.failedCells}`);
|
|
48
|
-
}
|
|
49
|
-
if (status.summary.duration) {
|
|
50
|
-
lines.push(
|
|
51
|
-
`**Duration**: ${(status.summary.duration / 1e3).toFixed(1)}s`
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
if (status.summary.runUrl) {
|
|
55
|
-
lines.push(`**View results**: ${status.summary.runUrl}`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return lines.join("\n");
|
|
59
|
-
}
|
|
60
|
-
export {
|
|
61
|
-
handleEvaluationStatus,
|
|
62
|
-
handleRunEvaluation
|
|
63
|
-
};
|
|
64
|
-
//# sourceMappingURL=run-evaluation-AJ7WZNQD.js.map
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { makeRequest } from "../langwatch-api.js";
|
|
2
|
-
|
|
3
|
-
interface EvaluationRunResponse {
|
|
4
|
-
runId: string;
|
|
5
|
-
status: string;
|
|
6
|
-
total: number;
|
|
7
|
-
runUrl?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface EvaluationStatusResponse {
|
|
11
|
-
runId: string;
|
|
12
|
-
status: string;
|
|
13
|
-
progress: number;
|
|
14
|
-
total: number;
|
|
15
|
-
startedAt?: number;
|
|
16
|
-
finishedAt?: number;
|
|
17
|
-
summary?: {
|
|
18
|
-
totalCells?: number;
|
|
19
|
-
completedCells?: number;
|
|
20
|
-
failedCells?: number;
|
|
21
|
-
duration?: number;
|
|
22
|
-
runUrl?: string;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export async function handleRunEvaluation(params: {
|
|
27
|
-
slug: string;
|
|
28
|
-
}): Promise<string> {
|
|
29
|
-
const result = (await makeRequest(
|
|
30
|
-
"POST",
|
|
31
|
-
`/api/evaluations/v3/${encodeURIComponent(params.slug)}/run`,
|
|
32
|
-
)) as EvaluationRunResponse;
|
|
33
|
-
|
|
34
|
-
const lines: string[] = [];
|
|
35
|
-
lines.push(`Evaluation started!\n`);
|
|
36
|
-
lines.push(`**Run ID**: ${result.runId}`);
|
|
37
|
-
lines.push(`**Status**: ${result.status}`);
|
|
38
|
-
lines.push(`**Total cells**: ${result.total}`);
|
|
39
|
-
if (result.runUrl) lines.push(`**View at**: ${result.runUrl}`);
|
|
40
|
-
lines.push("");
|
|
41
|
-
lines.push(
|
|
42
|
-
`> Use \`platform_evaluation_status\` with run ID "${result.runId}" to check progress.`,
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
return lines.join("\n");
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export async function handleEvaluationStatus(params: {
|
|
49
|
-
runId: string;
|
|
50
|
-
}): Promise<string> {
|
|
51
|
-
const status = (await makeRequest(
|
|
52
|
-
"GET",
|
|
53
|
-
`/api/evaluations/v3/runs/${encodeURIComponent(params.runId)}`,
|
|
54
|
-
)) as EvaluationStatusResponse;
|
|
55
|
-
|
|
56
|
-
const lines: string[] = [];
|
|
57
|
-
lines.push(`# Evaluation Run ${status.runId}\n`);
|
|
58
|
-
lines.push(`**Status**: ${status.status}`);
|
|
59
|
-
lines.push(`**Progress**: ${status.progress}/${status.total} cells`);
|
|
60
|
-
|
|
61
|
-
if (status.startedAt) {
|
|
62
|
-
lines.push(`**Started**: ${new Date(status.startedAt).toISOString()}`);
|
|
63
|
-
}
|
|
64
|
-
if (status.finishedAt) {
|
|
65
|
-
lines.push(`**Finished**: ${new Date(status.finishedAt).toISOString()}`);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (status.summary) {
|
|
69
|
-
lines.push("\n## Summary\n");
|
|
70
|
-
if (status.summary.completedCells !== undefined) {
|
|
71
|
-
lines.push(`**Completed**: ${status.summary.completedCells}`);
|
|
72
|
-
}
|
|
73
|
-
if (status.summary.failedCells) {
|
|
74
|
-
lines.push(`**Failed**: ${status.summary.failedCells}`);
|
|
75
|
-
}
|
|
76
|
-
if (status.summary.duration) {
|
|
77
|
-
lines.push(
|
|
78
|
-
`**Duration**: ${(status.summary.duration / 1000).toFixed(1)}s`,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
if (status.summary.runUrl) {
|
|
82
|
-
lines.push(`**View results**: ${status.summary.runUrl}`);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return lines.join("\n");
|
|
87
|
-
}
|