@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.
@@ -937,6 +937,101 @@ var zaiFactory = {
937
937
  manifest: zaiManifest,
938
938
  create: () => new ZaiAdapter()
939
939
  };
940
+ var xaiManifest = {
941
+ vendor: "xai",
942
+ displayName: "xAI (Grok)",
943
+ authKinds: [
944
+ {
945
+ kind: "apiKey",
946
+ displayName: "API Key",
947
+ fields: [
948
+ {
949
+ name: "apiKey",
950
+ label: "API Key",
951
+ type: "password",
952
+ required: true,
953
+ help: "Get an API key from https://console.x.ai/team/default/api-keys"
954
+ },
955
+ {
956
+ name: "baseURL",
957
+ label: "Base URL",
958
+ type: "url",
959
+ required: false,
960
+ default: "https://api.x.ai/v1",
961
+ help: "Override for proxy endpoints. Defaults to xAI production."
962
+ }
963
+ ]
964
+ }
965
+ ],
966
+ knownModels: [
967
+ {
968
+ id: "grok-4.3",
969
+ displayName: "Grok 4.3",
970
+ capabilities: {
971
+ streaming: true,
972
+ tools: true,
973
+ vision: true,
974
+ systemPrompt: true,
975
+ maxContextTokens: 1e6
976
+ }
977
+ },
978
+ {
979
+ id: "grok-4.20-0309-reasoning",
980
+ displayName: "Grok 4.20 (Reasoning)",
981
+ capabilities: {
982
+ streaming: true,
983
+ tools: true,
984
+ vision: true,
985
+ systemPrompt: true,
986
+ maxContextTokens: 1e6
987
+ }
988
+ },
989
+ {
990
+ id: "grok-4.20-0309-non-reasoning",
991
+ displayName: "Grok 4.20 (Non-Reasoning)",
992
+ capabilities: {
993
+ streaming: true,
994
+ tools: true,
995
+ vision: true,
996
+ systemPrompt: true,
997
+ maxContextTokens: 1e6
998
+ }
999
+ },
1000
+ {
1001
+ id: "grok-4.20-multi-agent-0309",
1002
+ displayName: "Grok 4.20 Multi-Agent",
1003
+ capabilities: {
1004
+ streaming: true,
1005
+ tools: true,
1006
+ vision: true,
1007
+ systemPrompt: true,
1008
+ maxContextTokens: 1e6
1009
+ }
1010
+ }
1011
+ ],
1012
+ supportsModelListing: true,
1013
+ docsUrl: "https://docs.x.ai/"
1014
+ };
1015
+ var XaiAdapter = class extends OpenAIAdapter {
1016
+ vendor = xaiManifest.vendor;
1017
+ init(auth, client) {
1018
+ super.init(
1019
+ {
1020
+ ...auth,
1021
+ baseURL: auth.baseURL ?? "https://api.x.ai/v1"
1022
+ },
1023
+ client
1024
+ );
1025
+ }
1026
+ knownModels() {
1027
+ return xaiManifest.knownModels;
1028
+ }
1029
+ };
1030
+ var xaiFactory = {
1031
+ vendor: xaiManifest.vendor,
1032
+ manifest: xaiManifest,
1033
+ create: () => new XaiAdapter()
1034
+ };
940
1035
 
941
1036
  // src/adapters/anthropic/adapter.ts
942
1037
  import Anthropic from "@anthropic-ai/sdk";
@@ -3118,6 +3213,7 @@ registerAdapter(deepseekFactory);
3118
3213
  registerAdapter(basetenFactory);
3119
3214
  registerAdapter(moonshotFactory);
3120
3215
  registerAdapter(zaiFactory);
3216
+ registerAdapter(xaiFactory);
3121
3217
  registerAdapter(anthropicFactory);
3122
3218
  registerAdapter(googleFactory);
3123
3219
  registerAdapter(vertexGeminiFactory);