@jambonz/llm 0.5.5 → 0.5.7
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/index.cjs +103 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +102 -0
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.d.cts +1 -1
- package/dist/test-kit/index.d.ts +1 -1
- package/dist/test-kit/index.js +102 -0
- package/dist/test-kit/index.js.map +1 -1
- package/dist/{types-BEgQaQIb.d.cts → types-rZZBXYhB.d.cts} +10 -0
- package/dist/{types-BEgQaQIb.d.ts → types-rZZBXYhB.d.ts} +10 -0
- package/package.json +1 -1
package/dist/test-kit/index.cjs
CHANGED
|
@@ -117,6 +117,12 @@ async function* streamFromOpenAI(client, req, options) {
|
|
|
117
117
|
const param = options.tokensParam ?? (needsMaxCompletionTokens(req.model) ? "max_completion_tokens" : "max_tokens");
|
|
118
118
|
body[param] = effectiveMaxTokens;
|
|
119
119
|
}
|
|
120
|
+
if (req.providerParams) {
|
|
121
|
+
const bodyRecord = body;
|
|
122
|
+
for (const [key, value] of Object.entries(req.providerParams)) {
|
|
123
|
+
if (!(key in bodyRecord)) bodyRecord[key] = value;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
120
126
|
const t0 = process.hrtime.bigint();
|
|
121
127
|
let t1;
|
|
122
128
|
let t2;
|
|
@@ -976,6 +982,101 @@ var zaiFactory = {
|
|
|
976
982
|
manifest: zaiManifest,
|
|
977
983
|
create: () => new ZaiAdapter()
|
|
978
984
|
};
|
|
985
|
+
var xaiManifest = {
|
|
986
|
+
vendor: "xai",
|
|
987
|
+
displayName: "xAI (Grok)",
|
|
988
|
+
authKinds: [
|
|
989
|
+
{
|
|
990
|
+
kind: "apiKey",
|
|
991
|
+
displayName: "API Key",
|
|
992
|
+
fields: [
|
|
993
|
+
{
|
|
994
|
+
name: "apiKey",
|
|
995
|
+
label: "API Key",
|
|
996
|
+
type: "password",
|
|
997
|
+
required: true,
|
|
998
|
+
help: "Get an API key from https://console.x.ai/team/default/api-keys"
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
name: "baseURL",
|
|
1002
|
+
label: "Base URL",
|
|
1003
|
+
type: "url",
|
|
1004
|
+
required: false,
|
|
1005
|
+
default: "https://api.x.ai/v1",
|
|
1006
|
+
help: "Override for proxy endpoints. Defaults to xAI production."
|
|
1007
|
+
}
|
|
1008
|
+
]
|
|
1009
|
+
}
|
|
1010
|
+
],
|
|
1011
|
+
knownModels: [
|
|
1012
|
+
{
|
|
1013
|
+
id: "grok-4.3",
|
|
1014
|
+
displayName: "Grok 4.3",
|
|
1015
|
+
capabilities: {
|
|
1016
|
+
streaming: true,
|
|
1017
|
+
tools: true,
|
|
1018
|
+
vision: true,
|
|
1019
|
+
systemPrompt: true,
|
|
1020
|
+
maxContextTokens: 1e6
|
|
1021
|
+
}
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
id: "grok-4.20-0309-reasoning",
|
|
1025
|
+
displayName: "Grok 4.20 (Reasoning)",
|
|
1026
|
+
capabilities: {
|
|
1027
|
+
streaming: true,
|
|
1028
|
+
tools: true,
|
|
1029
|
+
vision: true,
|
|
1030
|
+
systemPrompt: true,
|
|
1031
|
+
maxContextTokens: 1e6
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
id: "grok-4.20-0309-non-reasoning",
|
|
1036
|
+
displayName: "Grok 4.20 (Non-Reasoning)",
|
|
1037
|
+
capabilities: {
|
|
1038
|
+
streaming: true,
|
|
1039
|
+
tools: true,
|
|
1040
|
+
vision: true,
|
|
1041
|
+
systemPrompt: true,
|
|
1042
|
+
maxContextTokens: 1e6
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
id: "grok-4.20-multi-agent-0309",
|
|
1047
|
+
displayName: "Grok 4.20 Multi-Agent",
|
|
1048
|
+
capabilities: {
|
|
1049
|
+
streaming: true,
|
|
1050
|
+
tools: true,
|
|
1051
|
+
vision: true,
|
|
1052
|
+
systemPrompt: true,
|
|
1053
|
+
maxContextTokens: 1e6
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
],
|
|
1057
|
+
supportsModelListing: true,
|
|
1058
|
+
docsUrl: "https://docs.x.ai/"
|
|
1059
|
+
};
|
|
1060
|
+
var XaiAdapter = class extends OpenAIAdapter {
|
|
1061
|
+
vendor = xaiManifest.vendor;
|
|
1062
|
+
init(auth, client) {
|
|
1063
|
+
super.init(
|
|
1064
|
+
{
|
|
1065
|
+
...auth,
|
|
1066
|
+
baseURL: auth.baseURL ?? "https://api.x.ai/v1"
|
|
1067
|
+
},
|
|
1068
|
+
client
|
|
1069
|
+
);
|
|
1070
|
+
}
|
|
1071
|
+
knownModels() {
|
|
1072
|
+
return xaiManifest.knownModels;
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
var xaiFactory = {
|
|
1076
|
+
vendor: xaiManifest.vendor,
|
|
1077
|
+
manifest: xaiManifest,
|
|
1078
|
+
create: () => new XaiAdapter()
|
|
1079
|
+
};
|
|
979
1080
|
|
|
980
1081
|
// src/adapters/anthropic/adapter.ts
|
|
981
1082
|
var import_sdk = __toESM(require("@anthropic-ai/sdk"), 1);
|
|
@@ -3151,6 +3252,7 @@ registerAdapter(deepseekFactory);
|
|
|
3151
3252
|
registerAdapter(basetenFactory);
|
|
3152
3253
|
registerAdapter(moonshotFactory);
|
|
3153
3254
|
registerAdapter(zaiFactory);
|
|
3255
|
+
registerAdapter(xaiFactory);
|
|
3154
3256
|
registerAdapter(anthropicFactory);
|
|
3155
3257
|
registerAdapter(googleFactory);
|
|
3156
3258
|
registerAdapter(vertexGeminiFactory);
|