@juspay/neurolink 12.39.0 → 12.40.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 -2
- package/README.md +1 -1
- package/dist/auth/middleware/AuthMiddleware.d.ts +1 -1
- package/dist/browser/neurolink.min.js +437 -435
- package/dist/constants/enums.d.ts +237 -0
- package/dist/constants/enums.js +257 -0
- package/dist/neurolink.js +52 -21
- package/dist/providers/catalog/ai21.json +142 -0
- package/dist/providers/catalog/aionlabs.json +144 -0
- package/dist/providers/catalog/atlas-cloud.json +203 -0
- package/dist/providers/catalog/avian-io.json +227 -0
- package/dist/providers/catalog/crusoe.json +229 -0
- package/dist/providers/catalog/index.generated.d.ts +1 -1
- package/dist/providers/catalog/index.generated.js +60 -0
- package/dist/providers/catalog/minimax.json +200 -0
- package/dist/providers/catalog/moonshot-ai.json +135 -0
- package/dist/providers/catalog/nebius.json +165 -0
- package/dist/providers/catalog/prime-intellect.json +217 -0
- package/dist/providers/catalog/scaleway.json +177 -0
- package/dist/providers/catalog/siliconflow.json +242 -0
- package/dist/providers/catalog/stepfun.json +155 -0
- package/dist/providers/catalog/subconscious.json +93 -0
- package/dist/providers/catalog/tinfoil.json +155 -0
- package/dist/providers/catalog/umans-ai.json +174 -0
- package/dist/providers/catalog/venice-ai.json +208 -0
- package/dist/providers/catalog/vultr-inference.json +220 -0
- package/dist/providers/catalog/wafer.json +165 -0
- package/dist/providers/catalog/wandb-inference.json +249 -0
- package/dist/providers/catalog/z-ai.json +255 -0
- package/dist/providers/googleAiStudio/client.js +687 -263
- package/dist/providers/googleNativeGemini3/utils.d.ts +44 -1
- package/dist/providers/googleNativeGemini3/utils.js +300 -1
- package/dist/types/providerCatalog.generated.d.ts +2 -2
- package/dist/types/providers.d.ts +80 -0
- package/docs-site/static/search-index.json +227 -3
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* This module extracts the functions that are duplicated between the two
|
|
9
9
|
* providers so they can share a single implementation.
|
|
10
10
|
*/
|
|
11
|
-
import type { GenerateStopReason, ThinkingConfig, AgenticLoopOptions, ChatMessage, CollectedChunkResult, MinimalChatMessage, NativeFunctionCall, NativeFunctionResponse, NativeToolDeclarationsResult, NativeToolsConfig, StreamChannel, VertexNativePart, GeminiMultimodalInput, MultimodalAudioEntry, MultimodalVideoEntry } from "../../types/index.js";
|
|
11
|
+
import type { GenerateStopReason, ThinkingConfig, AgenticLoopOptions, ChatMessage, CollectedChunkResult, MinimalChatMessage, NativeFunctionCall, NativeFunctionResponse, NativeToolDeclarationsResult, NativeToolsConfig, StreamChannel, VertexNativePart, GeminiMultimodalInput, MultimodalAudioEntry, MultimodalVideoEntry, ModelMessage } from "../../types/index.js";
|
|
12
12
|
import type { Tool, ToolExecutionGuards } from "../../types/index.js";
|
|
13
13
|
/**
|
|
14
14
|
* A per-turn tool execute map that deduplicates identical tool calls.
|
|
@@ -66,6 +66,13 @@ export declare function refreshNativeToolDeclarations(liveTools: Record<string,
|
|
|
66
66
|
*/
|
|
67
67
|
export declare function buildNativeConfig(options: {
|
|
68
68
|
temperature?: number;
|
|
69
|
+
/**
|
|
70
|
+
* Nucleus sampling. Subject to the same registry-driven
|
|
71
|
+
* sampling-param strip as `temperature` — a model that rejects
|
|
72
|
+
* classic sampling params (see `SAMPLING_PARAM_REJECTING_FAMILIES`)
|
|
73
|
+
* gets neither on the wire.
|
|
74
|
+
*/
|
|
75
|
+
topP?: number;
|
|
69
76
|
maxTokens?: number;
|
|
70
77
|
systemPrompt?: string;
|
|
71
78
|
/**
|
|
@@ -421,6 +428,42 @@ export declare function prependConversationMessages(contents: Array<{
|
|
|
421
428
|
role: string;
|
|
422
429
|
parts: unknown[];
|
|
423
430
|
}>, conversationMessages?: Array<ChatMessage | MinimalChatMessage>): void;
|
|
431
|
+
/**
|
|
432
|
+
* Convert a native Gemini `contents` array (the shape this module builds and
|
|
433
|
+
* `prependConversationMessages` emits) into the generic V3 prompt shape that
|
|
434
|
+
* caller model middleware operates on.
|
|
435
|
+
*
|
|
436
|
+
* Gemini has no wire-visible `system` role — `systemInstruction` rides
|
|
437
|
+
* separately on `config` — so this only ever emits `user` / `assistant` /
|
|
438
|
+
* `tool` messages. A `functionResponse`-only `user` entry becomes a V3
|
|
439
|
+
* `tool` message rather than `user`: `UserModelMessage.content` cannot carry
|
|
440
|
+
* a `ToolResultPart`, only `ToolModelMessage.content` can, and that grouping
|
|
441
|
+
* (a `model` turn of `functionCall` parts followed by a `user` turn of
|
|
442
|
+
* matching `functionResponse` parts) is exactly what
|
|
443
|
+
* `prependConversationMessages` above produces.
|
|
444
|
+
*/
|
|
445
|
+
export declare function geminiContentsToV3Prompt(contents: Array<{
|
|
446
|
+
role: string;
|
|
447
|
+
parts: unknown[];
|
|
448
|
+
}>): ModelMessage[];
|
|
449
|
+
/**
|
|
450
|
+
* Reverse of `geminiContentsToV3Prompt`: rebuild a native Gemini `contents`
|
|
451
|
+
* array from a (possibly middleware-rewritten) V3 prompt. A `system`
|
|
452
|
+
* message has no `contents` entry of its own — Gemini carries it on
|
|
453
|
+
* `config.systemInstruction` — so its text is returned separately
|
|
454
|
+
* (`systemText`) and the caller folds it into the request config.
|
|
455
|
+
*
|
|
456
|
+
* The synthesized `toolCallId` from the forward direction is intentionally
|
|
457
|
+
* discarded: Gemini pairs a call to its result by position, not by id, so
|
|
458
|
+
* reconstruction only needs `{name, args}` / `{name, response}`.
|
|
459
|
+
*/
|
|
460
|
+
export declare function v3PromptToGeminiContents(prompt: ModelMessage[]): {
|
|
461
|
+
contents: Array<{
|
|
462
|
+
role: string;
|
|
463
|
+
parts: unknown[];
|
|
464
|
+
}>;
|
|
465
|
+
systemText?: string;
|
|
466
|
+
};
|
|
424
467
|
/**
|
|
425
468
|
* Build the `parts` array for the current user turn of a Gemini native
|
|
426
469
|
* `generateContent` request, including inline image + PDF blobs.
|
|
@@ -422,12 +422,15 @@ export function refreshNativeToolDeclarations(liveTools, current) {
|
|
|
422
422
|
export function buildNativeConfig(options, toolsConfig) {
|
|
423
423
|
// Registry-driven sampling strip applied for uniformity with every other
|
|
424
424
|
// provider path (inert for current Gemini models).
|
|
425
|
-
const samplingParams = resolveSamplingParams("google-ai", options.model, { temperature: options.temperature ?? 1.0 }, // Gemini 3 requires 1.0 for tool calling
|
|
425
|
+
const samplingParams = resolveSamplingParams("google-ai", options.model, { temperature: options.temperature ?? 1.0, topP: options.topP }, // Gemini 3 requires 1.0 for tool calling
|
|
426
426
|
"googleAiStudio.buildNativeConfig");
|
|
427
427
|
const config = {
|
|
428
428
|
...(samplingParams.temperature !== undefined && {
|
|
429
429
|
temperature: samplingParams.temperature,
|
|
430
430
|
}),
|
|
431
|
+
...(samplingParams.topP !== undefined && {
|
|
432
|
+
topP: samplingParams.topP,
|
|
433
|
+
}),
|
|
431
434
|
maxOutputTokens: options.maxTokens,
|
|
432
435
|
};
|
|
433
436
|
if (toolsConfig) {
|
|
@@ -1306,6 +1309,302 @@ conversationMessages) {
|
|
|
1306
1309
|
}
|
|
1307
1310
|
}
|
|
1308
1311
|
}
|
|
1312
|
+
// ── Gemini contents ↔ V3 prompt conversion ──
|
|
1313
|
+
//
|
|
1314
|
+
// Caller model middleware (transformParams / wrapGenerate / wrapStream)
|
|
1315
|
+
// operates on the generic `ModelMessage[]` prompt shape, not on Gemini's
|
|
1316
|
+
// native `contents`. These two functions are the boundary: the native
|
|
1317
|
+
// stream/generate loops build `contents` exactly as they always have, hand
|
|
1318
|
+
// it through `geminiContentsToV3Prompt` before invoking middleware, and
|
|
1319
|
+
// rebuild `contents` from whatever prompt the middleware settled on via
|
|
1320
|
+
// `v3PromptToGeminiContents`.
|
|
1321
|
+
function hasTextField(part) {
|
|
1322
|
+
if (typeof part !== "object" || part === null || !("text" in part)) {
|
|
1323
|
+
return false;
|
|
1324
|
+
}
|
|
1325
|
+
return typeof part.text === "string";
|
|
1326
|
+
}
|
|
1327
|
+
function hasInlineDataField(part) {
|
|
1328
|
+
if (typeof part !== "object" || part === null || !("inlineData" in part)) {
|
|
1329
|
+
return false;
|
|
1330
|
+
}
|
|
1331
|
+
const inline = part.inlineData;
|
|
1332
|
+
return (typeof inline === "object" &&
|
|
1333
|
+
inline !== null &&
|
|
1334
|
+
"mimeType" in inline &&
|
|
1335
|
+
"data" in inline);
|
|
1336
|
+
}
|
|
1337
|
+
function hasFunctionCallField(part) {
|
|
1338
|
+
return typeof part === "object" && part !== null && "functionCall" in part;
|
|
1339
|
+
}
|
|
1340
|
+
function hasFunctionResponseField(part) {
|
|
1341
|
+
return (typeof part === "object" && part !== null && "functionResponse" in part);
|
|
1342
|
+
}
|
|
1343
|
+
function readThoughtSignature(part) {
|
|
1344
|
+
if (typeof part !== "object" ||
|
|
1345
|
+
part === null ||
|
|
1346
|
+
!("thoughtSignature" in part)) {
|
|
1347
|
+
return undefined;
|
|
1348
|
+
}
|
|
1349
|
+
return typeof part.thoughtSignature === "string"
|
|
1350
|
+
? part.thoughtSignature
|
|
1351
|
+
: undefined;
|
|
1352
|
+
}
|
|
1353
|
+
function withThoughtSignature(part, thoughtSignature) {
|
|
1354
|
+
if (!thoughtSignature) {
|
|
1355
|
+
return part;
|
|
1356
|
+
}
|
|
1357
|
+
return {
|
|
1358
|
+
...part,
|
|
1359
|
+
providerOptions: {
|
|
1360
|
+
...part.providerOptions,
|
|
1361
|
+
googleAiStudio: {
|
|
1362
|
+
...part.providerOptions?.googleAiStudio,
|
|
1363
|
+
thoughtSignature,
|
|
1364
|
+
},
|
|
1365
|
+
},
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
function readProviderThoughtSignature(providerOptions) {
|
|
1369
|
+
if (typeof providerOptions !== "object" || providerOptions === null) {
|
|
1370
|
+
return undefined;
|
|
1371
|
+
}
|
|
1372
|
+
const studio = providerOptions.googleAiStudio;
|
|
1373
|
+
if (typeof studio !== "object" || studio === null) {
|
|
1374
|
+
return undefined;
|
|
1375
|
+
}
|
|
1376
|
+
const sig = studio.thoughtSignature;
|
|
1377
|
+
return typeof sig === "string" ? sig : undefined;
|
|
1378
|
+
}
|
|
1379
|
+
function isFunctionResponseOnlyEntry(parts) {
|
|
1380
|
+
return parts.length > 0 && parts.every(hasFunctionResponseField);
|
|
1381
|
+
}
|
|
1382
|
+
function toV3ToolResultPart(part) {
|
|
1383
|
+
if (!hasFunctionResponseField(part)) {
|
|
1384
|
+
return undefined;
|
|
1385
|
+
}
|
|
1386
|
+
return {
|
|
1387
|
+
type: "tool-result",
|
|
1388
|
+
// Gemini pairs a function response to its call by position, not by id —
|
|
1389
|
+
// nothing downstream of this conversion reads this value back.
|
|
1390
|
+
toolCallId: `gemini-tool-${randomUUID()}`,
|
|
1391
|
+
toolName: part.functionResponse.name,
|
|
1392
|
+
output: part.functionResponse.response,
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
function toV3UserPart(part) {
|
|
1396
|
+
if (hasTextField(part)) {
|
|
1397
|
+
return withThoughtSignature({ type: "text", text: part.text }, readThoughtSignature(part));
|
|
1398
|
+
}
|
|
1399
|
+
if (hasInlineDataField(part)) {
|
|
1400
|
+
return {
|
|
1401
|
+
type: "file",
|
|
1402
|
+
data: part.inlineData.data,
|
|
1403
|
+
mediaType: part.inlineData.mimeType,
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
return undefined;
|
|
1407
|
+
}
|
|
1408
|
+
function toV3AssistantPart(part) {
|
|
1409
|
+
if (hasTextField(part)) {
|
|
1410
|
+
return withThoughtSignature({ type: "text", text: part.text }, readThoughtSignature(part));
|
|
1411
|
+
}
|
|
1412
|
+
if (hasFunctionCallField(part)) {
|
|
1413
|
+
return withThoughtSignature({
|
|
1414
|
+
type: "tool-call",
|
|
1415
|
+
toolCallId: `gemini-tool-${randomUUID()}`,
|
|
1416
|
+
toolName: part.functionCall.name,
|
|
1417
|
+
input: part.functionCall.args ?? {},
|
|
1418
|
+
}, part.thoughtSignature);
|
|
1419
|
+
}
|
|
1420
|
+
return undefined;
|
|
1421
|
+
}
|
|
1422
|
+
/**
|
|
1423
|
+
* Convert a native Gemini `contents` array (the shape this module builds and
|
|
1424
|
+
* `prependConversationMessages` emits) into the generic V3 prompt shape that
|
|
1425
|
+
* caller model middleware operates on.
|
|
1426
|
+
*
|
|
1427
|
+
* Gemini has no wire-visible `system` role — `systemInstruction` rides
|
|
1428
|
+
* separately on `config` — so this only ever emits `user` / `assistant` /
|
|
1429
|
+
* `tool` messages. A `functionResponse`-only `user` entry becomes a V3
|
|
1430
|
+
* `tool` message rather than `user`: `UserModelMessage.content` cannot carry
|
|
1431
|
+
* a `ToolResultPart`, only `ToolModelMessage.content` can, and that grouping
|
|
1432
|
+
* (a `model` turn of `functionCall` parts followed by a `user` turn of
|
|
1433
|
+
* matching `functionResponse` parts) is exactly what
|
|
1434
|
+
* `prependConversationMessages` above produces.
|
|
1435
|
+
*/
|
|
1436
|
+
export function geminiContentsToV3Prompt(contents) {
|
|
1437
|
+
const messages = [];
|
|
1438
|
+
for (const entry of contents) {
|
|
1439
|
+
const parts = Array.isArray(entry.parts) ? entry.parts : [];
|
|
1440
|
+
if (entry.role === "user" && isFunctionResponseOnlyEntry(parts)) {
|
|
1441
|
+
const content = parts
|
|
1442
|
+
.map(toV3ToolResultPart)
|
|
1443
|
+
.filter((p) => p !== undefined);
|
|
1444
|
+
if (content.length > 0) {
|
|
1445
|
+
messages.push({ role: "tool", content });
|
|
1446
|
+
}
|
|
1447
|
+
continue;
|
|
1448
|
+
}
|
|
1449
|
+
if (entry.role === "user") {
|
|
1450
|
+
const content = parts
|
|
1451
|
+
.map(toV3UserPart)
|
|
1452
|
+
.filter((p) => p !== undefined);
|
|
1453
|
+
if (content.length > 0) {
|
|
1454
|
+
messages.push({ role: "user", content });
|
|
1455
|
+
}
|
|
1456
|
+
continue;
|
|
1457
|
+
}
|
|
1458
|
+
if (entry.role === "model") {
|
|
1459
|
+
const content = parts
|
|
1460
|
+
.map(toV3AssistantPart)
|
|
1461
|
+
.filter((p) => p !== undefined);
|
|
1462
|
+
if (content.length > 0) {
|
|
1463
|
+
messages.push({ role: "assistant", content });
|
|
1464
|
+
}
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
return messages;
|
|
1468
|
+
}
|
|
1469
|
+
function dataContentToBase64(data) {
|
|
1470
|
+
if (typeof data === "string") {
|
|
1471
|
+
return data;
|
|
1472
|
+
}
|
|
1473
|
+
if (Buffer.isBuffer(data)) {
|
|
1474
|
+
return data.toString("base64");
|
|
1475
|
+
}
|
|
1476
|
+
if (data instanceof ArrayBuffer) {
|
|
1477
|
+
return Buffer.from(data).toString("base64");
|
|
1478
|
+
}
|
|
1479
|
+
return Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString("base64");
|
|
1480
|
+
}
|
|
1481
|
+
function userContentToGeminiParts(content) {
|
|
1482
|
+
if (typeof content === "string") {
|
|
1483
|
+
return content.length > 0 ? [{ text: content }] : [];
|
|
1484
|
+
}
|
|
1485
|
+
const parts = [];
|
|
1486
|
+
for (const part of content) {
|
|
1487
|
+
if (part.type === "text") {
|
|
1488
|
+
if (part.text.length > 0) {
|
|
1489
|
+
const sig = readProviderThoughtSignature(part.providerOptions);
|
|
1490
|
+
parts.push(sig
|
|
1491
|
+
? { text: part.text, thoughtSignature: sig }
|
|
1492
|
+
: { text: part.text });
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
else if (part.type === "image" && !(part.image instanceof URL)) {
|
|
1496
|
+
parts.push({
|
|
1497
|
+
inlineData: {
|
|
1498
|
+
mimeType: part.mediaType ?? "application/octet-stream",
|
|
1499
|
+
data: dataContentToBase64(part.image),
|
|
1500
|
+
},
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
else if (part.type === "file" && !(part.data instanceof URL)) {
|
|
1504
|
+
parts.push({
|
|
1505
|
+
inlineData: {
|
|
1506
|
+
mimeType: part.mediaType,
|
|
1507
|
+
data: dataContentToBase64(part.data),
|
|
1508
|
+
},
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
return parts;
|
|
1513
|
+
}
|
|
1514
|
+
function assistantContentToGeminiParts(content) {
|
|
1515
|
+
if (typeof content === "string") {
|
|
1516
|
+
return content.length > 0 ? [{ text: content }] : [];
|
|
1517
|
+
}
|
|
1518
|
+
const parts = [];
|
|
1519
|
+
for (const part of content) {
|
|
1520
|
+
if (part.type === "text") {
|
|
1521
|
+
if (part.text.length > 0) {
|
|
1522
|
+
const sig = readProviderThoughtSignature(part.providerOptions);
|
|
1523
|
+
parts.push(sig
|
|
1524
|
+
? { text: part.text, thoughtSignature: sig }
|
|
1525
|
+
: { text: part.text });
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
else if (part.type === "tool-call") {
|
|
1529
|
+
const sig = readProviderThoughtSignature(part.providerOptions);
|
|
1530
|
+
const call = {
|
|
1531
|
+
functionCall: {
|
|
1532
|
+
name: part.toolName,
|
|
1533
|
+
args: (part.input ?? {}),
|
|
1534
|
+
},
|
|
1535
|
+
};
|
|
1536
|
+
if (sig) {
|
|
1537
|
+
call.thoughtSignature = sig;
|
|
1538
|
+
}
|
|
1539
|
+
parts.push(call);
|
|
1540
|
+
}
|
|
1541
|
+
// `reasoning` / `file` / `tool-result` / `tool-approval-request` parts on
|
|
1542
|
+
// an assistant message have no native Gemini wire shape and are dropped
|
|
1543
|
+
// — this path never emitted them into `contents` before this conversion
|
|
1544
|
+
// existed either.
|
|
1545
|
+
}
|
|
1546
|
+
return parts;
|
|
1547
|
+
}
|
|
1548
|
+
function toolContentToGeminiParts(content) {
|
|
1549
|
+
const parts = [];
|
|
1550
|
+
for (const item of content) {
|
|
1551
|
+
if (item.type === "tool-result") {
|
|
1552
|
+
parts.push({
|
|
1553
|
+
functionResponse: {
|
|
1554
|
+
name: item.toolName,
|
|
1555
|
+
response: item.output && typeof item.output === "object"
|
|
1556
|
+
? item.output
|
|
1557
|
+
: { result: item.output },
|
|
1558
|
+
},
|
|
1559
|
+
});
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
return parts;
|
|
1563
|
+
}
|
|
1564
|
+
/**
|
|
1565
|
+
* Reverse of `geminiContentsToV3Prompt`: rebuild a native Gemini `contents`
|
|
1566
|
+
* array from a (possibly middleware-rewritten) V3 prompt. A `system`
|
|
1567
|
+
* message has no `contents` entry of its own — Gemini carries it on
|
|
1568
|
+
* `config.systemInstruction` — so its text is returned separately
|
|
1569
|
+
* (`systemText`) and the caller folds it into the request config.
|
|
1570
|
+
*
|
|
1571
|
+
* The synthesized `toolCallId` from the forward direction is intentionally
|
|
1572
|
+
* discarded: Gemini pairs a call to its result by position, not by id, so
|
|
1573
|
+
* reconstruction only needs `{name, args}` / `{name, response}`.
|
|
1574
|
+
*/
|
|
1575
|
+
export function v3PromptToGeminiContents(prompt) {
|
|
1576
|
+
const contents = [];
|
|
1577
|
+
const systemChunks = [];
|
|
1578
|
+
for (const message of prompt) {
|
|
1579
|
+
if (message.role === "system") {
|
|
1580
|
+
if (message.content.length > 0) {
|
|
1581
|
+
systemChunks.push(message.content);
|
|
1582
|
+
}
|
|
1583
|
+
continue;
|
|
1584
|
+
}
|
|
1585
|
+
if (message.role === "user") {
|
|
1586
|
+
const parts = userContentToGeminiParts(message.content);
|
|
1587
|
+
if (parts.length > 0) {
|
|
1588
|
+
contents.push({ role: "user", parts });
|
|
1589
|
+
}
|
|
1590
|
+
continue;
|
|
1591
|
+
}
|
|
1592
|
+
if (message.role === "assistant") {
|
|
1593
|
+
const parts = assistantContentToGeminiParts(message.content);
|
|
1594
|
+
if (parts.length > 0) {
|
|
1595
|
+
contents.push({ role: "model", parts });
|
|
1596
|
+
}
|
|
1597
|
+
continue;
|
|
1598
|
+
}
|
|
1599
|
+
const parts = toolContentToGeminiParts(message.content);
|
|
1600
|
+
if (parts.length > 0) {
|
|
1601
|
+
contents.push({ role: "user", parts });
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
return systemChunks.length > 0
|
|
1605
|
+
? { contents, systemText: systemChunks.join("\n\n") }
|
|
1606
|
+
: { contents };
|
|
1607
|
+
}
|
|
1309
1608
|
/**
|
|
1310
1609
|
* Build the `parts` array for the current user turn of a Gemini native
|
|
1311
1610
|
* `generateContent` request, including inline image + PDF blobs.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type CatalogProviderName = "above-dev" | "aiand" | "ambient" | "api-route" | "baseten" | "bee-heossi" | "cerebras" | "charm-hyper" | "chutes" | "cloudflare" | "deepinfra" | "deepseek" | "empiriolabs" | "featherless-ai" | "fireworks" | "friendli" | "gmicloud" | "groq" | "huggingface" | "inception-labs" | "inco" | "inference-net" | "io-intelligence" | "koscompute" | "lilac" | "llmtech" | "mancer" | "mistral" | "moark" | "morph" | "neuralwatt" | "novita" | "ovhcloud" | "pareto-inference" | "perplexity" | "sambanova" | "sarvam" | "synthetic" | "together-ai" | "upstage" | "xai";
|
|
2
|
-
export type CatalogCredentialKey = "aboveDev" | "aiand" | "ambient" | "apiRoute" | "baseten" | "beeHeossi" | "cerebras" | "charmHyper" | "chutes" | "cloudflare" | "deepinfra" | "deepseek" | "empiriolabs" | "featherlessAi" | "fireworks" | "friendli" | "gmicloud" | "groq" | "huggingFace" | "inceptionLabs" | "inco" | "inferenceNet" | "ioIntelligence" | "koscompute" | "lilac" | "llmtech" | "mancer" | "mistral" | "moark" | "morph" | "neuralwatt" | "novita" | "ovhcloud" | "paretoInference" | "perplexity" | "sambanova" | "sarvam" | "synthetic" | "together" | "upstage" | "xai";
|
|
1
|
+
export type CatalogProviderName = "above-dev" | "ai21" | "aiand" | "aionlabs" | "ambient" | "api-route" | "atlas-cloud" | "avian-io" | "baseten" | "bee-heossi" | "cerebras" | "charm-hyper" | "chutes" | "cloudflare" | "crusoe" | "deepinfra" | "deepseek" | "empiriolabs" | "featherless-ai" | "fireworks" | "friendli" | "gmicloud" | "groq" | "huggingface" | "inception-labs" | "inco" | "inference-net" | "io-intelligence" | "koscompute" | "lilac" | "llmtech" | "mancer" | "minimax" | "mistral" | "moark" | "moonshot-ai" | "morph" | "nebius" | "neuralwatt" | "novita" | "ovhcloud" | "pareto-inference" | "perplexity" | "prime-intellect" | "sambanova" | "sarvam" | "scaleway" | "siliconflow" | "stepfun" | "subconscious" | "synthetic" | "tinfoil" | "together-ai" | "umans-ai" | "upstage" | "venice-ai" | "vultr-inference" | "wafer" | "wandb-inference" | "xai" | "z-ai";
|
|
2
|
+
export type CatalogCredentialKey = "aboveDev" | "ai21" | "aiand" | "aionlabs" | "ambient" | "apiRoute" | "atlasCloud" | "avianIo" | "baseten" | "beeHeossi" | "cerebras" | "charmHyper" | "chutes" | "cloudflare" | "crusoe" | "deepinfra" | "deepseek" | "empiriolabs" | "featherlessAi" | "fireworks" | "friendli" | "gmicloud" | "groq" | "huggingFace" | "inceptionLabs" | "inco" | "inferenceNet" | "ioIntelligence" | "koscompute" | "lilac" | "llmtech" | "mancer" | "minimax" | "mistral" | "moark" | "moonshotAi" | "morph" | "nebius" | "neuralwatt" | "novita" | "ovhcloud" | "paretoInference" | "perplexity" | "primeIntellect" | "sambanova" | "sarvam" | "scaleway" | "siliconflow" | "stepfun" | "subconscious" | "synthetic" | "tinfoil" | "together" | "umansAi" | "upstage" | "veniceAi" | "vultrInference" | "wafer" | "wandbInference" | "xai" | "zAi";
|
|
@@ -176,10 +176,18 @@ export type NeurolinkCredentials = {
|
|
|
176
176
|
apiKey?: string;
|
|
177
177
|
baseURL?: string;
|
|
178
178
|
};
|
|
179
|
+
ai21?: {
|
|
180
|
+
apiKey?: string;
|
|
181
|
+
baseURL?: string;
|
|
182
|
+
};
|
|
179
183
|
aiand?: {
|
|
180
184
|
apiKey?: string;
|
|
181
185
|
baseURL?: string;
|
|
182
186
|
};
|
|
187
|
+
aionlabs?: {
|
|
188
|
+
apiKey?: string;
|
|
189
|
+
baseURL?: string;
|
|
190
|
+
};
|
|
183
191
|
ambient?: {
|
|
184
192
|
apiKey?: string;
|
|
185
193
|
baseURL?: string;
|
|
@@ -188,6 +196,14 @@ export type NeurolinkCredentials = {
|
|
|
188
196
|
apiKey?: string;
|
|
189
197
|
baseURL?: string;
|
|
190
198
|
};
|
|
199
|
+
atlasCloud?: {
|
|
200
|
+
apiKey?: string;
|
|
201
|
+
baseURL?: string;
|
|
202
|
+
};
|
|
203
|
+
avianIo?: {
|
|
204
|
+
apiKey?: string;
|
|
205
|
+
baseURL?: string;
|
|
206
|
+
};
|
|
191
207
|
baseten?: {
|
|
192
208
|
apiKey?: string;
|
|
193
209
|
baseURL?: string;
|
|
@@ -213,6 +229,10 @@ export type NeurolinkCredentials = {
|
|
|
213
229
|
baseURL?: string;
|
|
214
230
|
accountId?: string;
|
|
215
231
|
};
|
|
232
|
+
crusoe?: {
|
|
233
|
+
apiKey?: string;
|
|
234
|
+
baseURL?: string;
|
|
235
|
+
};
|
|
216
236
|
deepinfra?: {
|
|
217
237
|
apiKey?: string;
|
|
218
238
|
baseURL?: string;
|
|
@@ -281,6 +301,10 @@ export type NeurolinkCredentials = {
|
|
|
281
301
|
apiKey?: string;
|
|
282
302
|
baseURL?: string;
|
|
283
303
|
};
|
|
304
|
+
minimax?: {
|
|
305
|
+
apiKey?: string;
|
|
306
|
+
baseURL?: string;
|
|
307
|
+
};
|
|
284
308
|
mistral?: {
|
|
285
309
|
apiKey?: string;
|
|
286
310
|
baseURL?: string;
|
|
@@ -289,10 +313,18 @@ export type NeurolinkCredentials = {
|
|
|
289
313
|
apiKey?: string;
|
|
290
314
|
baseURL?: string;
|
|
291
315
|
};
|
|
316
|
+
moonshotAi?: {
|
|
317
|
+
apiKey?: string;
|
|
318
|
+
baseURL?: string;
|
|
319
|
+
};
|
|
292
320
|
morph?: {
|
|
293
321
|
apiKey?: string;
|
|
294
322
|
baseURL?: string;
|
|
295
323
|
};
|
|
324
|
+
nebius?: {
|
|
325
|
+
apiKey?: string;
|
|
326
|
+
baseURL?: string;
|
|
327
|
+
};
|
|
296
328
|
neuralwatt?: {
|
|
297
329
|
apiKey?: string;
|
|
298
330
|
baseURL?: string;
|
|
@@ -313,6 +345,10 @@ export type NeurolinkCredentials = {
|
|
|
313
345
|
apiKey?: string;
|
|
314
346
|
baseURL?: string;
|
|
315
347
|
};
|
|
348
|
+
primeIntellect?: {
|
|
349
|
+
apiKey?: string;
|
|
350
|
+
baseURL?: string;
|
|
351
|
+
};
|
|
316
352
|
sambanova?: {
|
|
317
353
|
apiKey?: string;
|
|
318
354
|
baseURL?: string;
|
|
@@ -321,22 +357,66 @@ export type NeurolinkCredentials = {
|
|
|
321
357
|
apiKey?: string;
|
|
322
358
|
baseURL?: string;
|
|
323
359
|
};
|
|
360
|
+
scaleway?: {
|
|
361
|
+
apiKey?: string;
|
|
362
|
+
baseURL?: string;
|
|
363
|
+
};
|
|
364
|
+
siliconflow?: {
|
|
365
|
+
apiKey?: string;
|
|
366
|
+
baseURL?: string;
|
|
367
|
+
};
|
|
368
|
+
stepfun?: {
|
|
369
|
+
apiKey?: string;
|
|
370
|
+
baseURL?: string;
|
|
371
|
+
};
|
|
372
|
+
subconscious?: {
|
|
373
|
+
apiKey?: string;
|
|
374
|
+
baseURL?: string;
|
|
375
|
+
};
|
|
324
376
|
synthetic?: {
|
|
325
377
|
apiKey?: string;
|
|
326
378
|
baseURL?: string;
|
|
327
379
|
};
|
|
380
|
+
tinfoil?: {
|
|
381
|
+
apiKey?: string;
|
|
382
|
+
baseURL?: string;
|
|
383
|
+
};
|
|
328
384
|
together?: {
|
|
329
385
|
apiKey?: string;
|
|
330
386
|
baseURL?: string;
|
|
331
387
|
};
|
|
388
|
+
umansAi?: {
|
|
389
|
+
apiKey?: string;
|
|
390
|
+
baseURL?: string;
|
|
391
|
+
};
|
|
332
392
|
upstage?: {
|
|
333
393
|
apiKey?: string;
|
|
334
394
|
baseURL?: string;
|
|
335
395
|
};
|
|
396
|
+
veniceAi?: {
|
|
397
|
+
apiKey?: string;
|
|
398
|
+
baseURL?: string;
|
|
399
|
+
};
|
|
400
|
+
vultrInference?: {
|
|
401
|
+
apiKey?: string;
|
|
402
|
+
baseURL?: string;
|
|
403
|
+
};
|
|
404
|
+
wafer?: {
|
|
405
|
+
apiKey?: string;
|
|
406
|
+
baseURL?: string;
|
|
407
|
+
};
|
|
408
|
+
wandbInference?: {
|
|
409
|
+
apiKey?: string;
|
|
410
|
+
baseURL?: string;
|
|
411
|
+
};
|
|
336
412
|
xai?: {
|
|
337
413
|
apiKey?: string;
|
|
338
414
|
baseURL?: string;
|
|
339
415
|
};
|
|
416
|
+
zAi?: {
|
|
417
|
+
apiKey?: string;
|
|
418
|
+
baseURL?: string;
|
|
419
|
+
};
|
|
340
420
|
cohere?: {
|
|
341
421
|
apiKey?: string;
|
|
342
422
|
baseURL?: string;
|