@tool-bridge/server 0.21.1 → 0.23.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/dist/admin.js +170 -0
- package/dist/airtable-VMQVXLHK.js +790 -0
- package/dist/{alt_text_generator_ai-W7O34SNG.js → alt_text_generator_ai-FTWY4RU4.js} +12 -11
- package/dist/{amap-VOX4T2AW.js → amap-OK5VBHYC.js} +221 -220
- package/dist/anthropic-S67AZFZ3.js +203 -0
- package/dist/apify-ZE6MYQI3.js +248 -0
- package/dist/brave_search-TG2M2KOD.js +302 -0
- package/dist/chunk-2JNAI4OC.js +161 -0
- package/dist/{chunk-KMTT3I6D.js → chunk-4XJPN3DY.js} +19392 -26136
- package/dist/chunk-5ICRY3VU.js +8432 -0
- package/dist/chunk-7CTWGTDU.js +302 -0
- package/dist/chunk-BADVCN6K.js +378 -0
- package/dist/{chunk-XYBU3WZH.js → chunk-TDAWLMDE.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/{chunk-E6JCVKW6.js → chunk-VWRUGUSU.js} +3 -3
- package/dist/{chunk-ATK45BXV.js → chunk-WJHG6OK7.js} +4 -2
- package/dist/circleci-3L3WJVSK.js +389 -0
- package/dist/clerk-EZPF2V7T.js +1019 -0
- package/dist/cohere-U27DPO64.js +185 -0
- package/dist/{confluence-B3EWPZVE.js → confluence-G2KL6ERH.js} +105 -104
- package/dist/{convertapi-EUWSQYPF.js → convertapi-L4CLJ2M3.js} +32 -31
- package/dist/{currencyapi-KVTIK3GL.js → currencyapi-YPYXG7YY.js} +71 -71
- package/dist/deepseek-6HT6WF3M.js +210 -0
- package/dist/docker_hub-LPE3PCVB.js +933 -0
- package/dist/dropbox-V56ABHTA.js +1305 -0
- package/dist/dub-6OKQ7MHT.js +680 -0
- package/dist/e2b-JS2U2QFU.js +278 -0
- package/dist/exa-DPWVYXSP.js +332 -0
- package/dist/{fal_ai-23E7JPNT.js → fal_ai-DK6Y27ZF.js} +81 -80
- package/dist/{feishu-7QRIDUV6.js → feishu-K7EGSRF3.js} +528 -572
- package/dist/{feishu_custom_bot-TJ4K7QNJ.js → feishu_custom_bot-2JUGFYNG.js} +57 -53
- package/dist/figma-FT5I7ITD.js +777 -0
- package/dist/firehydrant-EIKLKHX2.js +563 -0
- package/dist/{fixer-BWON27UO.js → fixer-U5QXIAKD.js} +34 -33
- package/dist/fly-T3JYFZ2M.js +469 -0
- package/dist/{front-QCGXYEDJ.js → front-D72MGVOR.js} +104 -104
- package/dist/geocodio-BOTD5TI5.js +213 -0
- package/dist/ghost-KYP7SZGB.js +338 -0
- package/dist/github-AGMZT3VY.js +5421 -0
- package/dist/gmail-BLJNJOBG.js +1887 -0
- package/dist/googlecalendar-GTHWNCF6.js +2524 -0
- package/dist/{googledocs-BUHL4J2H.js → googledocs-6EEDMEBQ.js} +341 -340
- package/dist/{grafana-GLU2DWF2.js → grafana-GMW6EKSQ.js} +221 -220
- package/dist/graphhopper-6OLGBDGB.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -14
- package/dist/{ip2proxy-EZ64Y4ZH.js → ip2proxy-4QN42E6T.js} +28 -27
- package/dist/ipgeolocation_io-SK4XKDA2.js +315 -0
- package/dist/ipqualityscore-6ANBPXKT.js +279 -0
- package/dist/{jina_ai-EFBHTBXL.js → jina_ai-IHPSVRM5.js} +23 -23
- package/dist/{jira-HQSHAA5K.js → jira-46KKM4LC.js} +118 -117
- package/dist/langsmith-JZA345I5.js +593 -0
- package/dist/lemlist-43IV7DK6.js +289 -0
- package/dist/{linear-K7RYFYAD.js → linear-5LFH7XNL.js} +327 -326
- package/dist/logsnag-5RMYAHIL.js +150 -0
- package/dist/main.js +57 -280
- package/dist/{mattermost-S2BRCWLQ.js → mattermost-XFL6SHGG.js} +59 -58
- package/dist/mem0-NYO4DTP6.js +544 -0
- package/dist/memos-37MPQOLV.js +744 -0
- package/dist/{metabase-MMSEPCOF.js → metabase-KYBKZFMG.js} +90 -89
- package/dist/mistral_ai-6PL3K4PM.js +1196 -0
- package/dist/{mother_duck-H7PCQNZ2.js → mother_duck-2NH7W5M5.js} +94 -93
- package/dist/ngrok-UO6CDYCA.js +356 -0
- package/dist/{notes-PFMKRO33.js → notes-I3P32WP4.js} +11 -9
- package/dist/notion-BEAJFUOE.js +940 -0
- package/dist/open_exchange_rates-CMF62JB4.js +215 -0
- package/dist/openai-IHOMKVND.js +800 -0
- package/dist/opengraph_io-ZQ2FGLHX.js +362 -0
- package/dist/openrouter-HXLW3NR5.js +441 -0
- package/dist/outline-ELCP4NEU.js +599 -0
- package/dist/paddle-O77LALVN.js +454 -0
- package/dist/perplexity-JCU654QV.js +220 -0
- package/dist/pinecone-W5W4LRKL.js +571 -0
- package/dist/{pipedrive-Y2O7QGFF.js → pipedrive-ITMJLLPZ.js} +99 -98
- package/dist/polar-R33XU4L3.js +395 -0
- package/dist/posthog-JVNTOLTV.js +3464 -0
- package/dist/postmark-6SBG7HWV.js +427 -0
- package/dist/{prerender-MENYM2TY.js → prerender-GPNKTNFC.js} +31 -30
- package/dist/{pubmed-GOXUVVH5.js → pubmed-UP6ZEEIH.js} +239 -238
- package/dist/{railway-V2SID4WV.js → railway-KWEWXHTY.js} +118 -117
- package/dist/readwise-BLATSMC3.js +470 -0
- package/dist/render-QYRVIXII.js +461 -0
- package/dist/{replicate-756MXPYX.js → replicate-JYTWH4NF.js} +81 -80
- package/dist/{resend-ZKH3BTBI.js → resend-L5N75SZM.js} +20 -16
- package/dist/rootly-MHCPEQ26.js +336 -0
- package/dist/{scrapfly-NSRHFDIQ.js → scrapfly-PTPGYSJM.js} +62 -61
- package/dist/{scrapingbee-OQHLAVEY.js → scrapingbee-JN6UH5PY.js} +56 -56
- package/dist/{screenshot_fyi-DVWG3AXC.js → screenshot_fyi-4QRVSV55.js} +16 -16
- package/dist/semantic_scholar-LRSWA2GE.js +611 -0
- package/dist/{sentry-546MNDJG.js → sentry-2G6PF5W6.js} +208 -207
- package/dist/{shodan-C3OON3Z3.js → shodan-WKKPP5C6.js} +62 -61
- package/dist/shopify-64YDK5T2.js +610 -0
- package/dist/stripe-QAIGGOTF.js +585 -0
- package/dist/{supabase-U2SL4D63.js → supabase-WHTGR6ND.js} +245 -244
- package/dist/tavily-QIXCDDWO.js +326 -0
- package/dist/telegram-E6G7CWI6.js +1767 -0
- package/dist/{telnyx-CXQ4EZUX.js → telnyx-ZDVVS7PK.js} +57 -56
- package/dist/todoist-DMYF3G7J.js +664 -0
- package/dist/trello-HY2RYIRP.js +1080 -0
- package/dist/turso-HAQWMGRP.js +416 -0
- package/dist/{twilio-4PDBJKWX.js → twilio-MLXYPHJE.js} +70 -69
- package/dist/umami-DZHBLPVG.js +389 -0
- package/dist/unsplash-GS2OPXKE.js +351 -0
- package/dist/{upstash_redis-G4LQBYHA.js → upstash_redis-XMXWTNAJ.js} +51 -50
- package/dist/uptimerobot-TF5WRZ4G.js +483 -0
- package/dist/v2ex-2BVXAPDF.js +667 -0
- package/dist/vercel-YMJGQYJE.js +1076 -0
- package/dist/{wolfram_alpha_api-3G4PUJWB.js → wolfram_alpha_api-I56SXWFZ.js} +36 -35
- package/dist/wordpress-R7TDFZ2P.js +812 -0
- package/dist/workos-HDNHWVMS.js +664 -0
- package/dist/zhihu-LX6AGGDS.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-LLZDFN7M.js +0 -789
- package/dist/anthropic-G23NN3X5.js +0 -202
- package/dist/apify-Y3SS734K.js +0 -247
- package/dist/brave_search-ZC7OAPSZ.js +0 -301
- package/dist/chunk-R6P4XAE5.js +0 -248
- package/dist/chunk-U7B6DS2O.js +0 -977
- package/dist/chunk-UZM2RXZH.js +0 -23436
- package/dist/circleci-3BAX5FCG.js +0 -388
- package/dist/clerk-6LEM6TNU.js +0 -1019
- package/dist/cloudflare_dns-KINYTJUD.js +0 -588
- package/dist/cohere-XCJ5AJ6B.js +0 -185
- package/dist/deepseek-PC5YGNC5.js +0 -209
- package/dist/docker_hub-C3MA5FU6.js +0 -932
- package/dist/dropbox-XBV7Z2IR.js +0 -1304
- package/dist/dub-LDOFG3HC.js +0 -679
- package/dist/e2b-JMCPSVBW.js +0 -277
- package/dist/exa-RAK7O7RD.js +0 -331
- package/dist/figma-E6IX5DTH.js +0 -773
- package/dist/firehydrant-ZBLPQREE.js +0 -562
- package/dist/fly-ZH3HFCZJ.js +0 -468
- package/dist/geocodio-YGNI7DA4.js +0 -212
- package/dist/ghost-EVSGKH2Q.js +0 -337
- package/dist/github-MA2BGRCJ.js +0 -5420
- package/dist/gmail-E5E6AADE.js +0 -1886
- package/dist/googlecalendar-BTLFPXTD.js +0 -2523
- package/dist/graphhopper-WSMB3TCD.js +0 -324
- package/dist/ipgeolocation_io-AA7HAS22.js +0 -315
- package/dist/ipqualityscore-BHJXVTJT.js +0 -277
- package/dist/langsmith-5W6SCT6F.js +0 -592
- package/dist/lemlist-HJWH6UMK.js +0 -288
- package/dist/logsnag-4KFOHL37.js +0 -150
- package/dist/mem0-CAW43CIC.js +0 -543
- package/dist/memos-TWEGPKFM.js +0 -740
- package/dist/mistral_ai-64BGZQHP.js +0 -1195
- package/dist/ngrok-GQCUGZKJ.js +0 -356
- package/dist/notion-DQWZWP4N.js +0 -936
- package/dist/open_exchange_rates-QMMD735E.js +0 -214
- package/dist/openai-W6PX32NZ.js +0 -799
- package/dist/opengraph_io-HNDBXYNW.js +0 -361
- package/dist/openrouter-JJYMEAUL.js +0 -437
- package/dist/outline-MCBNQZYY.js +0 -595
- package/dist/paddle-D2SKLUDN.js +0 -453
- package/dist/perplexity-XIFMKUAE.js +0 -219
- package/dist/pinecone-HUFTALV2.js +0 -570
- package/dist/polar-TYTOMOSR.js +0 -394
- package/dist/posthog-43JAR3VW.js +0 -3463
- package/dist/postmark-KL2QJYSG.js +0 -426
- package/dist/readwise-CI4GIMMJ.js +0 -469
- package/dist/render-SUBJ6YRZ.js +0 -460
- package/dist/rootly-CD2LJHPI.js +0 -336
- package/dist/semantic_scholar-T4A252KW.js +0 -610
- package/dist/shopify-Y2HN2MCQ.js +0 -609
- package/dist/stripe-VE3CD3AY.js +0 -584
- package/dist/tavily-KCZHK6HE.js +0 -326
- package/dist/telegram-3URFBCMY.js +0 -1766
- package/dist/todoist-HNPWNYTD.js +0 -663
- package/dist/trello-3W2MIXRP.js +0 -1079
- package/dist/turso-2EQF7C2Z.js +0 -415
- package/dist/umami-5REN7TGP.js +0 -388
- package/dist/unsplash-EIXL424F.js +0 -350
- package/dist/uptimerobot-KNJ3EYLY.js +0 -482
- package/dist/v2ex-RHJ234PZ.js +0 -666
- package/dist/vercel-AS6NCIC7.js +0 -1075
- package/dist/wordpress-KNDAAUV7.js +0 -811
- package/dist/workos-R6UITSJ7.js +0 -663
- package/dist/zhihu-AGK4HILK.js +0 -253
|
@@ -1,592 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAuthedClient
|
|
3
|
-
} from "./chunk-XYBU3WZH.js";
|
|
4
|
-
import "./chunk-E6JCVKW6.js";
|
|
5
|
-
import {
|
|
6
|
-
asJsonObject,
|
|
7
|
-
compactDefined,
|
|
8
|
-
finiteNumber,
|
|
9
|
-
integerValue,
|
|
10
|
-
trimmedText
|
|
11
|
-
} from "./chunk-JXHMDBAY.js";
|
|
12
|
-
import {
|
|
13
|
-
createProviderPlugin,
|
|
14
|
-
requireApiKey,
|
|
15
|
-
upstreamError
|
|
16
|
-
} from "./chunk-ATK45BXV.js";
|
|
17
|
-
import "./chunk-U7B6DS2O.js";
|
|
18
|
-
import {
|
|
19
|
-
TBError,
|
|
20
|
-
external_exports
|
|
21
|
-
} from "./chunk-UZM2RXZH.js";
|
|
22
|
-
import "./chunk-U67V476Y.js";
|
|
23
|
-
|
|
24
|
-
// ../plugins/src/langsmith/api.ts
|
|
25
|
-
var SERVICE = "langsmith";
|
|
26
|
-
var WORKSPACES_PATH = "/api/v1/workspaces";
|
|
27
|
-
var DEFAULT_REGION = "us";
|
|
28
|
-
var http = createAuthedClient({
|
|
29
|
-
service: SERVICE,
|
|
30
|
-
auth: { kind: "header", name: "X-Api-Key" },
|
|
31
|
-
headers: { accept: "application/json" },
|
|
32
|
-
// 错误消息四处之一;拿不到就退回状态行。
|
|
33
|
-
errorMessage: {
|
|
34
|
-
keys: ["detail", "message", "error", "title"],
|
|
35
|
-
fallback: (status, statusText) => trimmedText(statusText) ?? `langsmith \u8FD4\u56DE HTTP ${status}`
|
|
36
|
-
},
|
|
37
|
-
mapTransportError: ({ message }) => upstreamError(
|
|
38
|
-
502,
|
|
39
|
-
`langsmith \u8BF7\u6C42\u5931\u8D25: ${message ?? "\u672A\u77E5\u9519\u8BEF"}`
|
|
40
|
-
)
|
|
41
|
-
});
|
|
42
|
-
var REGION_BASE_URLS = {
|
|
43
|
-
us: "https://api.smith.langchain.com",
|
|
44
|
-
eu: "https://eu.api.smith.langchain.com",
|
|
45
|
-
apac: "https://apac.api.smith.langchain.com",
|
|
46
|
-
aws_us: "https://aws.api.smith.langchain.com"
|
|
47
|
-
};
|
|
48
|
-
function configError(message) {
|
|
49
|
-
return new TBError("invalid_argument", `${SERVICE} \u7684 ${message}`);
|
|
50
|
-
}
|
|
51
|
-
function resolveApiBase(ctx) {
|
|
52
|
-
const configured = ctx.config?.region;
|
|
53
|
-
if (configured !== void 0 && typeof configured !== "string") throw configError("region \u5FC5\u987B\u662F\u5B57\u7B26\u4E32");
|
|
54
|
-
const raw = trimmedText(configured) ?? DEFAULT_REGION;
|
|
55
|
-
const region = raw === "aws" ? "aws_us" : raw;
|
|
56
|
-
const base = REGION_BASE_URLS[region];
|
|
57
|
-
if (base === void 0) throw configError("region \u5FC5\u987B\u662F us\u3001eu\u3001apac \u6216 aws_us \u4E4B\u4E00");
|
|
58
|
-
return base;
|
|
59
|
-
}
|
|
60
|
-
function resolveWorkspaceId(ctx) {
|
|
61
|
-
const configured = ctx.config?.workspaceId;
|
|
62
|
-
if (configured !== void 0 && typeof configured !== "string") throw configError("workspaceId \u5FC5\u987B\u662F\u5B57\u7B26\u4E32");
|
|
63
|
-
return trimmedText(configured);
|
|
64
|
-
}
|
|
65
|
-
function queryPairs(query) {
|
|
66
|
-
return Object.entries(query ?? {}).flatMap(([key, value]) => {
|
|
67
|
-
if (value === void 0 || value === null) return [];
|
|
68
|
-
return Array.isArray(value) ? value.flatMap((item) => item === void 0 || item === null ? [] : [[key, String(item)]]) : [[key, String(value)]];
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async function request(ctx, input) {
|
|
72
|
-
requireApiKey(ctx, SERVICE);
|
|
73
|
-
const workspaceId = resolveWorkspaceId(ctx);
|
|
74
|
-
const result = await http.request(ctx, {
|
|
75
|
-
baseUrl: resolveApiBase(ctx),
|
|
76
|
-
path: input.path,
|
|
77
|
-
method: input.method ?? "GET",
|
|
78
|
-
query: queryPairs(input.query),
|
|
79
|
-
// 一个 API key 能看到多个 workspace 时,靠 `X-Tenant-Id` 指定用哪个。
|
|
80
|
-
...workspaceId === void 0 ? {} : { headers: { "X-Tenant-Id": workspaceId } },
|
|
81
|
-
...input.body === void 0 ? {} : { json: input.body },
|
|
82
|
-
invalidJson: "text"
|
|
83
|
-
});
|
|
84
|
-
return result.data === void 0 ? null : result.data;
|
|
85
|
-
}
|
|
86
|
-
function ensureObject(value, label) {
|
|
87
|
-
const result = asJsonObject(value);
|
|
88
|
-
if (result === void 0) {
|
|
89
|
-
throw new TBError("unavailable", `${label} response is not an object`, { retryable: true });
|
|
90
|
-
}
|
|
91
|
-
return result;
|
|
92
|
-
}
|
|
93
|
-
function ensureObjectArray(value, label) {
|
|
94
|
-
if (!Array.isArray(value)) {
|
|
95
|
-
throw new TBError("unavailable", `${label} response is not an array`, { retryable: true });
|
|
96
|
-
}
|
|
97
|
-
return value.map((item) => ensureObject(item, label));
|
|
98
|
-
}
|
|
99
|
-
function requirePathId(value, field) {
|
|
100
|
-
const id = trimmedText(value);
|
|
101
|
-
if (id === void 0) throw new TBError("invalid_argument", `${field} \u4E0D\u80FD\u4E3A\u7A7A`);
|
|
102
|
-
return encodeURIComponent(id);
|
|
103
|
-
}
|
|
104
|
-
function normalizeWorkspace(value) {
|
|
105
|
-
return {
|
|
106
|
-
id: String(value.id ?? ""),
|
|
107
|
-
organization_id: trimmedText(value.organization_id) ?? null,
|
|
108
|
-
display_name: trimmedText(value.display_name) ?? "",
|
|
109
|
-
is_personal: value.is_personal === true,
|
|
110
|
-
is_deleted: value.is_deleted === true,
|
|
111
|
-
tenant_handle: trimmedText(value.tenant_handle) ?? null,
|
|
112
|
-
data_plane_url: trimmedText(value.data_plane_url) ?? null,
|
|
113
|
-
// 裁剪后的字段是稳定契约,`raw` 是逃生阀:上游加了新字段也不必等我们改代码。
|
|
114
|
-
raw: value
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function normalizeProject(value) {
|
|
118
|
-
return {
|
|
119
|
-
id: String(value.id ?? ""),
|
|
120
|
-
tenant_id: String(value.tenant_id ?? ""),
|
|
121
|
-
name: trimmedText(value.name) ?? null,
|
|
122
|
-
description: trimmedText(value.description) ?? null,
|
|
123
|
-
start_time: trimmedText(value.start_time) ?? null,
|
|
124
|
-
end_time: trimmedText(value.end_time) ?? null,
|
|
125
|
-
run_count: integerValue(value.run_count) ?? null,
|
|
126
|
-
error_rate: finiteNumber(value.error_rate) ?? null,
|
|
127
|
-
default_dataset_id: trimmedText(value.default_dataset_id) ?? null,
|
|
128
|
-
reference_dataset_id: trimmedText(value.reference_dataset_id) ?? null,
|
|
129
|
-
raw: value
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function nullableObject(value) {
|
|
133
|
-
if (value === null || value === void 0) return null;
|
|
134
|
-
return asJsonObject(value) ?? {};
|
|
135
|
-
}
|
|
136
|
-
function normalizeDataset(value) {
|
|
137
|
-
return {
|
|
138
|
-
id: String(value.id ?? ""),
|
|
139
|
-
tenant_id: String(value.tenant_id ?? ""),
|
|
140
|
-
name: trimmedText(value.name) ?? "",
|
|
141
|
-
description: trimmedText(value.description) ?? null,
|
|
142
|
-
data_type: trimmedText(value.data_type) ?? null,
|
|
143
|
-
created_at: trimmedText(value.created_at) ?? null,
|
|
144
|
-
modified_at: trimmedText(value.modified_at) ?? null,
|
|
145
|
-
example_count: integerValue(value.example_count) ?? null,
|
|
146
|
-
session_count: integerValue(value.session_count) ?? null,
|
|
147
|
-
metadata: nullableObject(value.metadata),
|
|
148
|
-
raw: value
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function normalizeExample(value) {
|
|
152
|
-
return {
|
|
153
|
-
id: String(value.id ?? ""),
|
|
154
|
-
dataset_id: String(value.dataset_id ?? ""),
|
|
155
|
-
name: trimmedText(value.name) ?? null,
|
|
156
|
-
created_at: trimmedText(value.created_at) ?? null,
|
|
157
|
-
modified_at: trimmedText(value.modified_at) ?? null,
|
|
158
|
-
inputs: asJsonObject(value.inputs) ?? {},
|
|
159
|
-
outputs: nullableObject(value.outputs),
|
|
160
|
-
metadata: nullableObject(value.metadata),
|
|
161
|
-
raw: value
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
async function listWorkspaces(input, ctx) {
|
|
165
|
-
const payload = await request(ctx, {
|
|
166
|
-
path: WORKSPACES_PATH,
|
|
167
|
-
query: compactDefined({ include_deleted: input.include_deleted, data_plane_id: trimmedText(input.data_plane_id) })
|
|
168
|
-
});
|
|
169
|
-
return { workspaces: ensureObjectArray(payload, "LangSmith workspace list").map(normalizeWorkspace) };
|
|
170
|
-
}
|
|
171
|
-
async function listProjects(input, ctx) {
|
|
172
|
-
const payload = await request(ctx, {
|
|
173
|
-
path: "/api/v1/sessions",
|
|
174
|
-
query: compactDefined({
|
|
175
|
-
name: trimmedText(input.name),
|
|
176
|
-
name_contains: trimmedText(input.name_contains),
|
|
177
|
-
include_stats: input.include_stats,
|
|
178
|
-
sort_by_desc: input.sort_by_desc,
|
|
179
|
-
offset: input.offset,
|
|
180
|
-
limit: input.limit
|
|
181
|
-
})
|
|
182
|
-
});
|
|
183
|
-
return { projects: ensureObjectArray(payload, "LangSmith project list").map(normalizeProject) };
|
|
184
|
-
}
|
|
185
|
-
async function getProject(input, ctx) {
|
|
186
|
-
const payload = await request(ctx, {
|
|
187
|
-
path: `/api/v1/sessions/${requirePathId(input.projectId, "projectId")}`,
|
|
188
|
-
query: compactDefined({ include_stats: input.include_stats })
|
|
189
|
-
});
|
|
190
|
-
return { project: normalizeProject(ensureObject(payload, "LangSmith project")) };
|
|
191
|
-
}
|
|
192
|
-
async function createProject(input, ctx) {
|
|
193
|
-
const payload = await request(ctx, {
|
|
194
|
-
method: "POST",
|
|
195
|
-
path: "/api/v1/sessions",
|
|
196
|
-
// upsert 是 query 参数而不是 body 字段 —— 放进 body 会被忽略,同名项目直接 409。
|
|
197
|
-
query: compactDefined({ upsert: input.upsert }),
|
|
198
|
-
body: compactDefined({
|
|
199
|
-
name: trimmedText(input.name),
|
|
200
|
-
description: trimmedText(input.description),
|
|
201
|
-
start_time: trimmedText(input.start_time),
|
|
202
|
-
end_time: trimmedText(input.end_time),
|
|
203
|
-
extra: input.extra,
|
|
204
|
-
default_dataset_id: trimmedText(input.default_dataset_id),
|
|
205
|
-
reference_dataset_id: trimmedText(input.reference_dataset_id)
|
|
206
|
-
})
|
|
207
|
-
});
|
|
208
|
-
return { project: normalizeProject(ensureObject(payload, "LangSmith created project")) };
|
|
209
|
-
}
|
|
210
|
-
async function listDatasets(input, ctx) {
|
|
211
|
-
const payload = await request(ctx, {
|
|
212
|
-
path: "/api/v1/datasets",
|
|
213
|
-
query: compactDefined({
|
|
214
|
-
name: trimmedText(input.name),
|
|
215
|
-
name_contains: trimmedText(input.name_contains),
|
|
216
|
-
data_type: trimmedText(input.data_type),
|
|
217
|
-
offset: input.offset,
|
|
218
|
-
limit: input.limit
|
|
219
|
-
})
|
|
220
|
-
});
|
|
221
|
-
return { datasets: ensureObjectArray(payload, "LangSmith dataset list").map(normalizeDataset) };
|
|
222
|
-
}
|
|
223
|
-
async function getDataset(input, ctx) {
|
|
224
|
-
const payload = await request(ctx, { path: `/api/v1/datasets/${requirePathId(input.datasetId, "datasetId")}` });
|
|
225
|
-
return { dataset: normalizeDataset(ensureObject(payload, "LangSmith dataset")) };
|
|
226
|
-
}
|
|
227
|
-
async function createDataset(input, ctx) {
|
|
228
|
-
const payload = await request(ctx, {
|
|
229
|
-
method: "POST",
|
|
230
|
-
path: "/api/v1/datasets",
|
|
231
|
-
body: compactDefined({
|
|
232
|
-
name: trimmedText(input.name),
|
|
233
|
-
description: trimmedText(input.description),
|
|
234
|
-
data_type: trimmedText(input.data_type),
|
|
235
|
-
inputs_schema_definition: input.inputs_schema_definition,
|
|
236
|
-
outputs_schema_definition: input.outputs_schema_definition,
|
|
237
|
-
metadata: input.metadata,
|
|
238
|
-
externally_managed: input.externally_managed
|
|
239
|
-
})
|
|
240
|
-
});
|
|
241
|
-
return { dataset: normalizeDataset(ensureObject(payload, "LangSmith created dataset")) };
|
|
242
|
-
}
|
|
243
|
-
async function listExamples(input, ctx) {
|
|
244
|
-
const payload = await request(ctx, {
|
|
245
|
-
path: "/api/v1/examples",
|
|
246
|
-
query: compactDefined({
|
|
247
|
-
// 线上参数名是 `dataset`,不是入参里的 `datasetId`。
|
|
248
|
-
dataset: trimmedText(input.datasetId),
|
|
249
|
-
full_text_contains: input.full_text_contains,
|
|
250
|
-
as_of: trimmedText(input.as_of),
|
|
251
|
-
offset: input.offset,
|
|
252
|
-
limit: input.limit
|
|
253
|
-
})
|
|
254
|
-
});
|
|
255
|
-
return { examples: ensureObjectArray(payload, "LangSmith example list").map(normalizeExample) };
|
|
256
|
-
}
|
|
257
|
-
async function getExample(input, ctx) {
|
|
258
|
-
const payload = await request(ctx, {
|
|
259
|
-
path: `/api/v1/examples/${requirePathId(input.exampleId, "exampleId")}`,
|
|
260
|
-
query: compactDefined({ dataset: trimmedText(input.datasetId), as_of: trimmedText(input.as_of) })
|
|
261
|
-
});
|
|
262
|
-
return { example: normalizeExample(ensureObject(payload, "LangSmith example")) };
|
|
263
|
-
}
|
|
264
|
-
async function createExample(input, ctx) {
|
|
265
|
-
const payload = await request(ctx, {
|
|
266
|
-
method: "POST",
|
|
267
|
-
path: "/api/v1/examples",
|
|
268
|
-
body: compactDefined({
|
|
269
|
-
// 建例子时又叫 `dataset_id`(与 list/get 的 `dataset` 不是一个名字)。
|
|
270
|
-
dataset_id: trimmedText(input.datasetId),
|
|
271
|
-
inputs: input.inputs,
|
|
272
|
-
outputs: input.outputs,
|
|
273
|
-
metadata: input.metadata,
|
|
274
|
-
split: input.split,
|
|
275
|
-
id: trimmedText(input.id),
|
|
276
|
-
created_at: trimmedText(input.created_at)
|
|
277
|
-
})
|
|
278
|
-
});
|
|
279
|
-
return { example: normalizeExample(ensureObject(payload, "LangSmith created example")) };
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// ../plugins/src/langsmith/schema.ts
|
|
283
|
-
var listWorkspacesInput = external_exports.strictObject({
|
|
284
|
-
include_deleted: external_exports.boolean().describe("Whether to include deleted workspaces in the response.").optional(),
|
|
285
|
-
data_plane_id: external_exports.uuid().describe("The LangSmith UUID.").optional()
|
|
286
|
-
}).describe("Input parameters for listing LangSmith workspaces.");
|
|
287
|
-
var listWorkspacesOutput = external_exports.strictObject({
|
|
288
|
-
workspaces: external_exports.array(external_exports.strictObject({
|
|
289
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
290
|
-
organization_id: external_exports.uuid().describe("The organization ID that owns the workspace.").nullable().optional(),
|
|
291
|
-
display_name: external_exports.string().describe("The workspace display name.").optional(),
|
|
292
|
-
is_personal: external_exports.boolean().describe("Whether this is a personal workspace.").optional(),
|
|
293
|
-
is_deleted: external_exports.boolean().describe("Whether LangSmith marks the workspace as deleted.").optional(),
|
|
294
|
-
tenant_handle: external_exports.string().describe("The workspace handle when returned.").nullable().optional(),
|
|
295
|
-
data_plane_url: external_exports.string().describe("The workspace data-plane URL when returned.").nullable().optional(),
|
|
296
|
-
raw: external_exports.looseObject({}).describe("The raw workspace object returned by LangSmith.").optional()
|
|
297
|
-
}).describe("A LangSmith workspace visible to the API key.")).describe("The workspaces returned by LangSmith.").optional()
|
|
298
|
-
}).describe("The response returned when listing LangSmith workspaces.");
|
|
299
|
-
var listProjectsInput = external_exports.strictObject({
|
|
300
|
-
name: external_exports.string().min(1).describe("A non-empty project name.").optional(),
|
|
301
|
-
name_contains: external_exports.string().min(1).describe("A non-empty project name fragment.").optional(),
|
|
302
|
-
include_stats: external_exports.boolean().describe("Whether LangSmith should include project statistics.").optional(),
|
|
303
|
-
sort_by_desc: external_exports.boolean().describe("Whether LangSmith should sort descending.").optional(),
|
|
304
|
-
offset: external_exports.int().min(0).describe("The number of records to skip.").optional(),
|
|
305
|
-
limit: external_exports.int().min(1).max(100).describe("The maximum number of records to return.").optional()
|
|
306
|
-
}).describe("Input parameters for listing LangSmith projects.");
|
|
307
|
-
var listProjectsOutput = external_exports.strictObject({
|
|
308
|
-
projects: external_exports.array(external_exports.strictObject({
|
|
309
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
310
|
-
tenant_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
311
|
-
name: external_exports.string().describe("The project name when returned.").nullable().optional(),
|
|
312
|
-
description: external_exports.string().describe("The project description when returned.").nullable().optional(),
|
|
313
|
-
start_time: external_exports.string().describe("The project start timestamp when returned.").nullable().optional(),
|
|
314
|
-
end_time: external_exports.string().describe("The project end timestamp when returned.").nullable().optional(),
|
|
315
|
-
run_count: external_exports.int().describe("The number of runs in the project when returned.").nullable().optional(),
|
|
316
|
-
error_rate: external_exports.number().describe("The project error rate when returned.").nullable().optional(),
|
|
317
|
-
default_dataset_id: external_exports.uuid().describe("The default dataset ID when returned.").nullable().optional(),
|
|
318
|
-
reference_dataset_id: external_exports.uuid().describe("The reference dataset ID when returned.").nullable().optional(),
|
|
319
|
-
raw: external_exports.looseObject({}).describe("The raw project object returned by LangSmith.").optional()
|
|
320
|
-
}).describe("A LangSmith tracing project.")).describe("The projects returned by LangSmith.").optional()
|
|
321
|
-
}).describe("The response returned when listing LangSmith projects.");
|
|
322
|
-
var getProjectInput = external_exports.strictObject({
|
|
323
|
-
projectId: external_exports.uuid().describe("The LangSmith UUID."),
|
|
324
|
-
include_stats: external_exports.boolean().describe("Whether LangSmith should include project statistics.").optional()
|
|
325
|
-
}).describe("Input parameters for getting a LangSmith project.");
|
|
326
|
-
var getProjectOutput = external_exports.strictObject({
|
|
327
|
-
project: external_exports.strictObject({
|
|
328
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
329
|
-
tenant_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
330
|
-
name: external_exports.string().describe("The project name when returned.").nullable().optional(),
|
|
331
|
-
description: external_exports.string().describe("The project description when returned.").nullable().optional(),
|
|
332
|
-
start_time: external_exports.string().describe("The project start timestamp when returned.").nullable().optional(),
|
|
333
|
-
end_time: external_exports.string().describe("The project end timestamp when returned.").nullable().optional(),
|
|
334
|
-
run_count: external_exports.int().describe("The number of runs in the project when returned.").nullable().optional(),
|
|
335
|
-
error_rate: external_exports.number().describe("The project error rate when returned.").nullable().optional(),
|
|
336
|
-
default_dataset_id: external_exports.uuid().describe("The default dataset ID when returned.").nullable().optional(),
|
|
337
|
-
reference_dataset_id: external_exports.uuid().describe("The reference dataset ID when returned.").nullable().optional(),
|
|
338
|
-
raw: external_exports.looseObject({}).describe("The raw project object returned by LangSmith.").optional()
|
|
339
|
-
}).describe("A LangSmith tracing project.").optional()
|
|
340
|
-
}).describe("The response returned when getting a LangSmith project.");
|
|
341
|
-
var createProjectInput = external_exports.strictObject({
|
|
342
|
-
name: external_exports.string().min(1).describe("The project name."),
|
|
343
|
-
description: external_exports.string().describe("The project description.").optional(),
|
|
344
|
-
start_time: external_exports.string().describe("The project start timestamp.").optional(),
|
|
345
|
-
end_time: external_exports.string().describe("The project end timestamp.").optional(),
|
|
346
|
-
extra: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").optional(),
|
|
347
|
-
default_dataset_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
348
|
-
reference_dataset_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
349
|
-
upsert: external_exports.boolean().describe("Whether LangSmith should upsert a project with the same name.").optional()
|
|
350
|
-
}).describe("Input parameters for creating a LangSmith project.");
|
|
351
|
-
var createProjectOutput = external_exports.strictObject({
|
|
352
|
-
project: external_exports.strictObject({
|
|
353
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
354
|
-
tenant_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
355
|
-
name: external_exports.string().describe("The project name when returned.").nullable().optional(),
|
|
356
|
-
description: external_exports.string().describe("The project description when returned.").nullable().optional(),
|
|
357
|
-
start_time: external_exports.string().describe("The project start timestamp when returned.").nullable().optional(),
|
|
358
|
-
end_time: external_exports.string().describe("The project end timestamp when returned.").nullable().optional(),
|
|
359
|
-
run_count: external_exports.int().describe("The number of runs in the project when returned.").nullable().optional(),
|
|
360
|
-
error_rate: external_exports.number().describe("The project error rate when returned.").nullable().optional(),
|
|
361
|
-
default_dataset_id: external_exports.uuid().describe("The default dataset ID when returned.").nullable().optional(),
|
|
362
|
-
reference_dataset_id: external_exports.uuid().describe("The reference dataset ID when returned.").nullable().optional(),
|
|
363
|
-
raw: external_exports.looseObject({}).describe("The raw project object returned by LangSmith.").optional()
|
|
364
|
-
}).describe("A LangSmith tracing project.").optional()
|
|
365
|
-
}).describe("The response returned when creating a LangSmith project.");
|
|
366
|
-
var listDatasetsInput = external_exports.strictObject({
|
|
367
|
-
name: external_exports.string().min(1).describe("A non-empty dataset name.").optional(),
|
|
368
|
-
name_contains: external_exports.string().min(1).describe("A non-empty dataset name fragment.").optional(),
|
|
369
|
-
data_type: external_exports.enum(["kv", "llm", "chat"]).describe("The LangSmith dataset data type.").optional(),
|
|
370
|
-
offset: external_exports.int().min(0).describe("The number of records to skip.").optional(),
|
|
371
|
-
limit: external_exports.int().min(1).max(100).describe("The maximum number of records to return.").optional()
|
|
372
|
-
}).describe("Input parameters for listing LangSmith datasets.");
|
|
373
|
-
var listDatasetsOutput = external_exports.strictObject({
|
|
374
|
-
datasets: external_exports.array(external_exports.strictObject({
|
|
375
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
376
|
-
tenant_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
377
|
-
name: external_exports.string().describe("The dataset name.").optional(),
|
|
378
|
-
description: external_exports.string().describe("The dataset description when returned.").nullable().optional(),
|
|
379
|
-
data_type: external_exports.enum(["kv", "llm", "chat"]).describe("The LangSmith dataset data type.").nullable().optional(),
|
|
380
|
-
created_at: external_exports.string().describe("The dataset creation timestamp when returned.").nullable().optional(),
|
|
381
|
-
modified_at: external_exports.string().describe("The dataset modification timestamp when returned.").nullable().optional(),
|
|
382
|
-
example_count: external_exports.int().describe("The dataset example count when returned.").nullable().optional(),
|
|
383
|
-
session_count: external_exports.int().describe("The dataset experiment session count when returned.").nullable().optional(),
|
|
384
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").nullable().optional(),
|
|
385
|
-
raw: external_exports.looseObject({}).describe("The raw dataset object returned by LangSmith.").optional()
|
|
386
|
-
}).describe("A LangSmith dataset.")).describe("The datasets returned by LangSmith.").optional()
|
|
387
|
-
}).describe("The response returned when listing LangSmith datasets.");
|
|
388
|
-
var getDatasetInput = external_exports.strictObject({
|
|
389
|
-
datasetId: external_exports.uuid().describe("The LangSmith UUID.").optional()
|
|
390
|
-
}).describe("Input parameters for getting a LangSmith dataset.");
|
|
391
|
-
var getDatasetOutput = external_exports.strictObject({
|
|
392
|
-
dataset: external_exports.strictObject({
|
|
393
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
394
|
-
tenant_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
395
|
-
name: external_exports.string().describe("The dataset name.").optional(),
|
|
396
|
-
description: external_exports.string().describe("The dataset description when returned.").nullable().optional(),
|
|
397
|
-
data_type: external_exports.enum(["kv", "llm", "chat"]).describe("The LangSmith dataset data type.").nullable().optional(),
|
|
398
|
-
created_at: external_exports.string().describe("The dataset creation timestamp when returned.").nullable().optional(),
|
|
399
|
-
modified_at: external_exports.string().describe("The dataset modification timestamp when returned.").nullable().optional(),
|
|
400
|
-
example_count: external_exports.int().describe("The dataset example count when returned.").nullable().optional(),
|
|
401
|
-
session_count: external_exports.int().describe("The dataset experiment session count when returned.").nullable().optional(),
|
|
402
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").nullable().optional(),
|
|
403
|
-
raw: external_exports.looseObject({}).describe("The raw dataset object returned by LangSmith.").optional()
|
|
404
|
-
}).describe("A LangSmith dataset.").optional()
|
|
405
|
-
}).describe("The response returned when getting a LangSmith dataset.");
|
|
406
|
-
var createDatasetInput = external_exports.strictObject({
|
|
407
|
-
name: external_exports.string().min(1).describe("The dataset name."),
|
|
408
|
-
description: external_exports.string().describe("The dataset description.").optional(),
|
|
409
|
-
data_type: external_exports.enum(["kv", "llm", "chat"]).describe("The LangSmith dataset data type.").optional(),
|
|
410
|
-
inputs_schema_definition: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").optional(),
|
|
411
|
-
outputs_schema_definition: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").optional(),
|
|
412
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").optional(),
|
|
413
|
-
externally_managed: external_exports.boolean().describe("Whether the dataset is externally managed.").optional()
|
|
414
|
-
}).describe("Input parameters for creating a LangSmith dataset.");
|
|
415
|
-
var createDatasetOutput = external_exports.strictObject({
|
|
416
|
-
dataset: external_exports.strictObject({
|
|
417
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
418
|
-
tenant_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
419
|
-
name: external_exports.string().describe("The dataset name.").optional(),
|
|
420
|
-
description: external_exports.string().describe("The dataset description when returned.").nullable().optional(),
|
|
421
|
-
data_type: external_exports.enum(["kv", "llm", "chat"]).describe("The LangSmith dataset data type.").nullable().optional(),
|
|
422
|
-
created_at: external_exports.string().describe("The dataset creation timestamp when returned.").nullable().optional(),
|
|
423
|
-
modified_at: external_exports.string().describe("The dataset modification timestamp when returned.").nullable().optional(),
|
|
424
|
-
example_count: external_exports.int().describe("The dataset example count when returned.").nullable().optional(),
|
|
425
|
-
session_count: external_exports.int().describe("The dataset experiment session count when returned.").nullable().optional(),
|
|
426
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").nullable().optional(),
|
|
427
|
-
raw: external_exports.looseObject({}).describe("The raw dataset object returned by LangSmith.").optional()
|
|
428
|
-
}).describe("A LangSmith dataset.").optional()
|
|
429
|
-
}).describe("The response returned when creating a LangSmith dataset.");
|
|
430
|
-
var listExamplesInput = external_exports.strictObject({
|
|
431
|
-
datasetId: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
432
|
-
full_text_contains: external_exports.array(external_exports.string().min(1).describe("A text fragment.")).min(1).describe("Text fragments that LangSmith should search for.").optional(),
|
|
433
|
-
as_of: external_exports.string().describe("The dataset version timestamp or latest.").optional(),
|
|
434
|
-
offset: external_exports.int().min(0).describe("The number of records to skip.").optional(),
|
|
435
|
-
limit: external_exports.int().min(1).max(100).describe("The maximum number of records to return.").optional()
|
|
436
|
-
}).describe("Input parameters for listing LangSmith examples.");
|
|
437
|
-
var listExamplesOutput = external_exports.strictObject({
|
|
438
|
-
examples: external_exports.array(external_exports.strictObject({
|
|
439
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
440
|
-
dataset_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
441
|
-
name: external_exports.string().describe("The example name when returned.").nullable().optional(),
|
|
442
|
-
created_at: external_exports.string().describe("The example creation timestamp when returned.").nullable().optional(),
|
|
443
|
-
modified_at: external_exports.string().describe("The example modification timestamp when returned.").nullable().optional(),
|
|
444
|
-
inputs: external_exports.looseObject({}).describe("The example input values.").optional(),
|
|
445
|
-
outputs: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").nullable().optional(),
|
|
446
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").nullable().optional(),
|
|
447
|
-
raw: external_exports.looseObject({}).describe("The raw example object returned by LangSmith.").optional()
|
|
448
|
-
}).describe("A LangSmith dataset example.")).describe("The examples returned by LangSmith.").optional()
|
|
449
|
-
}).describe("The response returned when listing LangSmith examples.");
|
|
450
|
-
var getExampleInput = external_exports.strictObject({
|
|
451
|
-
exampleId: external_exports.uuid().describe("The LangSmith UUID."),
|
|
452
|
-
datasetId: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
453
|
-
as_of: external_exports.string().describe("The dataset version timestamp or latest.").optional()
|
|
454
|
-
}).describe("Input parameters for getting a LangSmith example.");
|
|
455
|
-
var getExampleOutput = external_exports.strictObject({
|
|
456
|
-
example: external_exports.strictObject({
|
|
457
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
458
|
-
dataset_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
459
|
-
name: external_exports.string().describe("The example name when returned.").nullable().optional(),
|
|
460
|
-
created_at: external_exports.string().describe("The example creation timestamp when returned.").nullable().optional(),
|
|
461
|
-
modified_at: external_exports.string().describe("The example modification timestamp when returned.").nullable().optional(),
|
|
462
|
-
inputs: external_exports.looseObject({}).describe("The example input values.").optional(),
|
|
463
|
-
outputs: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").nullable().optional(),
|
|
464
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").nullable().optional(),
|
|
465
|
-
raw: external_exports.looseObject({}).describe("The raw example object returned by LangSmith.").optional()
|
|
466
|
-
}).describe("A LangSmith dataset example.").optional()
|
|
467
|
-
}).describe("The response returned when getting a LangSmith example.");
|
|
468
|
-
var createExampleInput = external_exports.strictObject({
|
|
469
|
-
datasetId: external_exports.uuid().describe("The LangSmith UUID."),
|
|
470
|
-
inputs: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").optional(),
|
|
471
|
-
outputs: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").optional(),
|
|
472
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").optional(),
|
|
473
|
-
split: external_exports.union([external_exports.string().min(1).describe("A single split name."), external_exports.array(external_exports.string().min(1).describe("A split name.")).min(1).describe("A list of split names.")]).describe("One or more LangSmith dataset splits.").optional(),
|
|
474
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
475
|
-
created_at: external_exports.string().describe("The example creation timestamp.").optional()
|
|
476
|
-
}).describe("Input parameters for creating a LangSmith example.");
|
|
477
|
-
var createExampleOutput = external_exports.strictObject({
|
|
478
|
-
example: external_exports.strictObject({
|
|
479
|
-
id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
480
|
-
dataset_id: external_exports.uuid().describe("The LangSmith UUID.").optional(),
|
|
481
|
-
name: external_exports.string().describe("The example name when returned.").nullable().optional(),
|
|
482
|
-
created_at: external_exports.string().describe("The example creation timestamp when returned.").nullable().optional(),
|
|
483
|
-
modified_at: external_exports.string().describe("The example modification timestamp when returned.").nullable().optional(),
|
|
484
|
-
inputs: external_exports.looseObject({}).describe("The example input values.").optional(),
|
|
485
|
-
outputs: external_exports.looseObject({}).describe("A JSON object forwarded to or returned by LangSmith.").nullable().optional(),
|
|
486
|
-
metadata: external_exports.looseObject({}).describe("Provider-defined metadata forwarded to LangSmith.").nullable().optional(),
|
|
487
|
-
raw: external_exports.looseObject({}).describe("The raw example object returned by LangSmith.").optional()
|
|
488
|
-
}).describe("A LangSmith dataset example.").optional()
|
|
489
|
-
}).describe("The response returned when creating a LangSmith example.");
|
|
490
|
-
var langsmithActions = {
|
|
491
|
-
list_workspaces: {
|
|
492
|
-
description: "List LangSmith workspaces visible to the connected API key.",
|
|
493
|
-
effect: "read",
|
|
494
|
-
inputSchema: listWorkspacesInput,
|
|
495
|
-
outputSchema: external_exports.toJSONSchema(listWorkspacesOutput, { io: "output", unrepresentable: "any" })
|
|
496
|
-
},
|
|
497
|
-
list_projects: {
|
|
498
|
-
description: "List LangSmith tracing projects with optional name and pagination filters.",
|
|
499
|
-
effect: "read",
|
|
500
|
-
inputSchema: listProjectsInput,
|
|
501
|
-
outputSchema: external_exports.toJSONSchema(listProjectsOutput, { io: "output", unrepresentable: "any" })
|
|
502
|
-
},
|
|
503
|
-
get_project: {
|
|
504
|
-
description: "Get a LangSmith tracing project by ID.",
|
|
505
|
-
effect: "read",
|
|
506
|
-
inputSchema: getProjectInput,
|
|
507
|
-
outputSchema: external_exports.toJSONSchema(getProjectOutput, { io: "output", unrepresentable: "any" })
|
|
508
|
-
},
|
|
509
|
-
create_project: {
|
|
510
|
-
description: "Create a LangSmith tracing project.",
|
|
511
|
-
effect: "write",
|
|
512
|
-
inputSchema: createProjectInput,
|
|
513
|
-
outputSchema: external_exports.toJSONSchema(createProjectOutput, { io: "output", unrepresentable: "any" })
|
|
514
|
-
},
|
|
515
|
-
list_datasets: {
|
|
516
|
-
description: "List LangSmith datasets with optional name, type, and pagination filters.",
|
|
517
|
-
effect: "read",
|
|
518
|
-
inputSchema: listDatasetsInput,
|
|
519
|
-
outputSchema: external_exports.toJSONSchema(listDatasetsOutput, { io: "output", unrepresentable: "any" })
|
|
520
|
-
},
|
|
521
|
-
get_dataset: {
|
|
522
|
-
description: "Get a LangSmith dataset by ID.",
|
|
523
|
-
effect: "read",
|
|
524
|
-
inputSchema: getDatasetInput,
|
|
525
|
-
outputSchema: external_exports.toJSONSchema(getDatasetOutput, { io: "output", unrepresentable: "any" })
|
|
526
|
-
},
|
|
527
|
-
create_dataset: {
|
|
528
|
-
description: "Create a LangSmith dataset.",
|
|
529
|
-
effect: "write",
|
|
530
|
-
inputSchema: createDatasetInput,
|
|
531
|
-
outputSchema: external_exports.toJSONSchema(createDatasetOutput, { io: "output", unrepresentable: "any" })
|
|
532
|
-
},
|
|
533
|
-
list_examples: {
|
|
534
|
-
description: "List LangSmith dataset examples with optional dataset and text filters.",
|
|
535
|
-
effect: "read",
|
|
536
|
-
inputSchema: listExamplesInput,
|
|
537
|
-
outputSchema: external_exports.toJSONSchema(listExamplesOutput, { io: "output", unrepresentable: "any" })
|
|
538
|
-
},
|
|
539
|
-
get_example: {
|
|
540
|
-
description: "Get a LangSmith dataset example by ID.",
|
|
541
|
-
effect: "read",
|
|
542
|
-
inputSchema: getExampleInput,
|
|
543
|
-
outputSchema: external_exports.toJSONSchema(getExampleOutput, { io: "output", unrepresentable: "any" })
|
|
544
|
-
},
|
|
545
|
-
create_example: {
|
|
546
|
-
description: "Create a LangSmith dataset example with JSON inputs, outputs, and metadata.",
|
|
547
|
-
effect: "write",
|
|
548
|
-
inputSchema: createExampleInput,
|
|
549
|
-
outputSchema: external_exports.toJSONSchema(createExampleOutput, { io: "output", unrepresentable: "any" })
|
|
550
|
-
}
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
// ../plugins/src/langsmith/index.ts
|
|
554
|
-
function createLangsmithPlugin() {
|
|
555
|
-
return createProviderPlugin({
|
|
556
|
-
description: "LangSmith",
|
|
557
|
-
actions: langsmithActions,
|
|
558
|
-
// 上游 credentialValidators 就是打 /api/v1/workspaces 试凭证,这里对应到同一个 action:
|
|
559
|
-
// effect 是 read、入参全可选,满足探针的三个条件。
|
|
560
|
-
credentialProbe: "list_workspaces",
|
|
561
|
-
// 两者均非必配:region 缺省走 us,workspaceId 缺省用凭证的默认 workspace。
|
|
562
|
-
mountConfigFields: [
|
|
563
|
-
{
|
|
564
|
-
key: "region",
|
|
565
|
-
label: "\u533A\u57DF",
|
|
566
|
-
description: "us\u3001eu\u3001apac \u6216 aws_us \u4E4B\u4E00;\u7559\u7A7A\u7528 us"
|
|
567
|
-
},
|
|
568
|
-
{
|
|
569
|
-
key: "workspaceId",
|
|
570
|
-
label: "Workspace ID",
|
|
571
|
-
description: "\u9650\u5B9A\u5230\u67D0\u4E2A workspace;\u7559\u7A7A\u7528\u51ED\u8BC1\u7684\u9ED8\u8BA4 workspace"
|
|
572
|
-
}
|
|
573
|
-
],
|
|
574
|
-
handlers: {
|
|
575
|
-
list_workspaces: listWorkspaces,
|
|
576
|
-
list_projects: listProjects,
|
|
577
|
-
get_project: getProject,
|
|
578
|
-
create_project: createProject,
|
|
579
|
-
list_datasets: listDatasets,
|
|
580
|
-
get_dataset: getDataset,
|
|
581
|
-
create_dataset: createDataset,
|
|
582
|
-
list_examples: listExamples,
|
|
583
|
-
get_example: getExample,
|
|
584
|
-
create_example: createExample
|
|
585
|
-
}
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
|
-
var langsmith_default = createLangsmithPlugin();
|
|
589
|
-
export {
|
|
590
|
-
createLangsmithPlugin,
|
|
591
|
-
langsmith_default as default
|
|
592
|
-
};
|