@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
|
@@ -7795,12 +7795,19 @@ function sanitizeObject(obj, sensitiveFields = ['apiKey', 'token', 'secret', 'pa
|
|
|
7795
7795
|
// llm-anthropic.ts
|
|
7796
7796
|
/**
|
|
7797
7797
|
* Determines if an Anthropic API error should be retried.
|
|
7798
|
-
* Retries on
|
|
7798
|
+
* Retries on:
|
|
7799
|
+
* - 429 rate limit
|
|
7800
|
+
* - 500 internal server error (transient)
|
|
7801
|
+
* - 503 service unavailable (transient)
|
|
7802
|
+
* - 529 overloaded
|
|
7803
|
+
* - Messages containing "rate limit" or "overloaded"
|
|
7799
7804
|
*/
|
|
7800
7805
|
const isRetryableAnthropicError = (error) => {
|
|
7801
7806
|
if (error instanceof Error) {
|
|
7802
7807
|
const message = error.message;
|
|
7803
7808
|
if (message.includes('429') ||
|
|
7809
|
+
message.includes('500') ||
|
|
7810
|
+
message.includes('503') ||
|
|
7804
7811
|
message.includes('529') ||
|
|
7805
7812
|
message.includes('rate limit') ||
|
|
7806
7813
|
message.includes('overloaded')) {
|
|
@@ -7846,10 +7853,38 @@ function translateContextToAnthropic(context) {
|
|
|
7846
7853
|
continue;
|
|
7847
7854
|
}
|
|
7848
7855
|
if (msg.role === 'assistant') {
|
|
7849
|
-
const
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7856
|
+
const assistantMsg = msg;
|
|
7857
|
+
// If the assistant message has tool_calls, translate to Anthropic tool_use blocks
|
|
7858
|
+
if (assistantMsg.tool_calls && assistantMsg.tool_calls.length > 0) {
|
|
7859
|
+
const contentBlocks = [];
|
|
7860
|
+
// Include text content if present
|
|
7861
|
+
if (typeof assistantMsg.content === 'string' && assistantMsg.content.trim()) {
|
|
7862
|
+
contentBlocks.push({ type: 'text', text: assistantMsg.content });
|
|
7863
|
+
}
|
|
7864
|
+
// Translate each tool_call to a tool_use block
|
|
7865
|
+
for (const tc of assistantMsg.tool_calls) {
|
|
7866
|
+
let input = {};
|
|
7867
|
+
try {
|
|
7868
|
+
input = JSON.parse(tc.function.arguments);
|
|
7869
|
+
}
|
|
7870
|
+
catch {
|
|
7871
|
+
input = { raw: tc.function.arguments };
|
|
7872
|
+
}
|
|
7873
|
+
contentBlocks.push({
|
|
7874
|
+
type: 'tool_use',
|
|
7875
|
+
id: tc.id,
|
|
7876
|
+
name: tc.function.name,
|
|
7877
|
+
input,
|
|
7878
|
+
});
|
|
7879
|
+
}
|
|
7880
|
+
messages.push({ role: 'assistant', content: contentBlocks });
|
|
7881
|
+
}
|
|
7882
|
+
else {
|
|
7883
|
+
const content = typeof assistantMsg.content === 'string'
|
|
7884
|
+
? assistantMsg.content
|
|
7885
|
+
: JSON.stringify(assistantMsg.content);
|
|
7886
|
+
messages.push({ role: 'assistant', content });
|
|
7887
|
+
}
|
|
7853
7888
|
continue;
|
|
7854
7889
|
}
|
|
7855
7890
|
if (msg.role === 'tool') {
|
|
@@ -22655,11 +22690,11 @@ let poolConfig = DEFAULT_POOL_CONFIG;
|
|
|
22655
22690
|
async function loadApolloModules() {
|
|
22656
22691
|
if (typeof window === "undefined" || process.env.AWS_EXECUTION_ENV) {
|
|
22657
22692
|
// Server-side (or Lambda): load the CommonJS‑based implementation.
|
|
22658
|
-
return (await import('./apollo-client.server-
|
|
22693
|
+
return (await import('./apollo-client.server-CBdqNKB_.js'));
|
|
22659
22694
|
}
|
|
22660
22695
|
else {
|
|
22661
22696
|
// Client-side: load the ESM‑based implementation.
|
|
22662
|
-
return (await import('./apollo-client.client-
|
|
22697
|
+
return (await import('./apollo-client.client-D-B7RKys.js'));
|
|
22663
22698
|
}
|
|
22664
22699
|
}
|
|
22665
22700
|
/**
|
|
@@ -81183,4 +81218,4 @@ const lumic = {
|
|
|
81183
81218
|
};
|
|
81184
81219
|
|
|
81185
81220
|
export { GraphQLInterfaceType as $, print as A, getNamedType as B, isInputType as C, isRequiredArgument as D, isNamedType as E, GraphQLError as F, GraphQLNonNull as G, isOutputType as H, isRequiredInputField as I, isCompositeType as J, Kind as K, getNullableType as L, getEnterLeaveForKind as M, isNode as N, OperationTypeNode as O, didYouMean as P, naturalCompare as Q, suggestionList as R, specifiedScalarTypes as S, keyMap as T, isType as U, isNullableType as V, visit as W, visitInParallel as X, keyValMap as Y, assertObjectType as Z, GraphQLScalarType as _, isListType as a, validateGoogleSheetsRange as a$, GraphQLUnionType as a0, GraphQLInputObjectType as a1, assertNullableType as a2, assertInterfaceType as a3, mapValue as a4, isSpecifiedScalarType as a5, isPrintableAsBlockString as a6, printBlockString as a7, BREAK as a8, GRAPHQL_MAX_INT as a9, printSourceLocation as aA, resolveObjMapThunk as aB, resolveReadonlyArrayThunk as aC, valueFromASTUntyped as aD, version$4 as aE, versionInfo as aF, getAugmentedNamespace as aG, isDigit$1 as aH, isNameStart as aI, dedentBlockStringLines as aJ, isNameContinue as aK, setLumicLogger as aL, getLumicLogger as aM, sanitizeForLog as aN, sanitizeError as aO, sanitizeAWSAuth as aP, sanitizeObject as aQ, getSecrets as aR, resetSecrets as aS, requireSecret as aT, withRetry as aU, CircuitBreaker as aV, CircuitBreakerState as aW, CircuitBreakerOpenError as aX, DEFAULT_CIRCUIT_BREAKER_CONFIG as aY, validateSlackChannel as aZ, validateS3Key as a_, GRAPHQL_MIN_INT as aa, GraphQLFloat as ab, GraphQLInt as ac, Location as ad, Token as ae, assertAbstractType as af, assertCompositeType as ag, assertEnumType as ah, assertEnumValueName as ai, assertInputObjectType as aj, assertInputType as ak, assertLeafType as al, assertListType as am, assertNamedType as an, assertNonNullType as ao, assertOutputType as ap, assertScalarType as aq, assertType as ar, assertUnionType as as, assertWrappingType as at, formatError as au, getLocation as av, getVisitFn as aw, isWrappingType as ax, printError as ay, printLocation as az, isAbstractType as b, PDFError as b$, LLMCostTracker as b0, getLLMCostTracker as b1, setLLMCostTracker as b2, resetLLMCostTracker as b3, setMetricsCollector as b4, getMetricsCollector as b5, resetMetricsCollector as b6, withMetrics as b7, generateCorrelationId as b8, getCorrelationId as b9, openAIChatCompletionSchema as bA, openAIImageResponseSchema as bB, validateOpenAIChatCompletion as bC, safeValidateOpenAIChatCompletion as bD, perplexityResponseSchema as bE, validatePerplexityResponse as bF, safeValidatePerplexityResponse as bG, googleSheetsValueRangeSchema as bH, validateGoogleSheetsResponse as bI, safeValidateGoogleSheetsResponse as bJ, s3ListObjectsSchema as bK, s3GetObjectSchema as bL, lambdaInvokeResponseSchema as bM, validateS3ListObjects as bN, safeValidateS3ListObjects as bO, validateLambdaResponse as bP, safeValidateLambdaResponse as bQ, createValidator as bR, createSafeValidator as bS, LumicError as bT, SlackError as bU, LLMError as bV, AWSLambdaError as bW, AWSS3Error as bX, GoogleSheetsError as bY, PerplexityError as bZ, JsonParseError as b_, getCorrelationContext as ba, withCorrelationId as bb, getCorrelationHeaders as bc, TokenBucketRateLimiter as bd, RATE_LIMIT_PROFILES as be, getRateLimiter as bf, resetAllRateLimiters as bg, withRateLimit as bh, checkIntegrationHealth as bi, SUPPORTED_MODELS as bj, isValidModel as bk, getModelCapabilities as bl, getModelProvider as bm, MODEL_ALIASES as bn, OPENAI_COMPATIBLE_PROVIDERS as bo, PROVIDER_DEFAULT_MODELS as bp, LLM_DEFAULT_PROVIDER as bq, LLM_MINI_PROVIDER as br, LLM_NORMAL_PROVIDER as bs, LLM_ADVANCED_PROVIDER as bt, LLM_PROVIDER as bu, LLM_MODEL_MINI as bv, LLM_MODEL_NORMAL as bw, LLM_MODEL_ADVANCED as bx, makeAnthropicCall as by, makeOpenAICompatibleCall as bz, isInterfaceType as c, ZipError as c0, SLACK_TIMEOUT_MS as c1, PERPLEXITY_TIMEOUT_MS as c2, GOOGLE_SHEETS_TIMEOUT_MS as c3, LLM_TIMEOUT_MS as c4, AWS_LAMBDA_TIMEOUT_MS as c5, AWS_S3_TIMEOUT_MS as c6, OPENWEATHER_TIMEOUT_MS as c7, GENERIC_FETCH_TIMEOUT_MS as c8, isObjectType as d, assertName as e, devAssert as f, isObjectLike as g, defineArguments as h, isNonNullType as i, argsToArgsConfig as j, GraphQLBoolean as k, lumic as l, GraphQLString as m, instanceOf as n, inspect as o, isInputObjectType as p, isLeafType as q, isEnumType as r, GraphQLID as s, toObjMap as t, invariant as u, GraphQLObjectType as v, GraphQLEnumType as w, GraphQLList as x, isScalarType as y, isUnionType as z };
|
|
81186
|
-
//# sourceMappingURL=index-
|
|
81221
|
+
//# sourceMappingURL=index-CMRl9Q54.js.map
|