@theokit/sdk 2.12.0 → 2.13.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 +6 -0
- package/dist/a2a/index.cjs +14 -3
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +14 -3
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-BchPdvs2.d.ts → cron-CL_9nfhQ.d.ts} +11 -0
- package/dist/{cron-Dv94Lgat.d.cts → cron-CpxLdAXc.d.cts} +11 -0
- package/dist/cron.cjs +14 -3
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +1 -1
- package/dist/cron.d.ts +1 -1
- package/dist/cron.js +14 -3
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +14 -3
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +14 -3
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/internal/llm/router.d.ts +8 -0
- package/dist/types/providers.d.ts +11 -0
- package/package.json +1 -1
package/dist/eval.js
CHANGED
|
@@ -10988,6 +10988,14 @@ var OpenAIClient = class {
|
|
|
10988
10988
|
name = "openai";
|
|
10989
10989
|
baseUrl;
|
|
10990
10990
|
fetchImpl;
|
|
10991
|
+
/**
|
|
10992
|
+
* Whether this client recovers leaked Hermes tool-call dialect from assistant
|
|
10993
|
+
* text (theokit#58 follow-up). Observability for the route→client wiring of
|
|
10994
|
+
* `extractToolCallsFromContent`. @internal
|
|
10995
|
+
*/
|
|
10996
|
+
get recoversLeakedToolCalls() {
|
|
10997
|
+
return this.options.extractToolCallsFromContent ?? false;
|
|
10998
|
+
}
|
|
10991
10999
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: HTTP+SSE handshake + accumulator is intentionally one block
|
|
10992
11000
|
async *stream(request, signal) {
|
|
10993
11001
|
const headers = {
|
|
@@ -11638,8 +11646,9 @@ function buildChain(options) {
|
|
|
11638
11646
|
return clients;
|
|
11639
11647
|
}
|
|
11640
11648
|
function buildClient(name, routerOptions) {
|
|
11641
|
-
const
|
|
11642
|
-
if (
|
|
11649
|
+
const baseProfile = getProviderProfile(name);
|
|
11650
|
+
if (baseProfile === void 0) return void 0;
|
|
11651
|
+
const profile = routerOptions.extractToolCallsFromContent === true && baseProfile.extractToolCallsFromContent !== true ? { ...baseProfile, extractToolCallsFromContent: true } : baseProfile;
|
|
11643
11652
|
const ambient = currentCredentialPool(name);
|
|
11644
11653
|
if (ambient !== void 0) {
|
|
11645
11654
|
return new PoolAwareLlmClient(ambient, (apiKey) => selectTransport(profile, apiKey));
|
|
@@ -12040,11 +12049,13 @@ function buildLoopInputs(options, runId, userText) {
|
|
|
12040
12049
|
const fallback = options.agentOptions.providers?.fallback;
|
|
12041
12050
|
const apiKeys = options.agentOptions.providers?.apiKeys;
|
|
12042
12051
|
const credentialPoolStrategy = options.agentOptions.providers?.credentialPoolStrategy;
|
|
12052
|
+
const extractToolCallsFromContent = options.agentOptions.providers?.routes?.[0]?.extractToolCallsFromContent;
|
|
12043
12053
|
const chain = resolveProviderChain({
|
|
12044
12054
|
primary,
|
|
12045
12055
|
...fallback !== void 0 ? { fallback } : {},
|
|
12046
12056
|
...apiKeys !== void 0 ? { apiKeys } : {},
|
|
12047
|
-
...credentialPoolStrategy !== void 0 ? { credentialPoolStrategy } : {}
|
|
12057
|
+
...credentialPoolStrategy !== void 0 ? { credentialPoolStrategy } : {},
|
|
12058
|
+
...extractToolCallsFromContent === true ? { extractToolCallsFromContent: true } : {}
|
|
12048
12059
|
});
|
|
12049
12060
|
const llm = chain.length === 1 ? chain[0] : new FallbackLlmClient(chain);
|
|
12050
12061
|
return {
|