@alumnium/xai 0.0.0-stage → 0.24.0-alpha.2

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Alexey Rodionov, Tatiana Shepeleva
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
1
+ # @alumnium/xai
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Alumnium xAI LLM provider. See [the main `alumnium` package page](https://www.npmjs.com/package/alumnium) for more details.
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "@alumnium/xai",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.24.0-alpha.2",
4
+ "description": "Alumnium xAI LLM provider",
5
+ "license": "MIT",
6
+ "author": "Alex Rodionov <p0deje@gmail.com>",
7
+ "contributors": [
8
+ "Alex Rodionov <p0deje@gmail.com>",
9
+ "Sasha Koss <koss@nocorp.me>",
10
+ "Tatiana Shepeleva <tati.shep@gmail.com>"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/alumnium-hq/alumnium.git"
15
+ },
16
+ "files": [
17
+ "src",
18
+ "README.md",
19
+ "LICENSE.md"
20
+ ],
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "import": {
25
+ "types": "./src/index.d.ts",
26
+ "default": "./src/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./src/index.d.ts",
30
+ "default": "./src/index.cjs"
31
+ }
32
+ }
33
+ },
34
+ "dependencies": {
35
+ "@ai-sdk/provider": "^4.0.7",
36
+ "@ai-sdk/xai": "^4.0.43",
37
+ "@alumnium/core": "0.24.0-alpha.2",
38
+ "ai": "^7.0.78"
39
+ }
40
+ }
package/src/index.cjs ADDED
@@ -0,0 +1,72 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ function __accessProp(key) {
6
+ return this[key];
7
+ }
8
+ var __toCommonJS = (from) => {
9
+ var entry = (__moduleCache ??= new WeakMap()).get(from),
10
+ desc;
11
+ if (entry) return entry;
12
+ entry = __defProp({}, "__esModule", { value: true });
13
+ if ((from && typeof from === "object") || typeof from === "function") {
14
+ for (var key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(entry, key))
16
+ __defProp(entry, key, {
17
+ get: __accessProp.bind(from, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
19
+ });
20
+ }
21
+ __moduleCache.set(from, entry);
22
+ return entry;
23
+ };
24
+ var __moduleCache;
25
+ var __returnValue = (v) => v;
26
+ function __exportSetter(name, newValue) {
27
+ this[name] = __returnValue.bind(null, newValue);
28
+ }
29
+ var __export = (target, all) => {
30
+ for (var name in all)
31
+ __defProp(target, name, {
32
+ get: all[name],
33
+ enumerable: true,
34
+ configurable: true,
35
+ set: __exportSetter.bind(all, name),
36
+ });
37
+ };
38
+
39
+ // xai/src/index.ts
40
+ var exports_src = {};
41
+ __export(exports_src, {
42
+ createXAiLlm: () => createXAiLlm,
43
+ xAiProviders: () => xAiProviders,
44
+ });
45
+ module.exports = __toCommonJS(exports_src);
46
+
47
+ // xai/src/llm/xAiProviders.ts
48
+ var import_xai = require("@ai-sdk/xai");
49
+ var import_internal = require("@alumnium/core/internal");
50
+ var logger = import_internal.Logger.get(
51
+ "packages/typescript/xai/src/llm/xAiProviders.ts",
52
+ );
53
+ function createXAiLlm(model) {
54
+ logger.debug(`Creating XAI LLM with model ${model.name}`);
55
+ return import_internal.withCallDefaults(
56
+ import_xai.createXai(
57
+ import_internal.apiKeyField(import_internal.Env.XAI_API_KEY),
58
+ )(model.name),
59
+ {
60
+ temperature: 0,
61
+ reasoning: "low",
62
+ providerOptions: { xai: { reasoningSummary: "auto" } },
63
+ },
64
+ );
65
+ }
66
+ var xAiProviders = {
67
+ xai: createXAiLlm,
68
+ };
69
+ import_internal.LlmFactory.register(xAiProviders);
70
+
71
+ //# debugId=00900882722E9A3664756E2164756E21
72
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../xai/src/llm/xAiProviders.ts"],
4
+ "sourcesContent": [
5
+ "import type { LanguageModelV4 } from \"@ai-sdk/provider\";\nimport { createXai } from \"@ai-sdk/xai\";\nimport {\n apiKeyField,\n LlmFactory,\n withCallDefaults,\n Env,\n Logger,\n type Model,\n} from \"@alumnium/core/internal\";\n\nconst logger = Logger.get(\"packages/typescript/xai/src/llm/xAiProviders.ts\");\n\nexport function createXAiLlm(model: Model): LanguageModelV4 {\n logger.debug(`Creating XAI LLM with model ${model.name}`);\n return withCallDefaults(createXai(apiKeyField(Env.XAI_API_KEY))(model.name), {\n temperature: 0,\n reasoning: \"low\",\n providerOptions: { xai: { reasoningSummary: \"auto\" } },\n });\n}\n\nexport const xAiProviders: LlmFactory.Providers = {\n xai: createXAiLlm,\n};\n\nLlmFactory.register(xAiProviders);\n"
6
+ ],
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAC0B,IAA1B;AAQO,IAPP;AASA,IAAM,SAAS,uBAAO,IAAI,iDAAiD;AAEpE,SAAS,YAAY,CAAC,OAA+B;AAAA,EAC1D,OAAO,MAAM,+BAA+B,MAAM,MAAM;AAAA,EACxD,OAAO,iCAAiB,qBAAU,4BAAY,oBAAI,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG;AAAA,IAC3E,aAAa;AAAA,IACb,WAAW;AAAA,IACX,iBAAiB,EAAE,KAAK,EAAE,kBAAkB,OAAO,EAAE;AAAA,EACvD,CAAC;AAAA;AAGI,IAAM,eAAqC;AAAA,EAChD,KAAK;AACP;AAEA,2BAAW,SAAS,YAAY;",
8
+ "debugId": "00900882722E9A3664756E2164756E21",
9
+ "names": []
10
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./llm/xAiProviders.ts";
package/src/index.js ADDED
@@ -0,0 +1,26 @@
1
+ // xai/src/llm/xAiProviders.ts
2
+ import { createXai } from "@ai-sdk/xai";
3
+ import {
4
+ apiKeyField,
5
+ LlmFactory,
6
+ withCallDefaults,
7
+ Env,
8
+ Logger,
9
+ } from "@alumnium/core/internal";
10
+ var logger = Logger.get("packages/typescript/xai/src/llm/xAiProviders.ts");
11
+ function createXAiLlm(model) {
12
+ logger.debug(`Creating XAI LLM with model ${model.name}`);
13
+ return withCallDefaults(createXai(apiKeyField(Env.XAI_API_KEY))(model.name), {
14
+ temperature: 0,
15
+ reasoning: "low",
16
+ providerOptions: { xai: { reasoningSummary: "auto" } },
17
+ });
18
+ }
19
+ var xAiProviders = {
20
+ xai: createXAiLlm,
21
+ };
22
+ LlmFactory.register(xAiProviders);
23
+ export { createXAiLlm, xAiProviders };
24
+
25
+ //# debugId=3F0EAF7E53FDDEBF64756E2164756E21
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../xai/src/llm/xAiProviders.ts"],
4
+ "sourcesContent": [
5
+ "import type { LanguageModelV4 } from \"@ai-sdk/provider\";\nimport { createXai } from \"@ai-sdk/xai\";\nimport {\n apiKeyField,\n LlmFactory,\n withCallDefaults,\n Env,\n Logger,\n type Model,\n} from \"@alumnium/core/internal\";\n\nconst logger = Logger.get(\"packages/typescript/xai/src/llm/xAiProviders.ts\");\n\nexport function createXAiLlm(model: Model): LanguageModelV4 {\n logger.debug(`Creating XAI LLM with model ${model.name}`);\n return withCallDefaults(createXai(apiKeyField(Env.XAI_API_KEY))(model.name), {\n temperature: 0,\n reasoning: \"low\",\n providerOptions: { xai: { reasoningSummary: \"auto\" } },\n });\n}\n\nexport const xAiProviders: LlmFactory.Providers = {\n xai: createXAiLlm,\n};\n\nLlmFactory.register(xAiProviders);\n"
6
+ ],
7
+ "mappings": ";AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,IAAM,SAAS,OAAO,IAAI,iDAAiD;AAEpE,SAAS,YAAY,CAAC,OAA+B;AAAA,EAC1D,OAAO,MAAM,+BAA+B,MAAM,MAAM;AAAA,EACxD,OAAO,iBAAiB,UAAU,YAAY,IAAI,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG;AAAA,IAC3E,aAAa;AAAA,IACb,WAAW;AAAA,IACX,iBAAiB,EAAE,KAAK,EAAE,kBAAkB,OAAO,EAAE;AAAA,EACvD,CAAC;AAAA;AAGI,IAAM,eAAqC;AAAA,EAChD,KAAK;AACP;AAEA,WAAW,SAAS,YAAY;",
8
+ "debugId": "3F0EAF7E53FDDEBF64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,4 @@
1
+ import type { LanguageModelV4 } from "@ai-sdk/provider";
2
+ import { LlmFactory, type Model } from "@alumnium/core/internal";
3
+ export declare function createXAiLlm(model: Model): LanguageModelV4;
4
+ export declare const xAiProviders: LlmFactory.Providers;