@mcp-abap-adt/ollama-llm 26.0.0 → 28.0.0

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.
@@ -1,15 +1,26 @@
1
1
  /**
2
2
  * Ollama LLM Provider — extends OpenAI (Ollama exposes an OpenAI-compatible /v1 API).
3
3
  */
4
+ import type { IApiKeyCredential } from '@mcp-abap-adt/interfaces-auth';
4
5
  import type { IModelInfo, LLMProviderConfig } from '@mcp-abap-adt/llm-agent';
5
6
  import { OpenAIProvider } from '@mcp-abap-adt/openai-llm';
6
7
  export interface OllamaConfig extends LLMProviderConfig {
8
+ /**
9
+ * Optional, unlike the other three providers: a local Ollama server
10
+ * ignores it, though a gateway placed in front of it may still require
11
+ * one — the design replaces plain keys with typed credentials rather than
12
+ * removing the capability. Forwarded to `OpenAIProvider` through the
13
+ * `super({ ...config })` call below, unchanged.
14
+ */
15
+ credential?: IApiKeyCredential;
7
16
  model?: string;
8
17
  temperature?: number;
9
18
  maxTokens?: number;
10
19
  }
11
20
  export declare class OllamaProvider extends OpenAIProvider {
12
21
  protected readonly providerName: string;
22
+ /** Ollama's credential is optional — see `OllamaConfig.credential`. */
23
+ protected requiresCredential(): boolean;
13
24
  constructor(config: OllamaConfig);
14
25
  /**
15
26
  * Ollama always uses max_tokens.
@@ -1 +1 @@
1
- {"version":3,"file":"ollama-provider.d.ts","sourceRoot":"","sources":["../src/ollama-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAqB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAe,SAAQ,cAAc;IAChD,mBAA4B,YAAY,EAAE,MAAM,CAAY;gBAEhD,MAAM,EAAE,YAAY;IAShC;;OAEG;cACgB,kBAAkB,CACnC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIV,kBAAkB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAG3D"}
1
+ {"version":3,"file":"ollama-provider.d.ts","sourceRoot":"","sources":["../src/ollama-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAqB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE7E,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,cAAe,SAAQ,cAAc;IAChD,mBAA4B,YAAY,EAAE,MAAM,CAAY;IAE5D,uEAAuE;cACpD,kBAAkB,IAAI,OAAO;gBAIpC,MAAM,EAAE,YAAY;IAOhC;;OAEG;cACgB,kBAAkB,CACnC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIV,kBAAkB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAG3D"}
@@ -4,12 +4,14 @@
4
4
  import { OpenAIProvider } from '@mcp-abap-adt/openai-llm';
5
5
  export class OllamaProvider extends OpenAIProvider {
6
6
  providerName = 'Ollama';
7
+ /** Ollama's credential is optional — see `OllamaConfig.credential`. */
8
+ requiresCredential() {
9
+ return false;
10
+ }
7
11
  constructor(config) {
8
12
  super({
9
13
  ...config,
10
14
  baseURL: config.baseURL || 'http://localhost:11434/v1',
11
- // Ollama ignores the key, but the OpenAI SDK requires a non-empty value.
12
- apiKey: config.apiKey || 'ollama',
13
15
  });
14
16
  }
15
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ollama-provider.js","sourceRoot":"","sources":["../src/ollama-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAqB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAQ7E,MAAM,OAAO,cAAe,SAAQ,cAAc;IACpB,YAAY,GAAW,QAAQ,CAAC;IAE5D,YAAY,MAAoB;QAC9B,KAAK,CAAC;YACJ,GAAG,MAAM;YACT,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,2BAA2B;YACtD,yEAAyE;YACzE,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,QAAQ;SAClB,CAAC,CAAC;IACrB,CAAC;IAED;;OAEG;IACgB,kBAAkB,CACnC,MAAc,EACd,SAAiB;QAEjB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;IACnC,CAAC;IAEQ,KAAK,CAAC,kBAAkB;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
1
+ {"version":3,"file":"ollama-provider.js","sourceRoot":"","sources":["../src/ollama-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAqB,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAgB7E,MAAM,OAAO,cAAe,SAAQ,cAAc;IACpB,YAAY,GAAW,QAAQ,CAAC;IAE5D,uEAAuE;IACpD,kBAAkB;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,YAAY,MAAoB;QAC9B,KAAK,CAAC;YACJ,GAAG,MAAM;YACT,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,2BAA2B;SACvC,CAAC,CAAC;IACrB,CAAC;IAED;;OAEG;IACgB,kBAAkB,CACnC,MAAc,EACd,SAAiB;QAEjB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;IACnC,CAAC;IAEQ,KAAK,CAAC,kBAAkB;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcp-abap-adt/ollama-llm",
3
- "version": "26.0.0",
3
+ "version": "28.0.0",
4
4
  "description": "Ollama LLM provider (ILlm, extends OpenAIProvider — Ollama's OpenAI-compatible /v1 API) for @mcp-abap-adt/llm-agent.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,10 +23,6 @@
23
23
  "clean": "tsc -p tsconfig.json --clean",
24
24
  "test": "node --import tsx/esm --test --test-reporter=spec 'src/**/*.test.ts'"
25
25
  },
26
- "dependencies": {
27
- "@mcp-abap-adt/llm-agent": "^26.0.0",
28
- "@mcp-abap-adt/openai-llm": "^26.0.0"
29
- },
30
26
  "license": "LGPL-3.0-only",
31
27
  "repository": {
32
28
  "type": "git",
@@ -34,5 +30,10 @@
34
30
  },
35
31
  "publishConfig": {
36
32
  "access": "public"
33
+ },
34
+ "peerDependencies": {
35
+ "@mcp-abap-adt/interfaces-auth": "^2.1.0",
36
+ "@mcp-abap-adt/llm-agent": "^28.0.0",
37
+ "@mcp-abap-adt/openai-llm": "^28.0.0"
37
38
  }
38
39
  }