@easynet/agent-llm 1.0.46 → 1.0.48

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.d.ts CHANGED
@@ -16,6 +16,8 @@ export type { LoadLlmConfigOptions } from "./config/loader.js";
16
16
  export { registerChatModelProvider, getChatModelFactory } from "./registry/chat-model.js";
17
17
  export type { ChatModelFactory } from "./registry/chat-model.js";
18
18
  export { messageContentToString, exitWithError } from "./cli/utils.js";
19
+ export { createModelHub } from "./model/hub.js";
20
+ export type { CreateModelHubOptions, ModelHub, EmbedRequest, EmbedResult } from "./model/hub.js";
19
21
  export type { LLMType, LLMConfig, AgentConfigLlmSection, ILLMExtension } from "./types.js";
20
22
  export { AGENT_LLM_PROVIDER_FIELD } from "./types.js";
21
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAGlF,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAE,yBAAyB,EA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E,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGjG,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -31,12 +31,18 @@ async function getDefaultLlmConfig(options = {}) {
31
31
  const defaultConfig = configs.find((c) => c.id === defaultId) ?? configs[0] ?? null;
32
32
  return defaultConfig;
33
33
  }
34
+
35
+ // src/model/hub.ts
36
+ import {
37
+ createModelHub
38
+ } from "@easynet/agent-common";
34
39
  export {
35
40
  AGENT_LLM_PROVIDER_FIELD,
36
41
  applyToolChoiceAuto,
37
42
  createAgentLlM,
38
43
  createChatModelFromLlmConfig,
39
44
  createChatOpenAI,
45
+ createModelHub,
40
46
  exitWithError,
41
47
  getChatModelFactory,
42
48
  getDefaultLlmConfig,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/api/get-default-llm-config.ts","../src/config/parser.ts"],"sourcesContent":["/**\n * Load llm.yaml, resolve npm providers, and return the default LLMConfig.\n * For use by CLIs (e.g. wallee-llm) that need config without creating a model.\n */\n\nimport { join } from \"node:path\";\nimport { loadLlmConfig } from \"../config/loader.js\";\nimport { parseLlmSection } from \"../config/parser.js\";\nimport { resolveLlmSectionWithNpm } from \"../extensions/npm-protocol.js\";\nimport type { LLMConfig } from \"../types.js\";\n\nexport interface GetDefaultLlmConfigOptions {\n /** Path to llm.yaml. Default: process.cwd() + \"/llm.yaml\" */\n configPath?: string;\n /** Install npm provider packages if missing. Default true. */\n installNpmIfMissing?: boolean;\n}\n\n/**\n * Returns the default LLM config from llm.yaml (after resolving npm: providers), or null if no config file.\n */\nexport async function getDefaultLlmConfig(\n options: GetDefaultLlmConfigOptions = {}\n): Promise<LLMConfig | null> {\n const configPath = options.configPath ?? join(process.cwd(), \"llm.yaml\");\n const llmSection = loadLlmConfig(configPath);\n if (llmSection == null) return null;\n\n const resolved = await resolveLlmSectionWithNpm(llmSection, {\n installNpmIfMissing: options.installNpmIfMissing !== false,\n cwd: process.cwd(),\n });\n\n const { defaultId, configs } = parseLlmSection(resolved);\n const defaultConfig = configs.find((c: LLMConfig) => c.id === defaultId) ?? configs[0] ?? null;\n return defaultConfig;\n}\n","/**\n * Re-export LLM section parser from agent-common.\n */\n\nexport { parseLlmSection } from \"@easynet/agent-common\";\n"],"mappings":";;;;;;;;;;;;;;;AAKA,SAAS,YAAY;;;ACDrB,SAAS,uBAAuB;;;ADiBhC,eAAsB,oBACpB,UAAsC,CAAC,GACZ;AAC3B,QAAM,aAAa,QAAQ,cAAc,KAAK,QAAQ,IAAI,GAAG,UAAU;AACvE,QAAM,aAAa,cAAc,UAAU;AAC3C,MAAI,cAAc,KAAM,QAAO;AAE/B,QAAM,WAAW,MAAM,yBAAyB,YAAY;AAAA,IAC1D,qBAAqB,QAAQ,wBAAwB;AAAA,IACrD,KAAK,QAAQ,IAAI;AAAA,EACnB,CAAC;AAED,QAAM,EAAE,WAAW,QAAQ,IAAI,gBAAgB,QAAQ;AACvD,QAAM,gBAAgB,QAAQ,KAAK,CAAC,MAAiB,EAAE,OAAO,SAAS,KAAK,QAAQ,CAAC,KAAK;AAC1F,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/api/get-default-llm-config.ts","../src/config/parser.ts","../src/model/hub.ts"],"sourcesContent":["/**\n * Load llm.yaml, resolve npm providers, and return the default LLMConfig.\n * For use by CLIs (e.g. wallee-llm) that need config without creating a model.\n */\n\nimport { join } from \"node:path\";\nimport { loadLlmConfig } from \"../config/loader.js\";\nimport { parseLlmSection } from \"../config/parser.js\";\nimport { resolveLlmSectionWithNpm } from \"../extensions/npm-protocol.js\";\nimport type { LLMConfig } from \"../types.js\";\n\nexport interface GetDefaultLlmConfigOptions {\n /** Path to llm.yaml. Default: process.cwd() + \"/llm.yaml\" */\n configPath?: string;\n /** Install npm provider packages if missing. Default true. */\n installNpmIfMissing?: boolean;\n}\n\n/**\n * Returns the default LLM config from llm.yaml (after resolving npm: providers), or null if no config file.\n */\nexport async function getDefaultLlmConfig(\n options: GetDefaultLlmConfigOptions = {}\n): Promise<LLMConfig | null> {\n const configPath = options.configPath ?? join(process.cwd(), \"llm.yaml\");\n const llmSection = loadLlmConfig(configPath);\n if (llmSection == null) return null;\n\n const resolved = await resolveLlmSectionWithNpm(llmSection, {\n installNpmIfMissing: options.installNpmIfMissing !== false,\n cwd: process.cwd(),\n });\n\n const { defaultId, configs } = parseLlmSection(resolved);\n const defaultConfig = configs.find((c: LLMConfig) => c.id === defaultId) ?? configs[0] ?? null;\n return defaultConfig;\n}\n","/**\n * Re-export LLM section parser from agent-common.\n */\n\nexport { parseLlmSection } from \"@easynet/agent-common\";\n","/**\n * Re-export ModelHub from agent-common so other packages can use it without LangChain.\n * agent-llm keeps LangChain APIs (createChatModelFromLlmConfig, createAgentLlM) separately.\n */\n\nexport {\n createModelHub,\n type CreateModelHubOptions,\n type ModelHub,\n type ChatGenerateRequest,\n type ChatGenerateResult,\n type EmbedRequest,\n type EmbedResult,\n} from \"@easynet/agent-common\";\n"],"mappings":";;;;;;;;;;;;;;;AAKA,SAAS,YAAY;;;ACDrB,SAAS,uBAAuB;;;ADiBhC,eAAsB,oBACpB,UAAsC,CAAC,GACZ;AAC3B,QAAM,aAAa,QAAQ,cAAc,KAAK,QAAQ,IAAI,GAAG,UAAU;AACvE,QAAM,aAAa,cAAc,UAAU;AAC3C,MAAI,cAAc,KAAM,QAAO;AAE/B,QAAM,WAAW,MAAM,yBAAyB,YAAY;AAAA,IAC1D,qBAAqB,QAAQ,wBAAwB;AAAA,IACrD,KAAK,QAAQ,IAAI;AAAA,EACnB,CAAC;AAED,QAAM,EAAE,WAAW,QAAQ,IAAI,gBAAgB,QAAQ;AACvD,QAAM,gBAAgB,QAAQ,KAAK,CAAC,MAAiB,EAAE,OAAO,SAAS,KAAK,QAAQ,CAAC,KAAK;AAC1F,SAAO;AACT;;;AE/BA;AAAA,EACE;AAAA,OAOK;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easynet/agent-llm",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
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": {
@@ -20,7 +20,7 @@
20
20
  "typecheck": "tsc --noEmit"
21
21
  },
22
22
  "dependencies": {
23
- "@easynet/agent-common": "latest",
23
+ "@easynet/agent-common": "*",
24
24
  "axios": "^1.7.0",
25
25
  "yaml": "^2.7.0",
26
26
  "zod": "^3.23.0"