@juspay/neurolink 10.12.8 → 11.0.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 +32 -0
- package/dist/browser/neurolink.min.js +399 -401
- package/dist/cli/commands/setup.d.ts +16 -1
- package/dist/cli/commands/setup.js +141 -3
- package/dist/core/baseProvider.js +3 -3
- package/dist/core/dynamicModels.d.ts +1 -1
- package/dist/core/dynamicModels.js +1 -23
- package/dist/core/modelConfiguration.d.ts +1 -70
- package/dist/core/modelConfiguration.js +0 -303
- package/dist/core/modules/GenerationHandler.js +38 -16
- package/dist/core/modules/structuredOutputPolicy.d.ts +2 -2
- package/dist/core/modules/structuredOutputPolicy.js +2 -2
- package/dist/factories/providerFactory.d.ts +15 -0
- package/dist/factories/providerFactory.js +27 -39
- package/dist/factories/providerRegistry.js +2 -2
- package/dist/lib/core/baseProvider.js +3 -3
- package/dist/lib/core/dynamicModels.d.ts +1 -1
- package/dist/lib/core/dynamicModels.js +1 -23
- package/dist/lib/core/modelConfiguration.d.ts +1 -70
- package/dist/lib/core/modelConfiguration.js +0 -303
- package/dist/lib/core/modules/GenerationHandler.js +38 -16
- package/dist/lib/core/modules/structuredOutputPolicy.d.ts +2 -2
- package/dist/lib/core/modules/structuredOutputPolicy.js +2 -2
- package/dist/lib/factories/providerFactory.d.ts +15 -0
- package/dist/lib/factories/providerFactory.js +27 -39
- package/dist/lib/factories/providerRegistry.js +2 -2
- package/dist/lib/models/anthropicModels.d.ts +0 -7
- package/dist/lib/models/anthropicModels.js +0 -9
- package/dist/lib/neurolink.d.ts +15 -0
- package/dist/lib/neurolink.js +77 -44
- package/dist/lib/providers/anthropic/client.js +17 -1
- package/dist/lib/providers/anthropic/constants.d.ts +0 -1
- package/dist/lib/providers/anthropic/constants.js +0 -2
- package/dist/lib/providers/anthropic/index.d.ts +0 -1
- package/dist/lib/providers/anthropic/index.js +0 -1
- package/dist/lib/providers/googleAiStudio/index.d.ts +0 -1
- package/dist/lib/providers/googleAiStudio/index.js +0 -1
- package/dist/lib/providers/googleNativeGemini3/index.d.ts +0 -1
- package/dist/lib/providers/googleNativeGemini3/index.js +0 -1
- package/dist/lib/providers/googleVertex/client.d.ts +0 -51
- package/dist/lib/providers/googleVertex/client.js +0 -678
- package/dist/lib/providers/huggingFace/client.d.ts +1 -1
- package/dist/lib/providers/huggingFace/client.js +1 -1
- package/dist/lib/providers/huggingFace/index.d.ts +0 -1
- package/dist/lib/providers/huggingFace/index.js +0 -1
- package/dist/lib/providers/jina.d.ts +0 -1
- package/dist/lib/providers/jina.js +0 -1
- package/dist/lib/providers/litellm/index.d.ts +0 -2
- package/dist/lib/providers/litellm/index.js +0 -2
- package/dist/lib/providers/llamaCpp.d.ts +1 -0
- package/dist/lib/providers/llamaCpp.js +3 -0
- package/dist/lib/providers/lmStudio.js +3 -23
- package/dist/lib/providers/nvidiaNim/index.d.ts +0 -1
- package/dist/lib/providers/nvidiaNim/index.js +0 -1
- package/dist/lib/providers/ollama/client.js +1 -23
- package/dist/lib/providers/ollama/index.d.ts +0 -1
- package/dist/lib/providers/ollama/index.js +0 -1
- package/dist/lib/providers/openAI/index.d.ts +0 -2
- package/dist/lib/providers/openAI/index.js +0 -2
- package/dist/lib/providers/openRouter/utils.d.ts +0 -2
- package/dist/lib/providers/openRouter/utils.js +0 -12
- package/dist/lib/providers/openaiChatCompletionsBase.d.ts +9 -0
- package/dist/lib/providers/openaiChatCompletionsBase.js +33 -0
- package/dist/lib/providers/perplexity.d.ts +2 -1
- package/dist/lib/providers/perplexity.js +2 -1
- package/dist/lib/providers/replicate.d.ts +0 -1
- package/dist/lib/providers/replicate.js +22 -9
- package/dist/lib/providers/voyage.d.ts +0 -1
- package/dist/lib/providers/voyage.js +0 -1
- package/dist/lib/types/index.d.ts +0 -1
- package/dist/lib/types/index.js +0 -1
- package/dist/lib/types/providers.d.ts +2 -11
- package/dist/lib/types/utilities.d.ts +29 -0
- package/dist/lib/utils/json/coerce.d.ts +21 -1
- package/dist/lib/utils/json/coerce.js +148 -11
- package/dist/lib/utils/providerConfig.d.ts +0 -8
- package/dist/lib/utils/providerConfig.js +0 -37
- package/dist/lib/utils/providerUtils.js +1 -25
- package/dist/models/anthropicModels.d.ts +0 -7
- package/dist/models/anthropicModels.js +0 -9
- package/dist/neurolink.d.ts +15 -0
- package/dist/neurolink.js +77 -44
- package/dist/providers/anthropic/client.js +17 -1
- package/dist/providers/anthropic/constants.d.ts +0 -1
- package/dist/providers/anthropic/constants.js +0 -2
- package/dist/providers/anthropic/index.d.ts +0 -1
- package/dist/providers/anthropic/index.js +0 -1
- package/dist/providers/googleAiStudio/index.d.ts +0 -1
- package/dist/providers/googleAiStudio/index.js +0 -1
- package/dist/providers/googleNativeGemini3/index.d.ts +0 -1
- package/dist/providers/googleNativeGemini3/index.js +0 -1
- package/dist/providers/googleVertex/client.d.ts +0 -51
- package/dist/providers/googleVertex/client.js +0 -678
- package/dist/providers/huggingFace/client.d.ts +1 -1
- package/dist/providers/huggingFace/client.js +1 -1
- package/dist/providers/huggingFace/index.d.ts +0 -1
- package/dist/providers/huggingFace/index.js +0 -1
- package/dist/providers/jina.d.ts +0 -1
- package/dist/providers/jina.js +0 -1
- package/dist/providers/litellm/index.d.ts +0 -2
- package/dist/providers/litellm/index.js +0 -2
- package/dist/providers/llamaCpp.d.ts +1 -0
- package/dist/providers/llamaCpp.js +3 -0
- package/dist/providers/lmStudio.js +3 -23
- package/dist/providers/nvidiaNim/index.d.ts +0 -1
- package/dist/providers/nvidiaNim/index.js +0 -1
- package/dist/providers/ollama/client.js +1 -23
- package/dist/providers/ollama/index.d.ts +0 -1
- package/dist/providers/ollama/index.js +0 -1
- package/dist/providers/openAI/index.d.ts +0 -2
- package/dist/providers/openAI/index.js +0 -2
- package/dist/providers/openRouter/utils.d.ts +0 -2
- package/dist/providers/openRouter/utils.js +0 -12
- package/dist/providers/openaiChatCompletionsBase.d.ts +9 -0
- package/dist/providers/openaiChatCompletionsBase.js +33 -0
- package/dist/providers/perplexity.d.ts +2 -1
- package/dist/providers/perplexity.js +2 -1
- package/dist/providers/replicate.d.ts +0 -1
- package/dist/providers/replicate.js +22 -9
- package/dist/providers/voyage.d.ts +0 -1
- package/dist/providers/voyage.js +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/providers.d.ts +2 -11
- package/dist/types/utilities.d.ts +29 -0
- package/dist/utils/json/coerce.d.ts +21 -1
- package/dist/utils/json/coerce.js +148 -11
- package/dist/utils/providerConfig.d.ts +0 -8
- package/dist/utils/providerConfig.js +0 -37
- package/dist/utils/providerUtils.js +1 -25
- package/package.json +8 -6
- package/dist/lib/providers/anthropic/utils.d.ts +0 -7
- package/dist/lib/providers/anthropic/utils.js +0 -150
- package/dist/lib/providers/googleAiStudio/utils.d.ts +0 -2
- package/dist/lib/providers/googleAiStudio/utils.js +0 -19
- package/dist/lib/providers/googleNativeGemini3/constants.d.ts +0 -1
- package/dist/lib/providers/googleNativeGemini3/constants.js +0 -2
- package/dist/lib/providers/huggingFace/utils.d.ts +0 -2
- package/dist/lib/providers/huggingFace/utils.js +0 -8
- package/dist/lib/providers/index.d.ts +0 -33
- package/dist/lib/providers/index.js +0 -34
- package/dist/lib/providers/litellm/constants.d.ts +0 -1
- package/dist/lib/providers/litellm/constants.js +0 -3
- package/dist/lib/providers/litellm/utils.d.ts +0 -5
- package/dist/lib/providers/litellm/utils.js +0 -11
- package/dist/lib/providers/nvidiaNim/utils.d.ts +0 -9
- package/dist/lib/providers/nvidiaNim/utils.js +0 -101
- package/dist/lib/providers/ollama/utils.d.ts +0 -8
- package/dist/lib/providers/ollama/utils.js +0 -43
- package/dist/lib/providers/openAI/constants.d.ts +0 -1
- package/dist/lib/providers/openAI/constants.js +0 -3
- package/dist/lib/providers/openAI/utils.d.ts +0 -2
- package/dist/lib/providers/openAI/utils.js +0 -8
- package/dist/lib/types/universalProviderOptions.d.ts +0 -89
- package/dist/lib/types/universalProviderOptions.js +0 -55
- package/dist/providers/anthropic/utils.d.ts +0 -7
- package/dist/providers/anthropic/utils.js +0 -149
- package/dist/providers/googleAiStudio/utils.d.ts +0 -2
- package/dist/providers/googleAiStudio/utils.js +0 -18
- package/dist/providers/googleNativeGemini3/constants.d.ts +0 -1
- package/dist/providers/googleNativeGemini3/constants.js +0 -1
- package/dist/providers/huggingFace/utils.d.ts +0 -2
- package/dist/providers/huggingFace/utils.js +0 -7
- package/dist/providers/index.d.ts +0 -33
- package/dist/providers/index.js +0 -33
- package/dist/providers/litellm/constants.d.ts +0 -1
- package/dist/providers/litellm/constants.js +0 -2
- package/dist/providers/litellm/utils.d.ts +0 -5
- package/dist/providers/litellm/utils.js +0 -10
- package/dist/providers/nvidiaNim/utils.d.ts +0 -9
- package/dist/providers/nvidiaNim/utils.js +0 -100
- package/dist/providers/ollama/utils.d.ts +0 -8
- package/dist/providers/ollama/utils.js +0 -42
- package/dist/providers/openAI/constants.d.ts +0 -1
- package/dist/providers/openAI/constants.js +0 -2
- package/dist/providers/openAI/utils.d.ts +0 -2
- package/dist/providers/openAI/utils.js +0 -7
- package/dist/types/universalProviderOptions.d.ts +0 -89
- package/dist/types/universalProviderOptions.js +0 -54
package/dist/lib/neurolink.js
CHANGED
|
@@ -74,7 +74,7 @@ import { CircuitBreaker, ERROR_CODES, ErrorFactory, isAbortError, isRetriableErr
|
|
|
74
74
|
import { hasLifecycleErrorFired, markLifecycleErrorFired, } from "./utils/lifecycleCallbacks.js";
|
|
75
75
|
import { resolveLifecycleTimeoutMs } from "./utils/lifecycleTimeout.js";
|
|
76
76
|
import { cloneOptionsForCallIsolation } from "./utils/cloneOptions.js";
|
|
77
|
-
import { coerceJsonToSchema } from "./utils/json/coerce.js";
|
|
77
|
+
import { coerceJsonToSchema, recoverScalarRoot, schemaAccepts, } from "./utils/json/coerce.js";
|
|
78
78
|
// Factory processing imports
|
|
79
79
|
import { createCleanStreamOptions, enhanceTextGenerationOptions, processFactoryOptions, processStreamingFactoryOptions, validateFactoryConfig, } from "./utils/factoryProcessing.js";
|
|
80
80
|
import { logger, mcpLogger } from "./utils/logger.js";
|
|
@@ -4058,52 +4058,85 @@ Current user's request: ${currentInput}`;
|
|
|
4058
4058
|
}
|
|
4059
4059
|
return textOptions;
|
|
4060
4060
|
}
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4061
|
+
/**
|
|
4062
|
+
* Provider-agnostic JSON recovery for schema requests. Structured-output
|
|
4063
|
+
* enforcement makes valid JSON the overwhelming case; for every other
|
|
4064
|
+
* provider path — including generate() overrides (Vertex, Anthropic,
|
|
4065
|
+
* Bedrock, Google AI Studio) — object/array roots are recovered here via
|
|
4066
|
+
* balanced-scan + jsonrepair and scalar JSON roots via plain JSON.parse,
|
|
4067
|
+
* with the parsed value exposed as `structuredData`. If nothing JSON-shaped
|
|
4068
|
+
* is recoverable (pure prose), the raw text is returned, `structuredData`
|
|
4069
|
+
* stays undefined, and a WARN makes the case observable.
|
|
4070
|
+
*
|
|
4071
|
+
* Mutates `textResult` in place, and must run BEFORE the end-of-generation
|
|
4072
|
+
* emits so event consumers see the same content/structuredData the caller
|
|
4073
|
+
* receives.
|
|
4074
|
+
*/
|
|
4075
|
+
recoverStructuredData(textResult, schema) {
|
|
4076
|
+
// A provider path that produced its own `structuredData` normally owns it.
|
|
4077
|
+
// The one exception is a STRING the caller's schema rejects: that is the
|
|
4078
|
+
// raw completion leaking through as structured output (the shape a
|
|
4079
|
+
// truncated response degrades to), so re-run recovery over the text rather
|
|
4080
|
+
// than handing back a value the declared schema forbids.
|
|
4081
|
+
const structuredIsRejectedString = typeof textResult.structuredData === "string" &&
|
|
4082
|
+
!schemaAccepts(schema, textResult.structuredData);
|
|
4083
|
+
if (!schema ||
|
|
4084
|
+
(textResult.structuredData !== undefined &&
|
|
4085
|
+
!structuredIsRejectedString) ||
|
|
4086
|
+
typeof textResult.content !== "string") {
|
|
4087
|
+
return;
|
|
4088
|
+
}
|
|
4089
|
+
if (structuredIsRejectedString) {
|
|
4090
|
+
textResult.structuredData = undefined;
|
|
4091
|
+
}
|
|
4092
|
+
const coerced = coerceJsonToSchema(textResult.content, schema);
|
|
4093
|
+
if (coerced) {
|
|
4094
|
+
textResult.content = coerced.content;
|
|
4095
|
+
textResult.structuredData = coerced.structuredData;
|
|
4096
|
+
if (coerced.repaired) {
|
|
4097
|
+
textResult.jsonRepaired = true;
|
|
4086
4098
|
}
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
const scalar = JSON.parse(textResult.content);
|
|
4090
|
-
if (scalar === "") {
|
|
4091
|
-
// A JSON-encoded empty string is an EMPTY completion, not a
|
|
4092
|
-
// recovered scalar — normalize to a true empty so callers'
|
|
4093
|
-
// empty-response handling fires instead of a literal '""'
|
|
4094
|
-
// reaching the user. `structuredData` stays undefined.
|
|
4095
|
-
textResult.content = "";
|
|
4096
|
-
logger.warn("[NeuroLink] schema requested but the model returned an empty JSON string; normalizing to empty content", { provider: textResult.provider, model: textResult.model });
|
|
4097
|
-
}
|
|
4098
|
-
else if (scalar !== null && scalar !== undefined) {
|
|
4099
|
-
textResult.structuredData = scalar;
|
|
4100
|
-
}
|
|
4101
|
-
}
|
|
4102
|
-
catch {
|
|
4103
|
-
logger.warn("[NeuroLink] schema requested but no JSON could be recovered from model output; returning raw text", { provider: textResult.provider, model: textResult.model });
|
|
4104
|
-
}
|
|
4099
|
+
if (coerced.truncated) {
|
|
4100
|
+
textResult.jsonTruncated = true;
|
|
4105
4101
|
}
|
|
4102
|
+
return;
|
|
4106
4103
|
}
|
|
4104
|
+
const scalar = recoverScalarRoot(textResult.content, schema);
|
|
4105
|
+
switch (scalar.kind) {
|
|
4106
|
+
case "empty":
|
|
4107
|
+
// A JSON-encoded empty string is an EMPTY completion, not a recovered
|
|
4108
|
+
// scalar — normalize to a true empty so callers' empty-response
|
|
4109
|
+
// handling fires instead of a literal '""' reaching the user.
|
|
4110
|
+
// `structuredData` stays undefined.
|
|
4111
|
+
textResult.content = "";
|
|
4112
|
+
logger.warn("[NeuroLink] schema requested but the model returned an empty JSON string; normalizing to empty content", { provider: textResult.provider, model: textResult.model });
|
|
4113
|
+
break;
|
|
4114
|
+
case "accepted":
|
|
4115
|
+
// Only publish a scalar root the caller's schema actually accepts.
|
|
4116
|
+
// Under an OBJECT schema a recovered string is the raw completion in
|
|
4117
|
+
// disguise — the shape a truncated response degrades to — and exposing
|
|
4118
|
+
// it hands the caller a `structuredData` that violates the schema they
|
|
4119
|
+
// passed.
|
|
4120
|
+
textResult.structuredData = scalar.value;
|
|
4121
|
+
break;
|
|
4122
|
+
case "rejected":
|
|
4123
|
+
logger.warn("[NeuroLink] recovered a JSON scalar the requested schema rejects; leaving structuredData unset", {
|
|
4124
|
+
provider: textResult.provider,
|
|
4125
|
+
model: textResult.model,
|
|
4126
|
+
scalarType: typeof scalar.value,
|
|
4127
|
+
});
|
|
4128
|
+
break;
|
|
4129
|
+
case "nullish":
|
|
4130
|
+
// JSON null/undefined — no structured value to publish.
|
|
4131
|
+
break;
|
|
4132
|
+
case "not-json":
|
|
4133
|
+
logger.warn("[NeuroLink] schema requested but no JSON could be recovered from model output; returning raw text", { provider: textResult.provider, model: textResult.model });
|
|
4134
|
+
break;
|
|
4135
|
+
}
|
|
4136
|
+
}
|
|
4137
|
+
finalizeGenerateRequestResult(params) {
|
|
4138
|
+
const { generateSpan, options, textOptions, textResult, factoryResult, originalPrompt, startTime, } = params;
|
|
4139
|
+
this.recoverStructuredData(textResult, textOptions.schema);
|
|
4107
4140
|
// Surface truncation when a schema was requested: either the provider
|
|
4108
4141
|
// reported finishReason="length" or the recovered JSON came from an
|
|
4109
4142
|
// unclosed span. Either way `structuredData` may be incomplete — warn at
|
|
@@ -1206,6 +1206,9 @@ export class AnthropicProvider extends BaseProvider {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
const content = [];
|
|
1208
1208
|
let finalResultText;
|
|
1209
|
+
// Text emitted in forced-json mode, kept only as a fallback (see below).
|
|
1210
|
+
const jsonModeText = [];
|
|
1211
|
+
let jsonToolAnswered = false;
|
|
1209
1212
|
for (const block of response.content) {
|
|
1210
1213
|
if (block.type === "thinking") {
|
|
1211
1214
|
content.push({ type: "reasoning", text: block.thinking });
|
|
@@ -1213,13 +1216,17 @@ export class AnthropicProvider extends BaseProvider {
|
|
|
1213
1216
|
else if (block.type === "text") {
|
|
1214
1217
|
// In forced-json mode the payload arrives via the tool input, not
|
|
1215
1218
|
// text — pass text through only in normal mode.
|
|
1216
|
-
if (
|
|
1219
|
+
if (jsonTool) {
|
|
1220
|
+
jsonModeText.push(block.text);
|
|
1221
|
+
}
|
|
1222
|
+
else {
|
|
1217
1223
|
content.push({ type: "text", text: block.text });
|
|
1218
1224
|
}
|
|
1219
1225
|
}
|
|
1220
1226
|
else if (block.type === "tool_use") {
|
|
1221
1227
|
if (jsonTool && block.name === jsonTool) {
|
|
1222
1228
|
// Unwrap the synthetic tool call back into text JSON.
|
|
1229
|
+
jsonToolAnswered = true;
|
|
1223
1230
|
content.push({
|
|
1224
1231
|
type: "text",
|
|
1225
1232
|
text: stringifyToolInput(block.input),
|
|
@@ -1241,6 +1248,15 @@ export class AnthropicProvider extends BaseProvider {
|
|
|
1241
1248
|
}
|
|
1242
1249
|
}
|
|
1243
1250
|
}
|
|
1251
|
+
// Forced-json mode normally drops text blocks because the payload rides
|
|
1252
|
+
// in the synthetic tool's input. But when the response is cut short
|
|
1253
|
+
// (stop_reason "max_tokens") the tool call can be missing entirely, and
|
|
1254
|
+
// dropping the text would leave an EMPTY completion with nothing for
|
|
1255
|
+
// coerceJsonToSchema to recover. Fall back to the text so a partial
|
|
1256
|
+
// object can still be salvaged and flagged truncated.
|
|
1257
|
+
if (jsonTool && !jsonToolAnswered && jsonModeText.length > 0) {
|
|
1258
|
+
content.push({ type: "text", text: jsonModeText.join("") });
|
|
1259
|
+
}
|
|
1244
1260
|
// final_result is terminal — parity with the native Claude-on-Vertex
|
|
1245
1261
|
// and Gemini loops, which break out of the tool loop the moment it
|
|
1246
1262
|
// arrives. Reasoning blocks are kept; any prose preamble and any tool
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { trace } from "@opentelemetry/api";
|
|
2
1
|
export const ANTHROPIC_BETA_HEADERS = {
|
|
3
2
|
"anthropic-beta": [
|
|
4
3
|
"claude-code-20250219",
|
|
5
4
|
"fine-grained-tool-streaming-2025-05-14",
|
|
6
5
|
].join(","),
|
|
7
6
|
};
|
|
8
|
-
export const streamTracer = trace.getTracer("neurolink.provider.anthropic");
|
|
9
7
|
//# sourceMappingURL=constants.js.map
|
|
@@ -70,28 +70,6 @@ export declare class GoogleVertexProvider extends BaseProvider {
|
|
|
70
70
|
* Creates fresh model instances for each request
|
|
71
71
|
*/
|
|
72
72
|
protected getAISDKModel(): Promise<LanguageModel>;
|
|
73
|
-
/**
|
|
74
|
-
* Initialize model creation tracking
|
|
75
|
-
*/
|
|
76
|
-
private initializeModelCreationLogging;
|
|
77
|
-
/**
|
|
78
|
-
* Check if model is Anthropic-based and attempt creation
|
|
79
|
-
*/
|
|
80
|
-
private attemptAnthropicModelCreation;
|
|
81
|
-
/**
|
|
82
|
-
* Create Google Vertex model with comprehensive logging and error handling
|
|
83
|
-
*/
|
|
84
|
-
private createGoogleVertexModel;
|
|
85
|
-
/**
|
|
86
|
-
* @deprecated This method is no longer used. All models now use native SDKs.
|
|
87
|
-
*/
|
|
88
|
-
private createVertexInstance;
|
|
89
|
-
/**
|
|
90
|
-
* Gets the appropriate model instance (Google or Anthropic)
|
|
91
|
-
* Uses dual provider architecture for proper model routing
|
|
92
|
-
* Creates fresh instances for each request to ensure proper authentication
|
|
93
|
-
*/
|
|
94
|
-
private getModel;
|
|
95
73
|
/**
|
|
96
74
|
* Validate stream options
|
|
97
75
|
*/
|
|
@@ -320,35 +298,6 @@ export declare class GoogleVertexProvider extends BaseProvider {
|
|
|
320
298
|
* @returns Promise<boolean> indicating if Anthropic support is available
|
|
321
299
|
*/
|
|
322
300
|
hasAnthropicSupport(): Promise<boolean>;
|
|
323
|
-
/**
|
|
324
|
-
* @deprecated This method is no longer used. Claude models now use native @anthropic-ai/vertex-sdk
|
|
325
|
-
* via executeNativeAnthropicStream and executeNativeAnthropicGenerate.
|
|
326
|
-
*/
|
|
327
|
-
createAnthropicModel(_modelName: string): Promise<LanguageModel | null>;
|
|
328
|
-
/**
|
|
329
|
-
* Validate Vertex AI authentication configuration
|
|
330
|
-
*/
|
|
331
|
-
private validateVertexAuthentication;
|
|
332
|
-
/**
|
|
333
|
-
* Validate Vertex AI project configuration
|
|
334
|
-
*/
|
|
335
|
-
private validateVertexProjectConfiguration;
|
|
336
|
-
/**
|
|
337
|
-
* Check if the specified region supports Anthropic models
|
|
338
|
-
*/
|
|
339
|
-
private checkVertexRegionalSupport;
|
|
340
|
-
/**
|
|
341
|
-
* Validate Anthropic model name format and availability
|
|
342
|
-
*/
|
|
343
|
-
private validateAnthropicModelName;
|
|
344
|
-
/**
|
|
345
|
-
* Analyze Anthropic model creation errors for detailed troubleshooting
|
|
346
|
-
*/
|
|
347
|
-
private analyzeAnthropicCreationError;
|
|
348
|
-
/**
|
|
349
|
-
* Get detailed troubleshooting steps based on error analysis
|
|
350
|
-
*/
|
|
351
|
-
private getAnthropicTroubleshootingSteps;
|
|
352
301
|
/**
|
|
353
302
|
* Register a tool with the AI provider
|
|
354
303
|
* @param name The name of the tool
|