@ai-setting/roy-agent-core 1.7.55 → 1.7.57
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/config/index.js +8 -8
- package/dist/env/agent/agent-component.d.ts +41 -0
- package/dist/env/agent/index.js +15 -14
- package/dist/env/commands/index.js +8 -8
- package/dist/env/context/index.js +4 -4
- package/dist/env/debug/index.js +8 -8
- package/dist/env/environment.d.ts +7 -0
- package/dist/env/event-source/event-source-handlers.d.ts +28 -0
- package/dist/env/event-source/index.js +18 -17
- package/dist/env/hook/index.js +6 -6
- package/dist/env/index.js +45 -43
- package/dist/env/llm/adapter-ai-sdk.d.ts +6 -0
- package/dist/env/llm/adapter-pi-ai.d.ts +5 -0
- package/dist/env/llm/index.js +11 -11
- package/dist/env/llm/invoke.d.ts +33 -1
- package/dist/env/llm/llm.d.ts +13 -0
- package/dist/env/llm/outbound-defense.d.ts +140 -0
- package/dist/env/log-trace/decorator.d.ts +46 -3
- package/dist/env/log-trace/index.d.ts +1 -0
- package/dist/env/log-trace/index.js +34 -8
- package/dist/env/log-trace/opentelemetry/tracer-provider.d.ts +86 -1
- package/dist/env/log-trace/trace-filters.d.ts +127 -0
- package/dist/env/mcp/index.js +9 -9
- package/dist/env/mcp/tool/index.js +2 -2
- package/dist/env/memory/index.js +9 -9
- package/dist/env/memory/plugin/index.js +2 -2
- package/dist/env/plugin/index.js +8 -8
- package/dist/env/prompt/index.js +8 -8
- package/dist/env/session/index.js +12 -11
- package/dist/env/session/session-component.d.ts +4 -0
- package/dist/env/session/storage/index.js +6 -4
- package/dist/env/skill/index.js +8 -8
- package/dist/env/task/delegate/index.js +9 -9
- package/dist/env/task/index.js +18 -17
- package/dist/env/task/plugins/index.js +11 -10
- package/dist/env/task/plugins/lark-card-patch-notifier.d.ts +109 -2
- package/dist/env/task/plugins/lark-card-state-store.d.ts +137 -0
- package/dist/env/task/plugins/lark-cli-task-notify-plugin.d.ts +154 -2
- package/dist/env/task/storage/index.js +4 -3
- package/dist/env/task/tools/index.js +4 -4
- package/dist/env/tool/built-in/index.js +5 -5
- package/dist/env/tool/index.js +12 -12
- package/dist/env/workflow/engine/index.js +13 -13
- package/dist/env/workflow/hooks/index.js +8 -8
- package/dist/env/workflow/index.js +24 -23
- package/dist/env/workflow/nodes/index.js +3 -3
- package/dist/env/workflow/plugins/index.js +9 -9
- package/dist/env/workflow/service/index.js +3 -3
- package/dist/env/workflow/storage/index.js +4 -4
- package/dist/env/workflow/tools/index.js +16 -15
- package/dist/env/workflow/utils/index.js +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +90 -63
- package/dist/shared/@ai-setting/{roy-agent-core-k25gv86p.js → roy-agent-core-029r8kdw.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-8s9jd2qy.js → roy-agent-core-08njdcpj.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-tdbv7ff4.js → roy-agent-core-0kn3zt1t.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-8eqngasy.js → roy-agent-core-0yn7a78e.js} +14 -14
- package/dist/shared/@ai-setting/{roy-agent-core-tbrn9wdm.js → roy-agent-core-14bq77wr.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-mxdc756a.js → roy-agent-core-1sfbs57v.js} +9 -9
- package/dist/shared/@ai-setting/{roy-agent-core-qamktze3.js → roy-agent-core-20m8je6e.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-yhsssn86.js → roy-agent-core-2ctyjy62.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9jzysq50.js → roy-agent-core-2fk8c9ax.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-2k4xffaa.js → roy-agent-core-4096f575.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-2gay3sjt.js → roy-agent-core-47s81t6g.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-w527pcpe.js → roy-agent-core-5f7myqnb.js} +45 -494
- package/dist/shared/@ai-setting/{roy-agent-core-zjttt2y4.js → roy-agent-core-7nb23tdd.js} +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-7q4wdze2.js +7 -0
- package/dist/shared/@ai-setting/{roy-agent-core-cd62e9p1.js → roy-agent-core-84rs0c8d.js} +23 -10
- package/dist/shared/@ai-setting/{roy-agent-core-dwx9hjwx.js → roy-agent-core-84xtww7d.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-a4vzsn0g.js → roy-agent-core-89sxsrc7.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-g36jevrk.js → roy-agent-core-8bngppw0.js} +580 -83
- package/dist/shared/@ai-setting/roy-agent-core-8p63s836.js +578 -0
- package/dist/shared/@ai-setting/{roy-agent-core-7evvpfwc.js → roy-agent-core-9zhkdg6w.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-ak4dc3kg.js → roy-agent-core-baaa4wtp.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-b5ew8t0k.js → roy-agent-core-c36335nw.js} +146 -8
- package/dist/shared/@ai-setting/{roy-agent-core-7qy3nffr.js → roy-agent-core-c7w2h47a.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-j5c3chtn.js → roy-agent-core-cyefe8z5.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-2bscfrr1.js → roy-agent-core-d75t8gea.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-0hq21px2.js → roy-agent-core-e1w17tht.js} +632 -36
- package/dist/shared/@ai-setting/{roy-agent-core-ne2t1pay.js → roy-agent-core-e250355z.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-ytr2w0vb.js → roy-agent-core-eanq305k.js} +69 -25
- package/dist/shared/@ai-setting/{roy-agent-core-12d2xap8.js → roy-agent-core-em4hks9t.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-6qxh4xrm.js → roy-agent-core-en2xqxs9.js} +7 -7
- package/dist/shared/@ai-setting/{roy-agent-core-e2z1etk4.js → roy-agent-core-ewcc5qdt.js} +11 -11
- package/dist/shared/@ai-setting/{roy-agent-core-qm9jda8p.js → roy-agent-core-fbjd7bt6.js} +3 -7
- package/dist/shared/@ai-setting/{roy-agent-core-fvs48d38.js → roy-agent-core-fw6k4w1h.js} +14 -9
- package/dist/shared/@ai-setting/{roy-agent-core-2b8jtv7m.js → roy-agent-core-ge87xbas.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9csa89jx.js → roy-agent-core-geh6j7bw.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-dv714bqh.js → roy-agent-core-gksw1gjb.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-fs36xgcs.js → roy-agent-core-hefarcp0.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-t37wbysj.js → roy-agent-core-hs41gx9w.js} +5 -5
- package/dist/shared/@ai-setting/{roy-agent-core-1cv9j4dg.js → roy-agent-core-jjhw9am6.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-978b6wfx.js → roy-agent-core-jjxdmedn.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-j2nvedt6.js → roy-agent-core-jw5ar4p0.js} +33 -38
- package/dist/shared/@ai-setting/{roy-agent-core-zvemdfx5.js → roy-agent-core-kq9pz2a7.js} +13 -6
- package/dist/shared/@ai-setting/{roy-agent-core-8t7wny6v.js → roy-agent-core-m68z3pw1.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-k8b440n3.js → roy-agent-core-m97jn2ra.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-kzg1jwt8.js → roy-agent-core-n0p0hwgd.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-9h72sk1n.js → roy-agent-core-psg6f1v6.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-athdr2m0.js → roy-agent-core-q4gdfypk.js} +12 -4
- package/dist/shared/@ai-setting/{roy-agent-core-nde5gzta.js → roy-agent-core-rcgvmtms.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-8seq65bp.js → roy-agent-core-rt115qfc.js} +44 -1
- package/dist/shared/@ai-setting/{roy-agent-core-5apmk4qw.js → roy-agent-core-syyw58p9.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-tjg71zqp.js → roy-agent-core-t4x089js.js} +1 -1
- package/dist/shared/@ai-setting/{roy-agent-core-zd3ddm4k.js → roy-agent-core-t64nmayv.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-6167phd4.js → roy-agent-core-txwptxk1.js} +4 -4
- package/dist/shared/@ai-setting/{roy-agent-core-rnwr39b0.js → roy-agent-core-tze5596n.js} +6 -4
- package/dist/shared/@ai-setting/{roy-agent-core-skzjs973.js → roy-agent-core-vath15kt.js} +6 -6
- package/dist/shared/@ai-setting/{roy-agent-core-vrsxhw9e.js → roy-agent-core-vgdhxbx3.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-7g03zkkb.js → roy-agent-core-vh0qzb24.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-aer5kw1j.js → roy-agent-core-w93z6a42.js} +17 -17
- package/dist/shared/@ai-setting/{roy-agent-core-rx16h2m1.js → roy-agent-core-ygn5tzt1.js} +3 -3
- package/dist/shared/@ai-setting/{roy-agent-core-4z3rq5gw.js → roy-agent-core-yphwdm9x.js} +2 -2
- package/dist/shared/@ai-setting/{roy-agent-core-qcspfszy.js → roy-agent-core-ytd5eztz.js} +1 -1
- package/dist/utils/temp-file-manager/index.js +2 -2
- package/package.json +1 -1
- package/dist/shared/@ai-setting/roy-agent-core-dsevjbck.js +0 -245
|
@@ -3,14 +3,10 @@ import {
|
|
|
3
3
|
parseJSONC
|
|
4
4
|
} from "./roy-agent-core-adg9ghbt.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./roy-agent-core-zjdzk1gg.js";
|
|
8
|
-
import {
|
|
9
|
-
buildOpencodeHeaders,
|
|
6
|
+
PiAiAdapter,
|
|
10
7
|
invoke,
|
|
11
|
-
invokeNonStream
|
|
12
|
-
|
|
13
|
-
} from "./roy-agent-core-0hq21px2.js";
|
|
8
|
+
invokeNonStream
|
|
9
|
+
} from "./roy-agent-core-e1w17tht.js";
|
|
14
10
|
import {
|
|
15
11
|
ContextError,
|
|
16
12
|
ErrorCodes
|
|
@@ -21,21 +17,26 @@ import {
|
|
|
21
17
|
} from "./roy-agent-core-7hh0brvs.js";
|
|
22
18
|
import {
|
|
23
19
|
BaseComponent
|
|
24
|
-
} from "./roy-agent-core-
|
|
20
|
+
} from "./roy-agent-core-0kn3zt1t.js";
|
|
25
21
|
import {
|
|
26
22
|
LLMHookPoints,
|
|
27
23
|
globalHookManager,
|
|
28
24
|
init_global_hook_manager
|
|
29
|
-
} from "./roy-agent-core-
|
|
25
|
+
} from "./roy-agent-core-yphwdm9x.js";
|
|
30
26
|
import {
|
|
31
27
|
TracedAs,
|
|
28
|
+
embedParamFilter,
|
|
29
|
+
embedResultFilter,
|
|
32
30
|
init_decorator,
|
|
31
|
+
init_trace_filters,
|
|
32
|
+
llmInvokeParamFilter,
|
|
33
|
+
llmInvokeResultFilter,
|
|
33
34
|
wrapFunction
|
|
34
|
-
} from "./roy-agent-core-
|
|
35
|
+
} from "./roy-agent-core-8p63s836.js";
|
|
35
36
|
import {
|
|
36
37
|
createLogger,
|
|
37
38
|
init_logger
|
|
38
|
-
} from "./roy-agent-core-
|
|
39
|
+
} from "./roy-agent-core-rt115qfc.js";
|
|
39
40
|
import {
|
|
40
41
|
__legacyDecorateClassTS,
|
|
41
42
|
__require
|
|
@@ -43,472 +44,9 @@ import {
|
|
|
43
44
|
|
|
44
45
|
// src/env/llm/adapter.ts
|
|
45
46
|
var ADAPTER_NAMES = ["pi-ai", "ai-sdk"];
|
|
46
|
-
// src/env/llm/adapter-pi-ai.ts
|
|
47
|
-
init_decorator();
|
|
48
|
-
init_logger();
|
|
49
|
-
import {
|
|
50
|
-
complete,
|
|
51
|
-
stream as piStream,
|
|
52
|
-
getModel
|
|
53
|
-
} from "@earendil-works/pi-ai";
|
|
54
|
-
|
|
55
|
-
// src/env/llm/reasoning-defense.ts
|
|
56
|
-
var DEEPSEEK_PROVIDER_PREFIX = "deepseek";
|
|
57
|
-
var DEEPSEEK_MODEL_MARKER = "deepseek";
|
|
58
|
-
function shouldInjectReasoningContent(provider, modelId) {
|
|
59
|
-
const p = (provider ?? "").toLowerCase();
|
|
60
|
-
const m = (modelId ?? "").toLowerCase();
|
|
61
|
-
if (p === DEEPSEEK_PROVIDER_PREFIX || p.startsWith(`${DEEPSEEK_PROVIDER_PREFIX}-`)) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
return m.includes(DEEPSEEK_MODEL_MARKER);
|
|
65
|
-
}
|
|
66
|
-
function injectReasoningContent(messages) {
|
|
67
|
-
return messages.map((msg) => {
|
|
68
|
-
if (msg?.role !== "assistant")
|
|
69
|
-
return msg;
|
|
70
|
-
if ("reasoning_content" in msg)
|
|
71
|
-
return msg;
|
|
72
|
-
return { ...msg, reasoning_content: "" };
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function applyReasoningDefense(payload, target) {
|
|
76
|
-
if (!payload || typeof payload !== "object")
|
|
77
|
-
return payload;
|
|
78
|
-
if (!shouldInjectReasoningContent(target.provider, target.modelId))
|
|
79
|
-
return payload;
|
|
80
|
-
const messages = payload.messages;
|
|
81
|
-
if (!Array.isArray(messages))
|
|
82
|
-
return payload;
|
|
83
|
-
return { ...payload, messages: injectReasoningContent(messages) };
|
|
84
|
-
}
|
|
85
|
-
function createReasoningDefenseHook(target) {
|
|
86
|
-
return (payload) => applyReasoningDefense(payload, target);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// src/env/llm/adapter-pi-ai.ts
|
|
90
|
-
var logger = createLogger("llm:adapter-pi-ai");
|
|
91
|
-
var KNOWN_PROVIDER_APIS = {
|
|
92
|
-
anthropic: {
|
|
93
|
-
api: "anthropic-messages",
|
|
94
|
-
apiProtocol: "anthropic-messages",
|
|
95
|
-
contextLimit: 200000,
|
|
96
|
-
maxTokensLimit: 8192
|
|
97
|
-
},
|
|
98
|
-
openai: {
|
|
99
|
-
api: "openai-responses",
|
|
100
|
-
apiProtocol: "openai-responses",
|
|
101
|
-
contextLimit: 128000,
|
|
102
|
-
maxTokensLimit: 16384
|
|
103
|
-
},
|
|
104
|
-
google: {
|
|
105
|
-
api: "google-generative-ai",
|
|
106
|
-
apiProtocol: "google-generative-ai",
|
|
107
|
-
contextLimit: 1e6,
|
|
108
|
-
maxTokensLimit: 8192
|
|
109
|
-
},
|
|
110
|
-
"google-vertex": {
|
|
111
|
-
api: "google-vertex",
|
|
112
|
-
apiProtocol: "google-vertex",
|
|
113
|
-
contextLimit: 1e6,
|
|
114
|
-
maxTokensLimit: 8192
|
|
115
|
-
},
|
|
116
|
-
deepseek: {
|
|
117
|
-
api: "openai-completions",
|
|
118
|
-
apiProtocol: "openai-completions",
|
|
119
|
-
contextLimit: 64000,
|
|
120
|
-
maxTokensLimit: 8192
|
|
121
|
-
},
|
|
122
|
-
glm: {
|
|
123
|
-
api: "openai-completions",
|
|
124
|
-
apiProtocol: "openai-completions",
|
|
125
|
-
contextLimit: 128000,
|
|
126
|
-
maxTokensLimit: 8192
|
|
127
|
-
},
|
|
128
|
-
xai: {
|
|
129
|
-
api: "openai-completions",
|
|
130
|
-
apiProtocol: "openai-completions",
|
|
131
|
-
contextLimit: 131072,
|
|
132
|
-
maxTokensLimit: 8192
|
|
133
|
-
},
|
|
134
|
-
groq: {
|
|
135
|
-
api: "openai-completions",
|
|
136
|
-
apiProtocol: "openai-completions",
|
|
137
|
-
contextLimit: 32768,
|
|
138
|
-
maxTokensLimit: 8192
|
|
139
|
-
},
|
|
140
|
-
minimax: {
|
|
141
|
-
api: "anthropic-messages",
|
|
142
|
-
apiProtocol: "anthropic-messages",
|
|
143
|
-
contextLimit: 128000,
|
|
144
|
-
maxTokensLimit: 8192
|
|
145
|
-
},
|
|
146
|
-
"minimax-cn": {
|
|
147
|
-
api: "anthropic-messages",
|
|
148
|
-
apiProtocol: "anthropic-messages",
|
|
149
|
-
contextLimit: 128000,
|
|
150
|
-
maxTokensLimit: 8192
|
|
151
|
-
},
|
|
152
|
-
moonshotai: {
|
|
153
|
-
api: "openai-completions",
|
|
154
|
-
apiProtocol: "openai-completions",
|
|
155
|
-
contextLimit: 128000,
|
|
156
|
-
maxTokensLimit: 8192
|
|
157
|
-
},
|
|
158
|
-
"kimi-coding": {
|
|
159
|
-
api: "openai-completions",
|
|
160
|
-
apiProtocol: "openai-completions",
|
|
161
|
-
contextLimit: 128000,
|
|
162
|
-
maxTokensLimit: 8192
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
var PROVIDER_ENDPOINT_APIS = {
|
|
166
|
-
minimax: [
|
|
167
|
-
{ pathIncludes: "/anthropic", apiProtocol: "anthropic-messages" },
|
|
168
|
-
{ pathIncludes: "/v1", apiProtocol: "openai-completions" }
|
|
169
|
-
],
|
|
170
|
-
"minimax-cn": [
|
|
171
|
-
{ pathIncludes: "/anthropic", apiProtocol: "anthropic-messages" },
|
|
172
|
-
{ pathIncludes: "/v1", apiProtocol: "openai-completions" }
|
|
173
|
-
]
|
|
174
|
-
};
|
|
175
|
-
var ENDPOINT_RULES_SORTED = Object.fromEntries(Object.entries(PROVIDER_ENDPOINT_APIS).map(([provider, rules]) => [
|
|
176
|
-
provider,
|
|
177
|
-
[...rules].sort((a, b) => b.pathIncludes.length - a.pathIncludes.length)
|
|
178
|
-
]));
|
|
179
|
-
var PROVIDER_API_OVERRIDES = {
|
|
180
|
-
"minimax-responses": "openai-responses",
|
|
181
|
-
"minimax-openai": "openai-completions"
|
|
182
|
-
};
|
|
183
|
-
function resolveApiProtocol(provider, baseURL, explicitProtocol) {
|
|
184
|
-
if (explicitProtocol)
|
|
185
|
-
return explicitProtocol;
|
|
186
|
-
if (PROVIDER_API_OVERRIDES[provider])
|
|
187
|
-
return PROVIDER_API_OVERRIDES[provider];
|
|
188
|
-
const endpointRules = ENDPOINT_RULES_SORTED[provider];
|
|
189
|
-
if (endpointRules) {
|
|
190
|
-
for (const rule of endpointRules) {
|
|
191
|
-
if (baseURL?.includes(rule.pathIncludes))
|
|
192
|
-
return rule.apiProtocol;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const declared = KNOWN_PROVIDER_APIS[provider]?.apiProtocol;
|
|
196
|
-
if (declared)
|
|
197
|
-
return declared;
|
|
198
|
-
if (baseURL?.includes("/responses"))
|
|
199
|
-
return "openai-responses";
|
|
200
|
-
if (baseURL?.includes("anthropic")) {
|
|
201
|
-
logger.warn(`[adapter-pi-ai] provider "${provider}" 的协议靠 baseURL 含 "anthropic" 推断为 anthropic-messages;` + `建议在 KNOWN_PROVIDER_APIS 或调用处显式声明 apiProtocol(Task #4383 P1)`, { provider, inferred_api_protocol: "anthropic-messages", base_url: baseURL });
|
|
202
|
-
return "anthropic-messages";
|
|
203
|
-
}
|
|
204
|
-
return KNOWN_PROVIDER_APIS[provider]?.api || "openai-completions";
|
|
205
|
-
}
|
|
206
|
-
var REASONING_COMPAT_PIN = {
|
|
207
|
-
supportsDeveloperRole: false,
|
|
208
|
-
thinkingFormat: "openai",
|
|
209
|
-
supportsReasoningEffort: false
|
|
210
|
-
};
|
|
211
|
-
var REASONING_SAFE_PROTOCOLS = new Set([
|
|
212
|
-
"openai-completions",
|
|
213
|
-
"anthropic-messages"
|
|
214
|
-
]);
|
|
215
|
-
var warnedReasoningRefusals = new Set;
|
|
216
|
-
function resolveModelReasoning(provider, modelId, capabilities, apiProtocol) {
|
|
217
|
-
const requested = capabilities?.reasoning === true;
|
|
218
|
-
if (!requested)
|
|
219
|
-
return false;
|
|
220
|
-
if (!apiProtocol || !REASONING_SAFE_PROTOCOLS.has(apiProtocol)) {
|
|
221
|
-
const key = `${provider}:${apiProtocol ?? "<unresolved>"}`;
|
|
222
|
-
if (!warnedReasoningRefusals.has(key)) {
|
|
223
|
-
warnedReasoningRefusals.add(key);
|
|
224
|
-
logger.warn(`[adapter-pi-ai] provider "${provider}" (${apiProtocol ?? "unresolved"}) 的 capabilities.reasoning=true 被忽略:` + `该协议无法通过 compat pin 保持请求体字节一致,打开会破坏 prompt cache 前缀(Task #4403)`, { provider, model_id: modelId, api_protocol: apiProtocol });
|
|
225
|
-
}
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
function buildPiCacheOptions(args) {
|
|
231
|
-
const out = {};
|
|
232
|
-
if (args.sessionId)
|
|
233
|
-
out.sessionId = args.sessionId;
|
|
234
|
-
if (args.apiProtocol === "openai-completions") {
|
|
235
|
-
out.cacheRetention = args.cacheRetention ?? "long";
|
|
236
|
-
} else if (args.cacheRetention) {
|
|
237
|
-
out.cacheRetention = args.cacheRetention;
|
|
238
|
-
}
|
|
239
|
-
return out;
|
|
240
|
-
}
|
|
241
|
-
function resolvePiModel(provider, modelId, baseURL, capabilities) {
|
|
242
|
-
const builtIn = getModel(provider, modelId);
|
|
243
|
-
if (builtIn)
|
|
244
|
-
return baseURL ? { ...builtIn, baseUrl: baseURL } : builtIn;
|
|
245
|
-
const configuredApi = resolveApiProtocol(provider, baseURL);
|
|
246
|
-
const reasoning = resolveModelReasoning(provider, modelId, capabilities, configuredApi);
|
|
247
|
-
return {
|
|
248
|
-
id: modelId,
|
|
249
|
-
name: modelId,
|
|
250
|
-
api: configuredApi,
|
|
251
|
-
provider,
|
|
252
|
-
baseUrl: baseURL || "",
|
|
253
|
-
reasoning,
|
|
254
|
-
...reasoning ? { compat: { ...REASONING_COMPAT_PIN } } : {},
|
|
255
|
-
input: ["text", "image"],
|
|
256
|
-
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
257
|
-
contextWindow: KNOWN_PROVIDER_APIS[provider]?.contextLimit || 128000,
|
|
258
|
-
maxTokens: KNOWN_PROVIDER_APIS[provider]?.maxTokensLimit || 8192
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
function toPiMessages(messages) {
|
|
262
|
-
const out = [];
|
|
263
|
-
const ts = Date.now();
|
|
264
|
-
for (const m of messages) {
|
|
265
|
-
if (m.role === "system")
|
|
266
|
-
continue;
|
|
267
|
-
if (m.role === "user") {
|
|
268
|
-
if (typeof m.content === "string") {
|
|
269
|
-
out.push({ role: "user", content: m.content, timestamp: ts });
|
|
270
|
-
} else {
|
|
271
|
-
out.push({ role: "user", content: m.content.flatMap((c) => {
|
|
272
|
-
if (c.type === "text")
|
|
273
|
-
return [{ type: "text", text: c.text }];
|
|
274
|
-
if (c.type === "image")
|
|
275
|
-
return [{ type: "image", data: c.image instanceof Uint8Array ? Buffer.from(c.image).toString("base64") : c.image, mimeType: sniffImageMime(c.image, c.mediaType) }];
|
|
276
|
-
return [{ type: "text", text: `[file:${c.mediaType}] ${typeof c.file === "string" ? c.file : Buffer.from(c.file).toString("base64")}` }];
|
|
277
|
-
}), timestamp: ts });
|
|
278
|
-
}
|
|
279
|
-
continue;
|
|
280
|
-
}
|
|
281
|
-
if (m.role === "tool") {
|
|
282
|
-
out.push({ role: "toolResult", toolCallId: m.toolCallId || "", toolName: m.name || "", content: [{ type: "text", text: typeof m.content === "string" ? m.content : JSON.stringify(m.content) }], isError: false, timestamp: ts });
|
|
283
|
-
continue;
|
|
284
|
-
}
|
|
285
|
-
const content = [];
|
|
286
|
-
if (typeof m.content === "string" && m.content)
|
|
287
|
-
content.push({ type: "text", text: m.content });
|
|
288
|
-
else if (Array.isArray(m.content))
|
|
289
|
-
for (const c of m.content) {
|
|
290
|
-
if (c.type === "text")
|
|
291
|
-
content.push({ type: "text", text: c.text });
|
|
292
|
-
else if (c.type === "image")
|
|
293
|
-
content.push({ type: "image", data: c.image instanceof Uint8Array ? Buffer.from(c.image).toString("base64") : c.image, mimeType: sniffImageMime(c.image, c.mediaType) });
|
|
294
|
-
else
|
|
295
|
-
content.push({ type: "text", text: `[file:${c.mediaType}] ${typeof c.file === "string" ? c.file : Buffer.from(c.file).toString("base64")}` });
|
|
296
|
-
}
|
|
297
|
-
for (const tc of m.toolCalls || [])
|
|
298
|
-
content.push({ type: "toolCall", id: tc.id, name: tc.name, arguments: safeJson(tc.arguments) });
|
|
299
|
-
out.push({ role: "assistant", content, api: "openai-completions", model: "", provider: "", usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, totalTokens: 0, cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 } }, stopReason: "stop", timestamp: ts });
|
|
300
|
-
}
|
|
301
|
-
return out;
|
|
302
|
-
}
|
|
303
|
-
function extractSystemPrompt(messages) {
|
|
304
|
-
const prompts = messages.filter((m) => m.role === "system").map((m) => typeof m.content === "string" ? m.content : m.content.filter((c) => c.type === "text").map((c) => c.text).join(""));
|
|
305
|
-
return prompts.length ? prompts.join(`
|
|
306
|
-
|
|
307
|
-
`) : undefined;
|
|
308
|
-
}
|
|
309
|
-
function safeJson(s) {
|
|
310
|
-
try {
|
|
311
|
-
return JSON.parse(s);
|
|
312
|
-
} catch (e) {
|
|
313
|
-
logger.warn(`[safeJson] JSON.parse failed`, {
|
|
314
|
-
parse_failed: true,
|
|
315
|
-
input_length: s.length,
|
|
316
|
-
error: e.message
|
|
317
|
-
});
|
|
318
|
-
return {};
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
function convertToolParameters(parameters) {
|
|
322
|
-
return toolParametersToJsonSchema(parameters);
|
|
323
|
-
}
|
|
324
|
-
function toPiTools(tools) {
|
|
325
|
-
if (!tools)
|
|
326
|
-
return;
|
|
327
|
-
return tools.map((t) => ({
|
|
328
|
-
name: t.name,
|
|
329
|
-
description: t.description || "",
|
|
330
|
-
parameters: convertToolParameters(t.parameters)
|
|
331
|
-
}));
|
|
332
|
-
}
|
|
333
|
-
function piRequestExtras(req) {
|
|
334
|
-
const headers = buildOpencodeHeaders(req.provider, req.sessionId, req.baseURL);
|
|
335
|
-
return Object.keys(headers).length > 0 ? { headers } : {};
|
|
336
|
-
}
|
|
337
|
-
function fromAssistantMessage(msg) {
|
|
338
|
-
let text = "";
|
|
339
|
-
const toolCalls = [];
|
|
340
|
-
for (const block of msg.content) {
|
|
341
|
-
const b = block;
|
|
342
|
-
if (b.type === "text") {
|
|
343
|
-
text += b.text || "";
|
|
344
|
-
} else if (b.type === "toolCall") {
|
|
345
|
-
toolCalls.push({
|
|
346
|
-
id: b.id || "",
|
|
347
|
-
name: b.name || "",
|
|
348
|
-
arguments: typeof b.arguments === "string" ? b.arguments : JSON.stringify(b.arguments ?? {})
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return {
|
|
353
|
-
text,
|
|
354
|
-
finishReason: msg.stopReason || "stop",
|
|
355
|
-
toolCalls: toolCalls.length ? toolCalls : undefined,
|
|
356
|
-
usage: {
|
|
357
|
-
promptTokens: msg.usage?.input ?? 0,
|
|
358
|
-
completionTokens: msg.usage?.output ?? 0,
|
|
359
|
-
totalTokens: msg.usage?.totalTokens ?? 0,
|
|
360
|
-
cacheRead: msg.usage?.cacheRead,
|
|
361
|
-
cacheWrite: msg.usage?.cacheWrite
|
|
362
|
-
},
|
|
363
|
-
raw: msg
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
class EmbeddingNotSupportedError extends Error {
|
|
368
|
-
constructor(adapter) {
|
|
369
|
-
super(`Embedding is not supported by ${adapter}; use AiSdkAdapter.embed() or apply at higher layer.`);
|
|
370
|
-
this.name = "EmbeddingNotSupportedError";
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
class PiAiAdapter {
|
|
375
|
-
name = "pi-ai";
|
|
376
|
-
async chat(req) {
|
|
377
|
-
const model = resolvePiModel(req.provider, req.modelId, req.baseURL, req.capabilities);
|
|
378
|
-
const ctx = {
|
|
379
|
-
systemPrompt: [req.systemPrompt, extractSystemPrompt(req.messages)].filter(Boolean).join(`
|
|
380
|
-
|
|
381
|
-
`) || undefined,
|
|
382
|
-
messages: toPiMessages(req.messages),
|
|
383
|
-
tools: toPiTools(req.tools)
|
|
384
|
-
};
|
|
385
|
-
const msg = await complete(model, ctx, {
|
|
386
|
-
apiKey: req.apiKey,
|
|
387
|
-
baseURL: req.baseURL,
|
|
388
|
-
temperature: req.temperature,
|
|
389
|
-
maxTokens: req.maxTokens,
|
|
390
|
-
signal: req.signal,
|
|
391
|
-
...buildPiCacheOptions({
|
|
392
|
-
apiProtocol: model.api,
|
|
393
|
-
sessionId: req.sessionId,
|
|
394
|
-
cacheRetention: req.cacheRetention
|
|
395
|
-
}),
|
|
396
|
-
onPayload: createReasoningDefenseHook({
|
|
397
|
-
provider: req.provider,
|
|
398
|
-
modelId: req.modelId
|
|
399
|
-
}),
|
|
400
|
-
...piRequestExtras(req)
|
|
401
|
-
});
|
|
402
|
-
return fromAssistantMessage(msg);
|
|
403
|
-
}
|
|
404
|
-
async stream(req) {
|
|
405
|
-
const model = resolvePiModel(req.provider, req.modelId, req.baseURL, req.capabilities);
|
|
406
|
-
const ctx = {
|
|
407
|
-
systemPrompt: [req.systemPrompt, extractSystemPrompt(req.messages)].filter(Boolean).join(`
|
|
408
|
-
|
|
409
|
-
`) || undefined,
|
|
410
|
-
messages: toPiMessages(req.messages),
|
|
411
|
-
tools: toPiTools(req.tools)
|
|
412
|
-
};
|
|
413
|
-
const eventStream = piStream(model, ctx, {
|
|
414
|
-
apiKey: req.apiKey,
|
|
415
|
-
baseURL: req.baseURL,
|
|
416
|
-
temperature: req.temperature,
|
|
417
|
-
maxTokens: req.maxTokens,
|
|
418
|
-
signal: req.signal,
|
|
419
|
-
...buildPiCacheOptions({
|
|
420
|
-
apiProtocol: model.api,
|
|
421
|
-
sessionId: req.sessionId,
|
|
422
|
-
cacheRetention: req.cacheRetention
|
|
423
|
-
}),
|
|
424
|
-
onPayload: createReasoningDefenseHook({
|
|
425
|
-
provider: req.provider,
|
|
426
|
-
modelId: req.modelId
|
|
427
|
-
}),
|
|
428
|
-
...piRequestExtras(req)
|
|
429
|
-
});
|
|
430
|
-
return { events: eventStream, result: async () => fromAssistantMessage(await eventStream.result()) };
|
|
431
|
-
}
|
|
432
|
-
async embed(_req) {
|
|
433
|
-
throw new EmbeddingNotSupportedError(this.name);
|
|
434
|
-
}
|
|
435
|
-
async resolveProvider(provider, modelId) {
|
|
436
|
-
const model = resolvePiModel(provider, modelId);
|
|
437
|
-
const caps = KNOWN_PROVIDER_APIS[provider] || {
|
|
438
|
-
api: model.api,
|
|
439
|
-
contextLimit: model.contextWindow,
|
|
440
|
-
maxTokensLimit: model.maxTokens
|
|
441
|
-
};
|
|
442
|
-
return {
|
|
443
|
-
api: model.api,
|
|
444
|
-
provider,
|
|
445
|
-
modelId,
|
|
446
|
-
contextLimit: caps.contextLimit,
|
|
447
|
-
maxTokensLimit: caps.maxTokensLimit
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
__legacyDecorateClassTS([
|
|
452
|
-
TracedAs("llm.adapter.chat", {
|
|
453
|
-
recordParams: true,
|
|
454
|
-
recordResult: true,
|
|
455
|
-
log: true,
|
|
456
|
-
paramFilter: (args) => {
|
|
457
|
-
const req = args[0];
|
|
458
|
-
return {
|
|
459
|
-
provider: req?.provider,
|
|
460
|
-
model_id: req?.modelId,
|
|
461
|
-
messages_count: req?.messages?.length,
|
|
462
|
-
tools_count: req?.tools?.length,
|
|
463
|
-
temperature: req?.temperature,
|
|
464
|
-
max_tokens: req?.maxTokens
|
|
465
|
-
};
|
|
466
|
-
},
|
|
467
|
-
resultFilter: (r) => ({
|
|
468
|
-
finish_reason: r?.finishReason,
|
|
469
|
-
usage_input: r?.usage?.promptTokens,
|
|
470
|
-
usage_output: r?.usage?.completionTokens,
|
|
471
|
-
usage_total: r?.usage?.totalTokens,
|
|
472
|
-
content_length: r?.text?.length
|
|
473
|
-
})
|
|
474
|
-
})
|
|
475
|
-
], PiAiAdapter.prototype, "chat", null);
|
|
476
|
-
__legacyDecorateClassTS([
|
|
477
|
-
TracedAs("llm.adapter.stream", {
|
|
478
|
-
recordParams: true,
|
|
479
|
-
recordResult: false,
|
|
480
|
-
log: true,
|
|
481
|
-
paramFilter: (args) => {
|
|
482
|
-
const req = args[0];
|
|
483
|
-
return {
|
|
484
|
-
provider: req?.provider,
|
|
485
|
-
model_id: req?.modelId,
|
|
486
|
-
messages_count: req?.messages?.length
|
|
487
|
-
};
|
|
488
|
-
}
|
|
489
|
-
})
|
|
490
|
-
], PiAiAdapter.prototype, "stream", null);
|
|
491
|
-
__legacyDecorateClassTS([
|
|
492
|
-
TracedAs("llm.adapter.embed", { recordParams: true, recordResult: false, log: true })
|
|
493
|
-
], PiAiAdapter.prototype, "embed", null);
|
|
494
|
-
__legacyDecorateClassTS([
|
|
495
|
-
TracedAs("llm.adapter.resolve_provider", {
|
|
496
|
-
recordParams: true,
|
|
497
|
-
recordResult: true,
|
|
498
|
-
log: true,
|
|
499
|
-
paramFilter: (args) => ({
|
|
500
|
-
provider: args[0],
|
|
501
|
-
model_id: args[1]
|
|
502
|
-
}),
|
|
503
|
-
resultFilter: (r) => ({
|
|
504
|
-
api: r?.api,
|
|
505
|
-
context_limit: r?.contextLimit,
|
|
506
|
-
max_tokens_limit: r?.maxTokensLimit
|
|
507
|
-
})
|
|
508
|
-
})
|
|
509
|
-
], PiAiAdapter.prototype, "resolveProvider", null);
|
|
510
47
|
// src/env/llm/adapter-ai-sdk.ts
|
|
511
48
|
init_decorator();
|
|
49
|
+
init_trace_filters();
|
|
512
50
|
import { embed as aiEmbed, embedMany as aiEmbedMany } from "ai";
|
|
513
51
|
class AiSdkAdapter {
|
|
514
52
|
name = "ai-sdk";
|
|
@@ -616,7 +154,12 @@ __legacyDecorateClassTS([
|
|
|
616
154
|
})
|
|
617
155
|
], AiSdkAdapter.prototype, "stream", null);
|
|
618
156
|
__legacyDecorateClassTS([
|
|
619
|
-
TracedAs("llm.adapter.ai_sdk.embed", {
|
|
157
|
+
TracedAs("llm.adapter.ai_sdk.embed", {
|
|
158
|
+
paramFilter: embedParamFilter,
|
|
159
|
+
resultFilter: embedResultFilter,
|
|
160
|
+
recordResult: false,
|
|
161
|
+
log: true
|
|
162
|
+
})
|
|
620
163
|
], AiSdkAdapter.prototype, "embed", null);
|
|
621
164
|
__legacyDecorateClassTS([
|
|
622
165
|
TracedAs("llm.adapter.ai_sdk.resolve_provider", {
|
|
@@ -1073,11 +616,12 @@ class LLMHooks {
|
|
|
1073
616
|
// src/env/llm/llm.ts
|
|
1074
617
|
init_logger();
|
|
1075
618
|
init_decorator();
|
|
619
|
+
init_trace_filters();
|
|
1076
620
|
import { randomUUID } from "crypto";
|
|
1077
621
|
import * as fs from "node:fs/promises";
|
|
1078
622
|
import * as os from "node:os";
|
|
1079
623
|
import * as path from "node:path";
|
|
1080
|
-
var
|
|
624
|
+
var logger = createLogger("llm");
|
|
1081
625
|
function normalizeUsage(usage) {
|
|
1082
626
|
if (!usage)
|
|
1083
627
|
return;
|
|
@@ -1253,7 +797,7 @@ class LLMComponent extends BaseComponent {
|
|
|
1253
797
|
componentName: "llm",
|
|
1254
798
|
knownKeys,
|
|
1255
799
|
logger: {
|
|
1256
|
-
warn: (msg) =>
|
|
800
|
+
warn: (msg) => logger.warn(msg)
|
|
1257
801
|
}
|
|
1258
802
|
});
|
|
1259
803
|
}
|
|
@@ -1287,24 +831,24 @@ class LLMComponent extends BaseComponent {
|
|
|
1287
831
|
}
|
|
1288
832
|
registerConfigWatcher(configComponent) {
|
|
1289
833
|
if (typeof configComponent.watch !== "function") {
|
|
1290
|
-
|
|
834
|
+
logger.debug("ConfigComponent does not support watch, hot reload disabled");
|
|
1291
835
|
return;
|
|
1292
836
|
}
|
|
1293
837
|
this.configWatcher = configComponent.watch("llm.*", (event) => {
|
|
1294
838
|
this.onConfigChange(event);
|
|
1295
839
|
});
|
|
1296
|
-
|
|
840
|
+
logger.debug("Config hot reload watcher registered for llm.*");
|
|
1297
841
|
}
|
|
1298
842
|
onConfigChange(event) {
|
|
1299
|
-
|
|
843
|
+
logger.info(`LLM config changed: ${event.key}`);
|
|
1300
844
|
if (event.key === "llm.providers" || event.key.startsWith("llm.providers.")) {
|
|
1301
|
-
|
|
845
|
+
logger.info(`LLM provider config changed, will use new config on next call`);
|
|
1302
846
|
} else if (event.key === "llm.defaultModel") {
|
|
1303
|
-
|
|
847
|
+
logger.info(`LLM default model changed to: ${event.newValue}`);
|
|
1304
848
|
} else if (event.key === "llm.defaultProvider") {
|
|
1305
|
-
|
|
849
|
+
logger.info(`LLM default provider changed to: ${event.newValue}`);
|
|
1306
850
|
} else {
|
|
1307
|
-
|
|
851
|
+
logger.debug(`LLM config updated: ${event.key}`);
|
|
1308
852
|
}
|
|
1309
853
|
}
|
|
1310
854
|
async onStart() {
|
|
@@ -1420,7 +964,8 @@ class LLMComponent extends BaseComponent {
|
|
|
1420
964
|
baseURL: ctx.invokeConfig.baseURL,
|
|
1421
965
|
signal: ctx.abortSignal,
|
|
1422
966
|
sessionId: request.context?.sessionId,
|
|
1423
|
-
capabilities: ctx.invokeConfig.capabilities
|
|
967
|
+
capabilities: ctx.invokeConfig.capabilities,
|
|
968
|
+
cacheRetention: request.cacheRetention
|
|
1424
969
|
};
|
|
1425
970
|
let output = {
|
|
1426
971
|
content: "",
|
|
@@ -1436,7 +981,7 @@ class LLMComponent extends BaseComponent {
|
|
|
1436
981
|
throw new Error(resp.raw?.errorMessage || "adapter returned an error response");
|
|
1437
982
|
}
|
|
1438
983
|
} catch (adapterErr) {
|
|
1439
|
-
|
|
984
|
+
logger.warn(`[LLMComponent.invoke] adapter(${adapter.name}) failed, falling back to AI SDK invoke: ${adapterErr.message}`);
|
|
1440
985
|
let fallbackInvokeConfig = ctx.invokeConfig;
|
|
1441
986
|
try {
|
|
1442
987
|
const fallback = await resolveFallbackProviderConfig(ctx.providerId);
|
|
@@ -1445,9 +990,9 @@ class LLMComponent extends BaseComponent {
|
|
|
1445
990
|
apiKey: fallback.apiKey,
|
|
1446
991
|
baseURL: fallback.baseURL
|
|
1447
992
|
};
|
|
1448
|
-
|
|
993
|
+
logger.warn(`[LLMComponent.invoke] fallback re-resolved baseURL from auth.json: ${fallback.baseURL}`);
|
|
1449
994
|
} catch (configErr) {
|
|
1450
|
-
|
|
995
|
+
logger.warn(`[LLMComponent.invoke] resolveFallbackProviderConfig failed, using ctx.invokeConfig as-is: ${configErr.message}`);
|
|
1451
996
|
}
|
|
1452
997
|
const result = await invoke(fallbackInvokeConfig, {
|
|
1453
998
|
messages: ctx.messages,
|
|
@@ -1460,7 +1005,8 @@ class LLMComponent extends BaseComponent {
|
|
|
1460
1005
|
sessionId: request.context?.sessionId,
|
|
1461
1006
|
messageId: request.context?.messageId
|
|
1462
1007
|
},
|
|
1463
|
-
toolChoice: request.toolChoice
|
|
1008
|
+
toolChoice: request.toolChoice,
|
|
1009
|
+
cacheRetention: chatReq.cacheRetention
|
|
1464
1010
|
}, { abort: ctx.abortSignal });
|
|
1465
1011
|
if (result.isError) {
|
|
1466
1012
|
throw new Error(result.result);
|
|
@@ -1517,7 +1063,7 @@ class LLMComponent extends BaseComponent {
|
|
|
1517
1063
|
payload
|
|
1518
1064
|
});
|
|
1519
1065
|
} catch (err) {
|
|
1520
|
-
|
|
1066
|
+
logger.warn(`Failed to push env event ${fullType}`, { error: String(err) });
|
|
1521
1067
|
}
|
|
1522
1068
|
};
|
|
1523
1069
|
try {
|
|
@@ -1617,7 +1163,7 @@ class LLMComponent extends BaseComponent {
|
|
|
1617
1163
|
}
|
|
1618
1164
|
});
|
|
1619
1165
|
} catch (err) {
|
|
1620
|
-
|
|
1166
|
+
logger.warn("Failed to push llm.completed event", { error: String(err) });
|
|
1621
1167
|
}
|
|
1622
1168
|
}
|
|
1623
1169
|
getApiKey(providerId) {
|
|
@@ -1670,6 +1216,11 @@ class LLMComponent extends BaseComponent {
|
|
|
1670
1216
|
}
|
|
1671
1217
|
}
|
|
1672
1218
|
__legacyDecorateClassTS([
|
|
1673
|
-
TracedAs("llm.component.invoke", {
|
|
1219
|
+
TracedAs("llm.component.invoke", {
|
|
1220
|
+
paramFilter: llmInvokeParamFilter,
|
|
1221
|
+
resultFilter: llmInvokeResultFilter,
|
|
1222
|
+
logResult: true,
|
|
1223
|
+
log: true
|
|
1224
|
+
})
|
|
1674
1225
|
], LLMComponent.prototype, "invoke", null);
|
|
1675
|
-
export { ADAPTER_NAMES,
|
|
1226
|
+
export { ADAPTER_NAMES, AiSdkAdapter, setLLMProvider, getLLMProviderOverride, createLLMAdapter, ProviderCapabilitiesSchema, ModelLimitsSchema, ProviderConfigSchema, LLMDefaultConfigSchema, LLMConfigSchema, ProviderManager, LLMTransform, LLMHooks, LLMComponent };
|