@adaptic/lumic-utils 1.0.15 → 1.0.17
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/{apollo-client.client-DLlWTxt5.js → apollo-client.client-D-B7RKys.js} +4 -4
- package/dist/{apollo-client.client-DLlWTxt5.js.map → apollo-client.client-D-B7RKys.js.map} +1 -1
- package/dist/{apollo-client.client-DcvDB-WD.js → apollo-client.client-NpMY129A.js} +3 -3
- package/dist/{apollo-client.client-DcvDB-WD.js.map → apollo-client.client-NpMY129A.js.map} +1 -1
- package/dist/{apollo-client.server-D9uTrgax.js → apollo-client.server-CBdqNKB_.js} +3 -3
- package/dist/{apollo-client.server-D9uTrgax.js.map → apollo-client.server-CBdqNKB_.js.map} +1 -1
- package/dist/{apollo-client.server-DqSN1Fiy.js → apollo-client.server-CS3TcmzK.js} +3 -3
- package/dist/{apollo-client.server-DqSN1Fiy.js.map → apollo-client.server-CS3TcmzK.js.map} +1 -1
- package/dist/{index-b_XLaqK-.js → index-7awA08-j.js} +2 -2
- package/dist/{index-b_XLaqK-.js.map → index-7awA08-j.js.map} +1 -1
- package/dist/{index-CwQjKm5M.js → index-CMRl9Q54.js} +43 -8
- package/dist/{index-CwQjKm5M.js.map → index-CMRl9Q54.js.map} +1 -1
- package/dist/{index-BD1cU0P8.js → index-Y9dzs7p_.js} +43 -8
- package/dist/{index-BD1cU0P8.js.map → index-Y9dzs7p_.js.map} +1 -1
- package/dist/{index-YK3guTNp.js → index-coRTK6G3.js} +2 -2
- package/dist/{index-YK3guTNp.js.map → index-coRTK6G3.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test.cjs +1 -1
- package/dist/test.mjs +1 -1
- package/package.json +1 -1
|
@@ -7815,12 +7815,19 @@ function sanitizeObject(obj, sensitiveFields = ['apiKey', 'token', 'secret', 'pa
|
|
|
7815
7815
|
// llm-anthropic.ts
|
|
7816
7816
|
/**
|
|
7817
7817
|
* Determines if an Anthropic API error should be retried.
|
|
7818
|
-
* Retries on
|
|
7818
|
+
* Retries on:
|
|
7819
|
+
* - 429 rate limit
|
|
7820
|
+
* - 500 internal server error (transient)
|
|
7821
|
+
* - 503 service unavailable (transient)
|
|
7822
|
+
* - 529 overloaded
|
|
7823
|
+
* - Messages containing "rate limit" or "overloaded"
|
|
7819
7824
|
*/
|
|
7820
7825
|
const isRetryableAnthropicError = (error) => {
|
|
7821
7826
|
if (error instanceof Error) {
|
|
7822
7827
|
const message = error.message;
|
|
7823
7828
|
if (message.includes('429') ||
|
|
7829
|
+
message.includes('500') ||
|
|
7830
|
+
message.includes('503') ||
|
|
7824
7831
|
message.includes('529') ||
|
|
7825
7832
|
message.includes('rate limit') ||
|
|
7826
7833
|
message.includes('overloaded')) {
|
|
@@ -7866,10 +7873,38 @@ function translateContextToAnthropic(context) {
|
|
|
7866
7873
|
continue;
|
|
7867
7874
|
}
|
|
7868
7875
|
if (msg.role === 'assistant') {
|
|
7869
|
-
const
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7876
|
+
const assistantMsg = msg;
|
|
7877
|
+
// If the assistant message has tool_calls, translate to Anthropic tool_use blocks
|
|
7878
|
+
if (assistantMsg.tool_calls && assistantMsg.tool_calls.length > 0) {
|
|
7879
|
+
const contentBlocks = [];
|
|
7880
|
+
// Include text content if present
|
|
7881
|
+
if (typeof assistantMsg.content === 'string' && assistantMsg.content.trim()) {
|
|
7882
|
+
contentBlocks.push({ type: 'text', text: assistantMsg.content });
|
|
7883
|
+
}
|
|
7884
|
+
// Translate each tool_call to a tool_use block
|
|
7885
|
+
for (const tc of assistantMsg.tool_calls) {
|
|
7886
|
+
let input = {};
|
|
7887
|
+
try {
|
|
7888
|
+
input = JSON.parse(tc.function.arguments);
|
|
7889
|
+
}
|
|
7890
|
+
catch {
|
|
7891
|
+
input = { raw: tc.function.arguments };
|
|
7892
|
+
}
|
|
7893
|
+
contentBlocks.push({
|
|
7894
|
+
type: 'tool_use',
|
|
7895
|
+
id: tc.id,
|
|
7896
|
+
name: tc.function.name,
|
|
7897
|
+
input,
|
|
7898
|
+
});
|
|
7899
|
+
}
|
|
7900
|
+
messages.push({ role: 'assistant', content: contentBlocks });
|
|
7901
|
+
}
|
|
7902
|
+
else {
|
|
7903
|
+
const content = typeof assistantMsg.content === 'string'
|
|
7904
|
+
? assistantMsg.content
|
|
7905
|
+
: JSON.stringify(assistantMsg.content);
|
|
7906
|
+
messages.push({ role: 'assistant', content });
|
|
7907
|
+
}
|
|
7873
7908
|
continue;
|
|
7874
7909
|
}
|
|
7875
7910
|
if (msg.role === 'tool') {
|
|
@@ -22675,11 +22710,11 @@ let poolConfig = DEFAULT_POOL_CONFIG;
|
|
|
22675
22710
|
async function loadApolloModules() {
|
|
22676
22711
|
if (typeof window === "undefined" || process.env.AWS_EXECUTION_ENV) {
|
|
22677
22712
|
// Server-side (or Lambda): load the CommonJS‑based implementation.
|
|
22678
|
-
return (await Promise.resolve().then(function () { return require('./apollo-client.server-
|
|
22713
|
+
return (await Promise.resolve().then(function () { return require('./apollo-client.server-CS3TcmzK.js'); }));
|
|
22679
22714
|
}
|
|
22680
22715
|
else {
|
|
22681
22716
|
// Client-side: load the ESM‑based implementation.
|
|
22682
|
-
return (await Promise.resolve().then(function () { return require('./apollo-client.client-
|
|
22717
|
+
return (await Promise.resolve().then(function () { return require('./apollo-client.client-NpMY129A.js'); }));
|
|
22683
22718
|
}
|
|
22684
22719
|
}
|
|
22685
22720
|
/**
|
|
@@ -81390,4 +81425,4 @@ exports.withCorrelationId = withCorrelationId;
|
|
|
81390
81425
|
exports.withMetrics = withMetrics;
|
|
81391
81426
|
exports.withRateLimit = withRateLimit;
|
|
81392
81427
|
exports.withRetry = withRetry;
|
|
81393
|
-
//# sourceMappingURL=index-
|
|
81428
|
+
//# sourceMappingURL=index-Y9dzs7p_.js.map
|