@easynet/agent-model 1.0.86 → 1.0.88

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/README.md CHANGED
@@ -4,24 +4,12 @@
4
4
 
5
5
  `@easynet/agent-model` loads model configuration and registers the chat model, embedding model, and optional vision model into the default `AgentContext`.
6
6
 
7
- ## Exposed SDK
7
+ ## Exposed Interfaces
8
8
 
9
9
  | Export | Type | Purpose |
10
10
  | --- | --- | --- |
11
- | `createAgentModel` | function | Loads model config and registers models into the default `AgentContext`. |
12
- | `CreateAgentModelOptions` | type | Options for selecting and loading model configuration. |
13
-
14
- ## Usage
15
-
16
- ```bash
17
- npm i @easynet/agent-model
18
- ```
19
-
20
- ```ts
21
- import { createAgentModel } from "@easynet/agent-model";
22
-
23
- await createAgentModel("./config/model.yaml");
24
- ```
11
+ | `createAgentModel` | function | Load model config and register models into the default `AgentContext`. |
12
+ | `CreateAgentModelOptions` | type | Options for model initialization. |
25
13
 
26
14
  ## Configuration
27
15
 
@@ -39,14 +27,12 @@ spec:
39
27
  provider: openai
40
28
  base_url: http://localhost:11434/v1
41
29
  model: qwen3:0.6b
42
-
43
30
  embed:
44
31
  default: local
45
32
  local:
46
33
  provider: openai
47
34
  base_url: http://localhost:11434/v1
48
35
  model: qwen3-embedding:0.6b
49
- apiKey: not-needed
50
36
  ```
51
37
 
52
38
  Key fields:
@@ -54,5 +40,16 @@ Key fields:
54
40
  - `spec.llm`: chat models
55
41
  - `spec.embed`: embedding models
56
42
  - `spec.vlm`: optional vision models
57
- - `default`: default model alias
58
- - `provider`, `base_url`, `model`: provider type, service URL, and model name
43
+ - `default`: default alias
44
+
45
+ ## Usage
46
+
47
+ ```bash
48
+ npm i @easynet/agent-model
49
+ ```
50
+
51
+ ```ts
52
+ import { createAgentModel } from "@easynet/agent-model";
53
+
54
+ await createAgentModel("./config/model.yaml");
55
+ ```
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "emitDeclarationOnly": true,
5
+ "outDir": "../../dist"
6
+ },
7
+ "include": ["../../src/**/*.ts"],
8
+ "exclude": ["../../node_modules", "../../**/*.test.ts"]
9
+ }
@@ -0,0 +1,20 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: [
5
+ "src/index.ts",
6
+ "src/cli/index.ts",
7
+ "src/config/index.ts",
8
+ "src/langchain/index.ts",
9
+ "src/model/index.ts",
10
+ "src/registry/index.ts",
11
+ "src/extensions/index.ts",
12
+ "src/connectivity/index.ts",
13
+ ],
14
+ format: ["esm"],
15
+ dts: false,
16
+ sourcemap: true,
17
+ clean: true,
18
+ outDir: "dist",
19
+ target: "node18",
20
+ });
@@ -0,0 +1,19 @@
1
+ import { defineConfig } from "vitest/config";
2
+ import { resolve, dirname } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+
5
+ const root = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
6
+
7
+ export default defineConfig({
8
+ test: {
9
+ globals: true,
10
+ environment: "node",
11
+ include: ["test/**/*.test.ts"],
12
+ testTimeout: 15_000,
13
+ },
14
+ resolve: {
15
+ alias: {
16
+ "@": resolve(root, "src"),
17
+ },
18
+ },
19
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easynet/agent-model",
3
- "version": "1.0.86",
3
+ "version": "1.0.88",
4
4
  "description": "Agent LLM: multi-provider, multi-model, simple chat/image API. Consumes agent.yaml llm section.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,10 +16,10 @@
16
16
  },
17
17
  "scripts": {
18
18
  "preinstall": "node -e \"const fs=require('fs'); const {execSync}=require('child_process'); if (fs.existsSync('scripts/resolve-deps.js')) { execSync('node scripts/resolve-deps.js', { stdio: 'inherit' }); } else { console.log('Skipping resolve-deps for published package'); }\"",
19
- "build": "tsup && tsc -p tsconfig.dts.json",
19
+ "build": "tsup --config config/build/tsup.config.ts && tsc -p config/build/tsconfig.dts.json",
20
20
  "dev": "tsup --watch",
21
- "test": "vitest run",
22
- "test:watch": "vitest",
21
+ "test": "vitest run --config config/build/vitest.config.ts",
22
+ "test:watch": "vitest --config config/build/vitest.config.ts",
23
23
  "test:unit": "vitest run test/unit",
24
24
  "test:integration": "vitest run test/integration",
25
25
  "test:live": "vitest run test/integration/llm-live.test.ts",