@jambonz/llm 0.5.5 → 0.5.6
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 +97 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +97 -0
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +96 -0
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.js +96 -0
- package/dist/test-kit/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -31,7 +31,7 @@ interface RawCredential {
|
|
|
31
31
|
/**
|
|
32
32
|
* Convert a vendor + raw credential into an `AuthSpec` discriminated union member.
|
|
33
33
|
*
|
|
34
|
-
* Supported vendors: openai, deepseek, baseten, moonshot, zai, anthropic, google,
|
|
34
|
+
* Supported vendors: openai, deepseek, baseten, moonshot, zai, xai, anthropic, google,
|
|
35
35
|
* vertex (alias for vertex-gemini + vertex-openai — both accept the same auth shape),
|
|
36
36
|
* vertex-gemini, vertex-openai, bedrock, azure-openai, groq, huggingface.
|
|
37
37
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface RawCredential {
|
|
|
31
31
|
/**
|
|
32
32
|
* Convert a vendor + raw credential into an `AuthSpec` discriminated union member.
|
|
33
33
|
*
|
|
34
|
-
* Supported vendors: openai, deepseek, baseten, moonshot, zai, anthropic, google,
|
|
34
|
+
* Supported vendors: openai, deepseek, baseten, moonshot, zai, xai, anthropic, google,
|
|
35
35
|
* vertex (alias for vertex-gemini + vertex-openai — both accept the same auth shape),
|
|
36
36
|
* vertex-gemini, vertex-openai, bedrock, azure-openai, groq, huggingface.
|
|
37
37
|
*
|
package/dist/index.js
CHANGED
|
@@ -944,6 +944,101 @@ var zaiFactory = {
|
|
|
944
944
|
manifest: zaiManifest,
|
|
945
945
|
create: () => new ZaiAdapter()
|
|
946
946
|
};
|
|
947
|
+
var xaiManifest = {
|
|
948
|
+
vendor: "xai",
|
|
949
|
+
displayName: "xAI (Grok)",
|
|
950
|
+
authKinds: [
|
|
951
|
+
{
|
|
952
|
+
kind: "apiKey",
|
|
953
|
+
displayName: "API Key",
|
|
954
|
+
fields: [
|
|
955
|
+
{
|
|
956
|
+
name: "apiKey",
|
|
957
|
+
label: "API Key",
|
|
958
|
+
type: "password",
|
|
959
|
+
required: true,
|
|
960
|
+
help: "Get an API key from https://console.x.ai/team/default/api-keys"
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
name: "baseURL",
|
|
964
|
+
label: "Base URL",
|
|
965
|
+
type: "url",
|
|
966
|
+
required: false,
|
|
967
|
+
default: "https://api.x.ai/v1",
|
|
968
|
+
help: "Override for proxy endpoints. Defaults to xAI production."
|
|
969
|
+
}
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
],
|
|
973
|
+
knownModels: [
|
|
974
|
+
{
|
|
975
|
+
id: "grok-4.3",
|
|
976
|
+
displayName: "Grok 4.3",
|
|
977
|
+
capabilities: {
|
|
978
|
+
streaming: true,
|
|
979
|
+
tools: true,
|
|
980
|
+
vision: true,
|
|
981
|
+
systemPrompt: true,
|
|
982
|
+
maxContextTokens: 1e6
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
id: "grok-4.20-0309-reasoning",
|
|
987
|
+
displayName: "Grok 4.20 (Reasoning)",
|
|
988
|
+
capabilities: {
|
|
989
|
+
streaming: true,
|
|
990
|
+
tools: true,
|
|
991
|
+
vision: true,
|
|
992
|
+
systemPrompt: true,
|
|
993
|
+
maxContextTokens: 1e6
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
id: "grok-4.20-0309-non-reasoning",
|
|
998
|
+
displayName: "Grok 4.20 (Non-Reasoning)",
|
|
999
|
+
capabilities: {
|
|
1000
|
+
streaming: true,
|
|
1001
|
+
tools: true,
|
|
1002
|
+
vision: true,
|
|
1003
|
+
systemPrompt: true,
|
|
1004
|
+
maxContextTokens: 1e6
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
id: "grok-4.20-multi-agent-0309",
|
|
1009
|
+
displayName: "Grok 4.20 Multi-Agent",
|
|
1010
|
+
capabilities: {
|
|
1011
|
+
streaming: true,
|
|
1012
|
+
tools: true,
|
|
1013
|
+
vision: true,
|
|
1014
|
+
systemPrompt: true,
|
|
1015
|
+
maxContextTokens: 1e6
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
],
|
|
1019
|
+
supportsModelListing: true,
|
|
1020
|
+
docsUrl: "https://docs.x.ai/"
|
|
1021
|
+
};
|
|
1022
|
+
var XaiAdapter = class extends OpenAIAdapter {
|
|
1023
|
+
vendor = xaiManifest.vendor;
|
|
1024
|
+
init(auth, client) {
|
|
1025
|
+
super.init(
|
|
1026
|
+
{
|
|
1027
|
+
...auth,
|
|
1028
|
+
baseURL: auth.baseURL ?? "https://api.x.ai/v1"
|
|
1029
|
+
},
|
|
1030
|
+
client
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
knownModels() {
|
|
1034
|
+
return xaiManifest.knownModels;
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
var xaiFactory = {
|
|
1038
|
+
vendor: xaiManifest.vendor,
|
|
1039
|
+
manifest: xaiManifest,
|
|
1040
|
+
create: () => new XaiAdapter()
|
|
1041
|
+
};
|
|
947
1042
|
|
|
948
1043
|
// src/adapters/anthropic/adapter.ts
|
|
949
1044
|
import Anthropic from "@anthropic-ai/sdk";
|
|
@@ -3125,6 +3220,7 @@ registerAdapter(deepseekFactory);
|
|
|
3125
3220
|
registerAdapter(basetenFactory);
|
|
3126
3221
|
registerAdapter(moonshotFactory);
|
|
3127
3222
|
registerAdapter(zaiFactory);
|
|
3223
|
+
registerAdapter(xaiFactory);
|
|
3128
3224
|
registerAdapter(anthropicFactory);
|
|
3129
3225
|
registerAdapter(googleFactory);
|
|
3130
3226
|
registerAdapter(vertexGeminiFactory);
|
|
@@ -3143,6 +3239,7 @@ function normalizeAuth(vendor, raw) {
|
|
|
3143
3239
|
case "huggingface":
|
|
3144
3240
|
case "moonshot":
|
|
3145
3241
|
case "zai":
|
|
3242
|
+
case "xai":
|
|
3146
3243
|
return requireApiKey(vendor, raw);
|
|
3147
3244
|
case "deepseek":
|
|
3148
3245
|
return {
|