@loonylabs/llm-middleware 2.27.1 → 2.28.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.
Files changed (50) hide show
  1. package/.env.example +5 -0
  2. package/README.md +2 -1
  3. package/dist/middleware/services/llm/llm.service.d.ts.map +1 -1
  4. package/dist/middleware/services/llm/llm.service.js +2 -0
  5. package/dist/middleware/services/llm/llm.service.js.map +1 -1
  6. package/dist/middleware/services/llm/providers/bedrock-provider.d.ts +43 -0
  7. package/dist/middleware/services/llm/providers/bedrock-provider.d.ts.map +1 -0
  8. package/dist/middleware/services/llm/providers/bedrock-provider.js +328 -0
  9. package/dist/middleware/services/llm/providers/bedrock-provider.js.map +1 -0
  10. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.factory.d.ts +21 -0
  11. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.factory.d.ts.map +1 -0
  12. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.factory.js +36 -0
  13. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.factory.js.map +1 -0
  14. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.types.d.ts +53 -0
  15. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.types.d.ts.map +1 -0
  16. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.types.js +18 -0
  17. package/dist/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.types.js.map +1 -0
  18. package/dist/middleware/services/llm/providers/bedrock-reasoning/index.d.ts +6 -0
  19. package/dist/middleware/services/llm/providers/bedrock-reasoning/index.d.ts.map +1 -0
  20. package/dist/middleware/services/llm/providers/bedrock-reasoning/index.js +22 -0
  21. package/dist/middleware/services/llm/providers/bedrock-reasoning/index.js.map +1 -0
  22. package/dist/middleware/services/llm/providers/bedrock-reasoning/noop-reasoning.strategy.d.ts +17 -0
  23. package/dist/middleware/services/llm/providers/bedrock-reasoning/noop-reasoning.strategy.d.ts.map +1 -0
  24. package/dist/middleware/services/llm/providers/bedrock-reasoning/noop-reasoning.strategy.js +24 -0
  25. package/dist/middleware/services/llm/providers/bedrock-reasoning/noop-reasoning.strategy.js.map +1 -0
  26. package/dist/middleware/services/llm/providers/bedrock-reasoning/nova-reasoning.strategy.d.ts +16 -0
  27. package/dist/middleware/services/llm/providers/bedrock-reasoning/nova-reasoning.strategy.d.ts.map +1 -0
  28. package/dist/middleware/services/llm/providers/bedrock-reasoning/nova-reasoning.strategy.js +40 -0
  29. package/dist/middleware/services/llm/providers/bedrock-reasoning/nova-reasoning.strategy.js.map +1 -0
  30. package/dist/middleware/services/llm/providers/bedrock-reasoning/reasoning-effort.strategy.d.ts +15 -0
  31. package/dist/middleware/services/llm/providers/bedrock-reasoning/reasoning-effort.strategy.d.ts.map +1 -0
  32. package/dist/middleware/services/llm/providers/bedrock-reasoning/reasoning-effort.strategy.js +32 -0
  33. package/dist/middleware/services/llm/providers/bedrock-reasoning/reasoning-effort.strategy.js.map +1 -0
  34. package/dist/middleware/services/llm/providers/index.d.ts +1 -0
  35. package/dist/middleware/services/llm/providers/index.d.ts.map +1 -1
  36. package/dist/middleware/services/llm/providers/index.js +1 -0
  37. package/dist/middleware/services/llm/providers/index.js.map +1 -1
  38. package/dist/middleware/services/llm/types/bedrock.types.d.ts +114 -0
  39. package/dist/middleware/services/llm/types/bedrock.types.d.ts.map +1 -0
  40. package/dist/middleware/services/llm/types/bedrock.types.js +14 -0
  41. package/dist/middleware/services/llm/types/bedrock.types.js.map +1 -0
  42. package/dist/middleware/services/llm/types/common.types.d.ts +3 -1
  43. package/dist/middleware/services/llm/types/common.types.d.ts.map +1 -1
  44. package/dist/middleware/services/llm/types/common.types.js +2 -0
  45. package/dist/middleware/services/llm/types/common.types.js.map +1 -1
  46. package/dist/middleware/services/llm/types/index.d.ts +1 -0
  47. package/dist/middleware/services/llm/types/index.d.ts.map +1 -1
  48. package/dist/middleware/services/llm/types/index.js +1 -0
  49. package/dist/middleware/services/llm/types/index.js.map +1 -1
  50. package/package.json +2 -1
package/.env.example CHANGED
@@ -31,6 +31,11 @@ GOOGLE_APPLICATION_CREDENTIALS=./vertex-ai-service-account.json # Path to servi
31
31
  REQUESTY_API_KEY=your_requesty_api_key_here # Your Requesty API key
32
32
  REQUESTY_MODEL=openai/gpt-4o # Default: openai/gpt-4o (format: provider/model-name)
33
33
 
34
+ # AWS Bedrock Configuration (Optional - Bearer token / API key auth, EU data residency)
35
+ BEDROCK_API_KEY=your_bedrock_api_key_here # Amazon Bedrock API key (Bearer token)
36
+ BEDROCK_REGION=eu-central-1 # AWS region (Frankfurt = EU data residency)
37
+ BEDROCK_MODEL=qwen.qwen3-32b-v1:0 # Default model ID (verify via Bedrock console / list-foundation-models)
38
+
34
39
  # Test Configuration (Optional)
35
40
  TEST_LLM_MODEL=vertex/gemini-2.0-flash-lite # Model for general LLM tests
36
41
  # Reasoning models:
package/README.md CHANGED
@@ -45,6 +45,7 @@
45
45
  - ✅ **Google Gemini Direct**: Complete support for Gemini models via API Key
46
46
  - ✅ **Google Vertex AI**: CDPA/GDPR-compliant with EU data residency (Service Account auth)
47
47
  - ✅ **Requesty.AI**: 300+ models via unified API, built-in cost tracking
48
+ - ✅ **AWS Bedrock**: Converse API via Bearer-token auth (no AWS SDK); Claude, Nova, Qwen, GLM, Kimi, DeepSeek, gpt-oss — with central `reasoningEffort` control — **v2.28.0**
48
49
  - 🔌 **Pluggable**: Easy to add custom providers - see [LLM Providers Guide](docs/LLM_PROVIDERS.md)
49
50
  - 👁️ **Vision / Multimodal Input**: Send images alongside text to LLM providers
50
51
  - ✨ **v2.22.0**: Provider-agnostic `MultimodalContent` type (`string | ContentPart[]`)
@@ -370,7 +371,7 @@ VERTEX_AI_MODEL=gemini-2.5-flash # Default Vertex AI model
370
371
  GOOGLE_APPLICATION_CREDENTIALS=./vertex-ai-service-account.json # Service Account
371
372
  ```
372
373
 
373
- **Multi-Provider Support:** The middleware is fully integrated with **Ollama**, **Anthropic Claude**, **Google Gemini** (Direct API & Vertex AI), and **Requesty.AI**. See the [LLM Providers Guide](docs/LLM_PROVIDERS.md) for details on the provider system and how to use or add providers.
374
+ **Multi-Provider Support:** The middleware is fully integrated with **Ollama**, **Anthropic Claude**, **Google Gemini** (Direct API & Vertex AI), **Requesty.AI**, and **AWS Bedrock** (Converse API, EU data residency). See the [LLM Providers Guide](docs/LLM_PROVIDERS.md) for details on the provider system and how to use or add providers. AWS Bedrock specifics: [AWS Bedrock Guide](docs/AWS_BEDROCK.md).
374
375
 
375
376
  </details>
376
377
 
@@ -1 +1 @@
1
- {"version":3,"file":"llm.service.d.ts","sourceRoot":"","sources":["../../../../src/middleware/services/llm/llm.service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAKhE,OAAO,EAAoB,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,cAAc,CAAC,EAAE,sBAAsB,CAAC;CACzC;AAED,qBAAa,UAAU;IACrB,OAAO,CAAC,SAAS,CAAoC;IACrD,OAAO,CAAC,eAAe,CAAmC;gBAE9C,OAAO,CAAC,EAAE,iBAAiB;IAUvC;;OAEG;IACI,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,eAAe;IAQ1D;;;;;;;;;;;;;;;;;;OAkBG;IACI,gBAAgB,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI;IAI/E;;OAEG;IACI,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAOtD;;OAEG;IACI,kBAAkB,IAAI,WAAW;IAIxC;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AG,IAAI;IAOtD;;OAEG;IACI,kBAAkB,IAAI,WAAW;IAIxC;;;OAGG;IACU,qBAAqB,CAChC,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,gBAAgB,GAAG;QAAE,QAAQ,CAAC,EAAE,WAAW,CAAA;KAAO,GAC1D,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAMpC;;;OAGG;IACU,IAAI,CACf,MAAM,EAAE,iBAAiB,EACzB,OAAO,GAAE,gBAAgB,GAAG;QAAE,QAAQ,CAAC,EAAE,WAAW,CAAA;KAAO,GAC1D,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAMpC;;OAEG;IACI,qBAAqB,IAAI,WAAW,EAAE;CAG9C;AAGD,eAAO,MAAM,UAAU,YAAmB,CAAC"}
@@ -10,6 +10,7 @@ const anthropic_provider_1 = require("./providers/anthropic-provider");
10
10
  const gemini_provider_1 = require("./providers/gemini-provider");
11
11
  const requesty_provider_1 = require("./providers/requesty-provider");
12
12
  const gemini_1 = require("./providers/gemini");
13
+ const bedrock_provider_1 = require("./providers/bedrock-provider");
13
14
  const types_1 = require("./types");
14
15
  class LLMService {
15
16
  constructor(options) {
@@ -21,6 +22,7 @@ class LLMService {
21
22
  this.providers.set(types_1.LLMProvider.GOOGLE, new gemini_provider_1.GeminiProvider());
22
23
  this.providers.set(types_1.LLMProvider.REQUESTY, new requesty_provider_1.RequestyProvider());
23
24
  this.providers.set(types_1.LLMProvider.VERTEX_AI, new gemini_1.VertexAIProvider(options?.vertexAIConfig));
25
+ this.providers.set(types_1.LLMProvider.BEDROCK, new bedrock_provider_1.BedrockProvider());
24
26
  }
25
27
  /**
26
28
  * Get a specific provider instance
@@ -1 +1 @@
1
- {"version":3,"file":"llm.service.js","sourceRoot":"","sources":["../../../../src/middleware/services/llm/llm.service.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iEAA6D;AAC7D,uEAAmE;AACnE,iEAA6D;A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B;QAC1B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF;AAnGD,gCAmGC;AAED,4BAA4B;AACf,QAAA,UAAU,GAAG,IAAI,UAAU,EAAE,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { BaseLLMProvider } from './base-llm-provider';
2
+ import { CommonLLMResponse } from '../types';
3
+ import { BedrockRequestOptions } from '../types/bedrock.types';
4
+ import { MultimodalContent } from '../types/multimodal.types';
5
+ /**
6
+ * AWS Bedrock provider implementation using the Converse API.
7
+ *
8
+ * Why Converse (not InvokeModel): Converse provides a single, model-agnostic
9
+ * request/response shape across Claude, Nova, Llama, Mistral, Qwen, etc. — so
10
+ * switching models is just a different `model` string, no per-model payload code.
11
+ *
12
+ * Why Bearer auth (not AWS SDK / SigV4): Bedrock accepts an API key as a Bearer
13
+ * token directly over REST, mirroring the existing axios-based providers. No
14
+ * heavy @aws-sdk dependency and no request signing required.
15
+ *
16
+ * Auth: Authorization: Bearer <BEDROCK_API_KEY>
17
+ * Region: BEDROCK_REGION (default eu-central-1 / Frankfurt for EU data residency)
18
+ * @see https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
19
+ */
20
+ export declare class BedrockProvider extends BaseLLMProvider {
21
+ private dataFlowLogger;
22
+ private readonly DEFAULT_REGION;
23
+ private readonly DEFAULT_TIMEOUT;
24
+ constructor();
25
+ /**
26
+ * Build the bedrock-runtime Converse endpoint for a given region and model.
27
+ * The model id is used as-is (model ids such as `qwen.qwen3-32b-v1:0` are
28
+ * valid path segments and must not be percent-encoded).
29
+ */
30
+ private buildEndpoint;
31
+ /**
32
+ * Call the AWS Bedrock Converse API with a custom system message.
33
+ * @param userPrompt - The user's prompt (text; image input is a planned follow-up)
34
+ * @param systemMessage - The system message defining AI behavior
35
+ * @param options - Options for the API call
36
+ * @returns The API response or null on error
37
+ */
38
+ callWithSystemMessage(userPrompt: MultimodalContent, systemMessage: string, options?: BedrockRequestOptions): Promise<CommonLLMResponse | null>;
39
+ }
40
+ export declare const bedrockProvider: BedrockProvider;
41
+ export { BedrockProvider as BedrockService };
42
+ export { bedrockProvider as bedrockService };
43
+ //# sourceMappingURL=bedrock-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-provider.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/providers/bedrock-provider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAe,iBAAiB,EAAc,MAAM,UAAU,CAAC;AACtE,OAAO,EACL,qBAAqB,EAKtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAmB,MAAM,2BAA2B,CAAC;AAQ/E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkB;IACjD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;;IAO1C;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;;;OAMG;IACU,qBAAqB,CAChC,UAAU,EAAE,iBAAiB,EAC7B,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CA8VrC;AAGD,eAAO,MAAM,eAAe,iBAAwB,CAAC;AAGrD,OAAO,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC;AAC7C,OAAO,EAAE,eAAe,IAAI,cAAc,EAAE,CAAC"}
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.bedrockService = exports.BedrockService = exports.bedrockProvider = exports.BedrockProvider = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const uuid_1 = require("uuid");
9
+ const logging_utils_1 = require("../../../shared/utils/logging.utils");
10
+ const base_llm_provider_1 = require("./base-llm-provider");
11
+ const types_1 = require("../types");
12
+ const debug_llm_utils_1 = require("../utils/debug-llm.utils");
13
+ const data_flow_logger_1 = require("../../data-flow-logger");
14
+ const thinking_1 = require("../thinking");
15
+ const retry_utils_1 = require("../utils/retry.utils");
16
+ const multimodal_utils_1 = require("../utils/multimodal.utils");
17
+ const bedrock_reasoning_1 = require("./bedrock-reasoning");
18
+ /**
19
+ * AWS Bedrock provider implementation using the Converse API.
20
+ *
21
+ * Why Converse (not InvokeModel): Converse provides a single, model-agnostic
22
+ * request/response shape across Claude, Nova, Llama, Mistral, Qwen, etc. — so
23
+ * switching models is just a different `model` string, no per-model payload code.
24
+ *
25
+ * Why Bearer auth (not AWS SDK / SigV4): Bedrock accepts an API key as a Bearer
26
+ * token directly over REST, mirroring the existing axios-based providers. No
27
+ * heavy @aws-sdk dependency and no request signing required.
28
+ *
29
+ * Auth: Authorization: Bearer <BEDROCK_API_KEY>
30
+ * Region: BEDROCK_REGION (default eu-central-1 / Frankfurt for EU data residency)
31
+ * @see https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
32
+ */
33
+ class BedrockProvider extends base_llm_provider_1.BaseLLMProvider {
34
+ constructor() {
35
+ super(types_1.LLMProvider.BEDROCK);
36
+ this.DEFAULT_REGION = 'eu-central-1';
37
+ this.DEFAULT_TIMEOUT = 180000;
38
+ this.dataFlowLogger = data_flow_logger_1.DataFlowLoggerService.getInstance();
39
+ }
40
+ /**
41
+ * Build the bedrock-runtime Converse endpoint for a given region and model.
42
+ * The model id is used as-is (model ids such as `qwen.qwen3-32b-v1:0` are
43
+ * valid path segments and must not be percent-encoded).
44
+ */
45
+ buildEndpoint(region, model) {
46
+ return `https://bedrock-runtime.${region}.amazonaws.com/model/${model}/converse`;
47
+ }
48
+ /**
49
+ * Call the AWS Bedrock Converse API with a custom system message.
50
+ * @param userPrompt - The user's prompt (text; image input is a planned follow-up)
51
+ * @param systemMessage - The system message defining AI behavior
52
+ * @param options - Options for the API call
53
+ * @returns The API response or null on error
54
+ */
55
+ async callWithSystemMessage(userPrompt, systemMessage, options = {}) {
56
+ const { authToken = process.env.BEDROCK_API_KEY, model = process.env.BEDROCK_MODEL, region = process.env.BEDROCK_REGION || this.DEFAULT_REGION, temperature = 0.7, maxTokens = 4096, topP, stopSequences, timeout = this.DEFAULT_TIMEOUT, debugContext, sessionId = (0, uuid_1.v4)(), chapterNumber, pageNumber, pageName, reasoningEffort } = options;
57
+ // Validate that the API key is provided
58
+ if (!authToken) {
59
+ throw new Error('AWS Bedrock API key is required but not provided. ' +
60
+ 'Please set BEDROCK_API_KEY in your .env file or pass authToken in options.');
61
+ }
62
+ // Validate that the model is provided
63
+ if (!model) {
64
+ throw new Error('Model name is required but not provided. ' +
65
+ 'Please set BEDROCK_MODEL in your .env file or pass model in options.');
66
+ }
67
+ // Bedrock Converse text-block extraction. Image input (Converse image blocks)
68
+ // is a planned follow-up — for now we extract the text parts only.
69
+ if ((0, multimodal_utils_1.hasImages)(userPrompt)) {
70
+ logging_utils_1.logger.warn('Image input is not yet supported by the Bedrock provider; using text parts only', {
71
+ context: 'BedrockProvider',
72
+ metadata: { model }
73
+ });
74
+ }
75
+ let userText = typeof userPrompt === 'string'
76
+ ? userPrompt
77
+ : (0, multimodal_utils_1.normalizeContent)(userPrompt)
78
+ .filter((p) => p.type === 'text')
79
+ .map(p => p.text)
80
+ .join('\n');
81
+ // Build Converse inferenceConfig (standardized inference parameters)
82
+ const inferenceConfig = {
83
+ maxTokens,
84
+ temperature,
85
+ ...(topP !== undefined && { topP }),
86
+ ...(stopSequences && { stopSequences })
87
+ };
88
+ // Apply model-specific reasoning mapping. The consumer always sets the
89
+ // provider-agnostic `reasoningEffort`; the strategy translates it to the
90
+ // right mechanism for this model family (reasoning_effort / reasoningConfig /
91
+ // prompt suffix / no-op) and reports inference-parameter constraints to honor.
92
+ let additionalModelRequestFields;
93
+ if (reasoningEffort) {
94
+ const reasoning = bedrock_reasoning_1.BedrockReasoningFactory.forModel(model).apply(reasoningEffort);
95
+ if (reasoning.additionalModelRequestFields) {
96
+ additionalModelRequestFields = { ...reasoning.additionalModelRequestFields };
97
+ }
98
+ if (reasoning.removeInferenceConfigKeys) {
99
+ for (const key of reasoning.removeInferenceConfigKeys) {
100
+ delete inferenceConfig[key];
101
+ }
102
+ }
103
+ if (reasoning.promptSuffix) {
104
+ userText = `${userText}${reasoning.promptSuffix}`;
105
+ }
106
+ (reasoning.warnings ?? []).forEach(w => logging_utils_1.logger.warn(w, { context: 'BedrockProvider', metadata: { model, reasoningEffort } }));
107
+ }
108
+ // Build the Converse request payload
109
+ const requestPayload = {
110
+ messages: [
111
+ { role: 'user', content: [{ text: userText }] }
112
+ ],
113
+ // Converse expects `system` as an array of text blocks at the top level
114
+ ...(systemMessage && { system: [{ text: systemMessage }] }),
115
+ inferenceConfig,
116
+ ...(additionalModelRequestFields && { additionalModelRequestFields })
117
+ };
118
+ const endpoint = this.buildEndpoint(region, model);
119
+ const headers = {
120
+ 'Content-Type': 'application/json',
121
+ 'Accept': 'application/json',
122
+ 'Authorization': `Bearer ${authToken}`
123
+ };
124
+ // Get client request body from global scope (optional, for richer logs)
125
+ let clientRequestBody = undefined;
126
+ try {
127
+ clientRequestBody = global.currentRequestBody;
128
+ }
129
+ catch {
130
+ // Ignore — optional
131
+ }
132
+ // Use debug string to avoid base64 blobs in logs
133
+ const userMessageDebug = (0, multimodal_utils_1.contentToDebugString)(userPrompt);
134
+ const debugInfo = {
135
+ timestamp: new Date(),
136
+ provider: this.providerName,
137
+ model,
138
+ baseUrl: endpoint,
139
+ systemMessage,
140
+ userMessage: userMessageDebug,
141
+ requestData: requestPayload,
142
+ useCase: debugContext,
143
+ clientRequestBody,
144
+ sessionId,
145
+ chapterNumber,
146
+ pageNumber,
147
+ pageName,
148
+ temperature,
149
+ reasoningEffort
150
+ };
151
+ await debug_llm_utils_1.LLMDebugger.logRequest(debugInfo);
152
+ const contextForLogger = {
153
+ currentChapterNr: chapterNumber,
154
+ currentPage: pageNumber,
155
+ debugContext
156
+ };
157
+ const requestId = this.dataFlowLogger.startRequest(debugContext || 'bedrock-converse', contextForLogger);
158
+ this.dataFlowLogger.logLLMRequest({
159
+ stage: debugContext || 'bedrock-converse',
160
+ prompt: userMessageDebug,
161
+ systemMessage,
162
+ modelName: model,
163
+ temperature,
164
+ contextInfo: {
165
+ sessionId,
166
+ chapterNumber,
167
+ pageNumber,
168
+ pageName,
169
+ parameters: { maxTokens, topP, stopSequences, region }
170
+ }
171
+ }, contextForLogger, requestId);
172
+ const requestStartTime = Date.now();
173
+ try {
174
+ logging_utils_1.logger.info('Sending request to AWS Bedrock (Converse)', {
175
+ context: 'BedrockProvider',
176
+ metadata: {
177
+ url: endpoint,
178
+ model,
179
+ region,
180
+ promptLength: (0, multimodal_utils_1.contentLength)(userPrompt),
181
+ maxTokens
182
+ }
183
+ });
184
+ const response = await (0, retry_utils_1.retryWithBackoff)(() => axios_1.default.post(endpoint, requestPayload, { headers, timeout }), this.constructor.name, options.retry);
185
+ const requestDuration = Date.now() - requestStartTime;
186
+ if (response && response.status === 200) {
187
+ const apiResponse = response.data;
188
+ const blocks = apiResponse.output?.message?.content ?? [];
189
+ // Extract generated text from text blocks
190
+ const rawResponseText = blocks
191
+ .filter(block => block.text !== undefined)
192
+ .map(block => block.text)
193
+ .join('\n');
194
+ // Native reasoning text (reasoning-capable models like Qwen3, Claude thinking)
195
+ const nativeReasoning = blocks
196
+ .map(block => block.reasoningContent?.reasoningText?.text)
197
+ .filter((t) => !!t)
198
+ .join('\n');
199
+ // Fall back to tag-based extraction (<think>...) for models that inline
200
+ // their reasoning in the text. Native reasoningContent takes priority.
201
+ const extractor = thinking_1.ThinkingExtractorFactory.forModel(model);
202
+ const { content: responseText, thinking: extractedThinking } = extractor.extract(rawResponseText);
203
+ const thinking = nativeReasoning || extractedThinking;
204
+ // Normalize token usage to the provider-agnostic format
205
+ const tokenUsage = {
206
+ inputTokens: apiResponse.usage.inputTokens,
207
+ outputTokens: apiResponse.usage.outputTokens,
208
+ totalTokens: apiResponse.usage.totalTokens,
209
+ // Include cache metadata if the model reported cached tokens
210
+ ...((apiResponse.usage.cacheReadInputTokens || apiResponse.usage.cacheWriteInputTokens) ? {
211
+ cacheMetadata: {
212
+ cacheReadTokens: apiResponse.usage.cacheReadInputTokens,
213
+ cacheCreationTokens: apiResponse.usage.cacheWriteInputTokens
214
+ }
215
+ } : {})
216
+ };
217
+ const normalizedResponse = {
218
+ message: {
219
+ content: responseText,
220
+ ...(thinking && { thinking })
221
+ },
222
+ sessionId,
223
+ metadata: {
224
+ provider: this.providerName,
225
+ model,
226
+ tokensUsed: tokenUsage.totalTokens,
227
+ processingTime: requestDuration,
228
+ region
229
+ },
230
+ usage: tokenUsage,
231
+ stopReason: apiResponse.stopReason
232
+ };
233
+ debugInfo.responseTimestamp = new Date();
234
+ debugInfo.response = responseText;
235
+ debugInfo.rawResponseData = apiResponse;
236
+ if (thinking) {
237
+ debugInfo.thinking = thinking;
238
+ }
239
+ await debug_llm_utils_1.LLMDebugger.logResponse(debugInfo);
240
+ this.dataFlowLogger.logLLMResponse(debugContext || 'bedrock-converse', { rawResponse: responseText, processingTime: requestDuration }, contextForLogger, requestId);
241
+ return normalizedResponse;
242
+ }
243
+ else {
244
+ const error = new Error(`Status ${response?.status || 'unknown'}`);
245
+ logging_utils_1.logger.error('Error calling AWS Bedrock', {
246
+ context: this.constructor.name,
247
+ error: error.message,
248
+ metadata: response?.data || {}
249
+ });
250
+ this.dataFlowLogger.logLLMResponse(debugContext || 'bedrock-converse', { rawResponse: '', processingTime: Date.now() - requestStartTime, error }, contextForLogger, requestId);
251
+ return null;
252
+ }
253
+ }
254
+ catch (error) {
255
+ let errorMessage = 'Unknown error';
256
+ let errorDetails = {};
257
+ if (error instanceof Error) {
258
+ errorMessage = error.message;
259
+ }
260
+ if (error &&
261
+ typeof error === 'object' &&
262
+ 'isAxiosError' in error &&
263
+ error.isAxiosError === true) {
264
+ const axiosError = error;
265
+ if (axiosError.response) {
266
+ errorDetails = {
267
+ statusCode: axiosError.response.status,
268
+ statusText: axiosError.response.statusText,
269
+ data: axiosError.response.data
270
+ };
271
+ if (axiosError.response.status === 401) {
272
+ logging_utils_1.logger.error('Authentication error with AWS Bedrock', {
273
+ context: this.constructor.name,
274
+ error: 'Invalid or expired Bedrock API key',
275
+ metadata: { statusCode: 401, message: axiosError.response.data?.message }
276
+ });
277
+ }
278
+ else if (axiosError.response.status === 403) {
279
+ logging_utils_1.logger.error('Access denied by AWS Bedrock', {
280
+ context: this.constructor.name,
281
+ error: 'Model access not granted, or model not available in this region',
282
+ metadata: {
283
+ statusCode: 403,
284
+ model,
285
+ region,
286
+ hint: 'Check "Model access" in the Bedrock console for this region.'
287
+ }
288
+ });
289
+ }
290
+ else if (axiosError.response.status === 429) {
291
+ logging_utils_1.logger.error('Rate limit / quota exceeded on AWS Bedrock', {
292
+ context: this.constructor.name,
293
+ error: 'Too many requests',
294
+ metadata: { statusCode: 429, retryAfter: axiosError.response.headers?.['retry-after'] }
295
+ });
296
+ }
297
+ else if (axiosError.response.status === 400) {
298
+ logging_utils_1.logger.error('Bad request to AWS Bedrock', {
299
+ context: this.constructor.name,
300
+ error: axiosError.response.data?.message || 'Invalid request',
301
+ metadata: { model, details: axiosError.response.data }
302
+ });
303
+ }
304
+ }
305
+ }
306
+ logging_utils_1.logger.error('Error in Bedrock API request', {
307
+ context: this.constructor.name,
308
+ error: errorMessage,
309
+ metadata: { ...errorDetails, requestModel: model, region, sessionId }
310
+ });
311
+ this.dataFlowLogger.logLLMResponse(debugContext || 'bedrock-converse', {
312
+ rawResponse: '',
313
+ processingTime: Date.now() - requestStartTime,
314
+ error: error instanceof Error ? error : new Error(errorMessage)
315
+ }, contextForLogger, requestId);
316
+ debugInfo.responseTimestamp = new Date();
317
+ debugInfo.error = { message: errorMessage, details: errorDetails };
318
+ await debug_llm_utils_1.LLMDebugger.logError(debugInfo);
319
+ return null;
320
+ }
321
+ }
322
+ }
323
+ exports.BedrockProvider = BedrockProvider;
324
+ exports.BedrockService = BedrockProvider;
325
+ // Export singleton instance
326
+ exports.bedrockProvider = new BedrockProvider();
327
+ exports.bedrockService = exports.bedrockProvider;
328
+ //# sourceMappingURL=bedrock-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-provider.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/providers/bedrock-provider.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+BAAoC;AACpC,uEAA6D;AAC7D,2DAAsD;AACtD,oCAAsE;AAStE,8DAAqE;AACrE,6DAA+D;AAC/D,0CAAuD;AACvD,sDAAwD;AACxD,gEAA6G;AAC7G,2DAA8D;AAE9D;;;;;;;;;;;;;;GAcG;AACH,MAAa,eAAgB,SAAQ,mCAAe;IAKlD;QACE,KAAK,CAAC,mBAAW,CAAC,OAAO,CAAC,CAAC;QAJZ,mBAAc,GAAG,cAAc,CAAC;QAChC,oBAAe,GAAG,MAAM,CAAC;QAIxC,IAAI,CAAC,cAAc,GAAG,wCAAqB,CAAC,WAAW,EAAE,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACK,aAAa,CAAC,MAAc,EAAE,KAAa;QACjD,OAAO,2BAA2B,MAAM,wBAAwB,KAAK,WAAW,CAAC;IACnF,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,qBAAqB,CAChC,UAA6B,EAC7B,aAAqB,EACrB,UAAiC,EAAE;QAEnC,MAAM,EACJ,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,EACvC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,EACjC,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,EAC1D,WAAW,GAAG,GAAG,EACjB,SAAS,GAAG,IAAI,E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;YAEF,SAAS,CAAC,iBAAiB,GAAG,IAAI,IAAI,EAAE,CAAC;YACzC,SAAS,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC;YACnE,MAAM,6BAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAEtC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA5XD,0CA4XC;AAM2B,yCAAc;AAJ1C,4BAA4B;AACf,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAIzB,yBAJf,uBAAe,CAIc"}
@@ -0,0 +1,21 @@
1
+ import { BedrockReasoningStrategy } from './bedrock-reasoning.types';
2
+ /**
3
+ * Selects the {@link BedrockReasoningStrategy} for a given Bedrock model id.
4
+ *
5
+ * Mapping (by model-id substring):
6
+ * - `nova` → reasoningConfig (Amazon Nova 2)
7
+ * - `minimax` → no-op (always-on interleaved thinking, no toggle)
8
+ * - `anthropic` / `claude` → no-op (uses `thinking` budget, not reasoning_effort — follow-up)
9
+ * - everything else → reasoning_effort (Qwen, Kimi, gpt-oss, GLM, DeepSeek, …)
10
+ *
11
+ * `reasoning_effort` is the default because it is supported by every open-weight
12
+ * model verified on Bedrock Converse, which keeps behavior uniform "regardless of model".
13
+ */
14
+ export declare class BedrockReasoningFactory {
15
+ private static readonly reasoningEffort;
16
+ private static readonly nova;
17
+ private static readonly minimax;
18
+ private static readonly claude;
19
+ static forModel(model: string): BedrockReasoningStrategy;
20
+ }
21
+ //# sourceMappingURL=bedrock-reasoning.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-reasoning.factory.d.ts","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAKrE;;;;;;;;;;;GAWG;AACH,qBAAa,uBAAuB;IAClC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAiC;IACxE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAA+B;IAC3D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAG7B;IACF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAG5B;IAEF,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,wBAAwB;CAOzD"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BedrockReasoningFactory = void 0;
4
+ const reasoning_effort_strategy_1 = require("./reasoning-effort.strategy");
5
+ const nova_reasoning_strategy_1 = require("./nova-reasoning.strategy");
6
+ const noop_reasoning_strategy_1 = require("./noop-reasoning.strategy");
7
+ /**
8
+ * Selects the {@link BedrockReasoningStrategy} for a given Bedrock model id.
9
+ *
10
+ * Mapping (by model-id substring):
11
+ * - `nova` → reasoningConfig (Amazon Nova 2)
12
+ * - `minimax` → no-op (always-on interleaved thinking, no toggle)
13
+ * - `anthropic` / `claude` → no-op (uses `thinking` budget, not reasoning_effort — follow-up)
14
+ * - everything else → reasoning_effort (Qwen, Kimi, gpt-oss, GLM, DeepSeek, …)
15
+ *
16
+ * `reasoning_effort` is the default because it is supported by every open-weight
17
+ * model verified on Bedrock Converse, which keeps behavior uniform "regardless of model".
18
+ */
19
+ class BedrockReasoningFactory {
20
+ static forModel(model) {
21
+ const m = model.toLowerCase();
22
+ if (m.includes('nova'))
23
+ return this.nova;
24
+ if (m.includes('minimax'))
25
+ return this.minimax;
26
+ if (m.includes('anthropic') || m.includes('claude'))
27
+ return this.claude;
28
+ return this.reasoningEffort;
29
+ }
30
+ }
31
+ exports.BedrockReasoningFactory = BedrockReasoningFactory;
32
+ BedrockReasoningFactory.reasoningEffort = new reasoning_effort_strategy_1.ReasoningEffortStrategy();
33
+ BedrockReasoningFactory.nova = new nova_reasoning_strategy_1.NovaReasoningStrategy();
34
+ BedrockReasoningFactory.minimax = new noop_reasoning_strategy_1.NoOpReasoningStrategy('MiniMax uses always-on interleaved thinking with no Converse toggle', 'noop-minimax');
35
+ BedrockReasoningFactory.claude = new noop_reasoning_strategy_1.NoOpReasoningStrategy("Claude on Bedrock uses a 'thinking' token budget, not reasoning_effort (mapping is a planned follow-up)", 'noop-claude');
36
+ //# sourceMappingURL=bedrock-reasoning.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-reasoning.factory.js","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.factory.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AACtE,uEAAkE;AAClE,uEAAkE;AAElE;;;;;;;;;;;GAWG;AACH,MAAa,uBAAuB;IAYlC,MAAM,CAAC,QAAQ,CAAC,KAAa;QAC3B,MAAM,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC;QACzC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC;QACxE,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;;AAlBH,0DAmBC;AAlByB,uCAAe,GAAG,IAAI,mDAAuB,EAAE,CAAC;AAChD,4BAAI,GAAG,IAAI,+CAAqB,EAAE,CAAC;AACnC,+BAAO,GAAG,IAAI,+CAAqB,CACzD,qEAAqE,EACrE,cAAc,CACf,CAAC;AACsB,8BAAM,GAAG,IAAI,+CAAqB,CACxD,yGAAyG,EACzG,aAAa,CACd,CAAC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Reasoning strategy abstraction for the AWS Bedrock provider.
3
+ *
4
+ * Bedrock has no unified reasoning parameter across model families:
5
+ * - Most open-weight models (Kimi, gpt-oss, GLM, DeepSeek) accept the
6
+ * OpenAI-style `reasoning_effort` (low/medium/high) → verified live.
7
+ * - Amazon Nova uses `reasoningConfig` ({ type, maxReasoningEffort }) and forbids
8
+ * some inference parameters at maxReasoningEffort=high.
9
+ * - Qwen toggles thinking via a prompt suffix (`/no_think`).
10
+ * - Some models (MiniMax) have no reasoning control at all.
11
+ *
12
+ * This Strategy Pattern (mirroring the ThinkingExtractor pattern) hides that
13
+ * heterogeneity: the consumer always sets the provider-agnostic `reasoningEffort`,
14
+ * and the provider applies the right mechanism per model.
15
+ */
16
+ import { ReasoningEffort } from '../../types';
17
+ import { BedrockInferenceConfig } from '../../types/bedrock.types';
18
+ /**
19
+ * The set of request modifications a strategy produces for a given effort.
20
+ * The provider merges these into the outgoing Converse request.
21
+ */
22
+ export interface BedrockReasoningApplication {
23
+ /**
24
+ * Fields to merge into the request's `additionalModelRequestFields`
25
+ * (model-specific reasoning toggles, e.g. `{ reasoning_effort: 'high' }`).
26
+ */
27
+ additionalModelRequestFields?: Record<string, unknown>;
28
+ /**
29
+ * `inferenceConfig` keys the model forbids while reasoning is active and that
30
+ * the provider must remove (e.g. Nova at maxReasoningEffort=high forbids
31
+ * temperature/topP/maxTokens). The provider removes them and logs a warning.
32
+ */
33
+ removeInferenceConfigKeys?: (keyof BedrockInferenceConfig)[];
34
+ /** Text appended to the user prompt (e.g. Qwen `/no_think` to disable thinking). */
35
+ promptSuffix?: string;
36
+ /** Human-readable warnings the provider should surface via the logger. */
37
+ warnings?: string[];
38
+ }
39
+ /**
40
+ * Maps the provider-agnostic {@link ReasoningEffort} to a specific model family's
41
+ * reasoning mechanism on the Bedrock Converse API.
42
+ */
43
+ export interface BedrockReasoningStrategy {
44
+ /** Strategy name, used for logging/debugging. */
45
+ readonly name: string;
46
+ /**
47
+ * Produces the request modifications for the requested effort.
48
+ * Only called when `reasoningEffort` is defined; when it is undefined the
49
+ * provider leaves reasoning untouched (each model uses its own default).
50
+ */
51
+ apply(effort: ReasoningEffort): BedrockReasoningApplication;
52
+ }
53
+ //# sourceMappingURL=bedrock-reasoning.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-reasoning.types.d.ts","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvD;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,CAAC,MAAM,sBAAsB,CAAC,EAAE,CAAC;IAE7D,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,2BAA2B,CAAC;CAC7D"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /**
3
+ * Reasoning strategy abstraction for the AWS Bedrock provider.
4
+ *
5
+ * Bedrock has no unified reasoning parameter across model families:
6
+ * - Most open-weight models (Kimi, gpt-oss, GLM, DeepSeek) accept the
7
+ * OpenAI-style `reasoning_effort` (low/medium/high) → verified live.
8
+ * - Amazon Nova uses `reasoningConfig` ({ type, maxReasoningEffort }) and forbids
9
+ * some inference parameters at maxReasoningEffort=high.
10
+ * - Qwen toggles thinking via a prompt suffix (`/no_think`).
11
+ * - Some models (MiniMax) have no reasoning control at all.
12
+ *
13
+ * This Strategy Pattern (mirroring the ThinkingExtractor pattern) hides that
14
+ * heterogeneity: the consumer always sets the provider-agnostic `reasoningEffort`,
15
+ * and the provider applies the right mechanism per model.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=bedrock-reasoning.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock-reasoning.types.js","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/bedrock-reasoning.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}
@@ -0,0 +1,6 @@
1
+ export * from './bedrock-reasoning.types';
2
+ export * from './reasoning-effort.strategy';
3
+ export * from './nova-reasoning.strategy';
4
+ export * from './noop-reasoning.strategy';
5
+ export * from './bedrock-reasoning.factory';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./bedrock-reasoning.types"), exports);
18
+ __exportStar(require("./reasoning-effort.strategy"), exports);
19
+ __exportStar(require("./nova-reasoning.strategy"), exports);
20
+ __exportStar(require("./noop-reasoning.strategy"), exports);
21
+ __exportStar(require("./bedrock-reasoning.factory"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,8DAA4C;AAC5C,4DAA0C;AAC1C,4DAA0C;AAC1C,8DAA4C"}
@@ -0,0 +1,17 @@
1
+ import { ReasoningEffort } from '../../types';
2
+ import { BedrockReasoningStrategy, BedrockReasoningApplication } from './bedrock-reasoning.types';
3
+ /**
4
+ * No-op reasoning strategy for models without configurable reasoning on Converse.
5
+ *
6
+ * Used for MiniMax (always-on "interleaved thinking", no toggle) and for model
7
+ * families whose reasoning is not yet mapped (e.g. Anthropic Claude, which uses a
8
+ * `thinking` token budget instead of `reasoning_effort`). Emits a warning so the
9
+ * consumer knows the requested effort had no effect.
10
+ */
11
+ export declare class NoOpReasoningStrategy implements BedrockReasoningStrategy {
12
+ private readonly reason;
13
+ readonly name: string;
14
+ constructor(reason: string, name?: string);
15
+ apply(effort: ReasoningEffort): BedrockReasoningApplication;
16
+ }
17
+ //# sourceMappingURL=noop-reasoning.strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop-reasoning.strategy.d.ts","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/noop-reasoning.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAElG;;;;;;;GAOG;AACH,qBAAa,qBAAsB,YAAW,wBAAwB;IAGxD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEO,MAAM,EAAE,MAAM,EAAE,IAAI,SAAS;IAI1D,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,2BAA2B;CAK5D"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NoOpReasoningStrategy = void 0;
4
+ /**
5
+ * No-op reasoning strategy for models without configurable reasoning on Converse.
6
+ *
7
+ * Used for MiniMax (always-on "interleaved thinking", no toggle) and for model
8
+ * families whose reasoning is not yet mapped (e.g. Anthropic Claude, which uses a
9
+ * `thinking` token budget instead of `reasoning_effort`). Emits a warning so the
10
+ * consumer knows the requested effort had no effect.
11
+ */
12
+ class NoOpReasoningStrategy {
13
+ constructor(reason, name = 'noop') {
14
+ this.reason = reason;
15
+ this.name = name;
16
+ }
17
+ apply(effort) {
18
+ return {
19
+ warnings: [`reasoningEffort '${effort}' is not applied: ${this.reason}`]
20
+ };
21
+ }
22
+ }
23
+ exports.NoOpReasoningStrategy = NoOpReasoningStrategy;
24
+ //# sourceMappingURL=noop-reasoning.strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noop-reasoning.strategy.js","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/noop-reasoning.strategy.ts"],"names":[],"mappings":";;;AAGA;;;;;;;GAOG;AACH,MAAa,qBAAqB;IAGhC,YAA6B,MAAc,EAAE,IAAI,GAAG,MAAM;QAA7B,WAAM,GAAN,MAAM,CAAQ;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAuB;QAC3B,OAAO;YACL,QAAQ,EAAE,CAAC,oBAAoB,MAAM,qBAAqB,IAAI,CAAC,MAAM,EAAE,CAAC;SACzE,CAAC;IACJ,CAAC;CACF;AAZD,sDAYC"}
@@ -0,0 +1,16 @@
1
+ import { ReasoningEffort } from '../../types';
2
+ import { BedrockReasoningStrategy, BedrockReasoningApplication } from './bedrock-reasoning.types';
3
+ /**
4
+ * Reasoning strategy for Amazon Nova 2 models.
5
+ *
6
+ * Uses `reasoningConfig` { type, maxReasoningEffort } via additionalModelRequestFields.
7
+ * At maxReasoningEffort='high', Nova forbids temperature/topP/maxTokens — the provider
8
+ * removes them (and warns) per the configured auto-removal behavior.
9
+ *
10
+ * @see https://docs.aws.amazon.com/nova/latest/nova2-userguide/extended-thinking.html
11
+ */
12
+ export declare class NovaReasoningStrategy implements BedrockReasoningStrategy {
13
+ readonly name = "nova-reasoningConfig";
14
+ apply(effort: ReasoningEffort): BedrockReasoningApplication;
15
+ }
16
+ //# sourceMappingURL=nova-reasoning.strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nova-reasoning.strategy.d.ts","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/nova-reasoning.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAElG;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,YAAW,wBAAwB;IACpE,QAAQ,CAAC,IAAI,0BAA0B;IAEvC,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,2BAA2B;CAwB5D"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NovaReasoningStrategy = void 0;
4
+ /**
5
+ * Reasoning strategy for Amazon Nova 2 models.
6
+ *
7
+ * Uses `reasoningConfig` { type, maxReasoningEffort } via additionalModelRequestFields.
8
+ * At maxReasoningEffort='high', Nova forbids temperature/topP/maxTokens — the provider
9
+ * removes them (and warns) per the configured auto-removal behavior.
10
+ *
11
+ * @see https://docs.aws.amazon.com/nova/latest/nova2-userguide/extended-thinking.html
12
+ */
13
+ class NovaReasoningStrategy {
14
+ constructor() {
15
+ this.name = 'nova-reasoningConfig';
16
+ }
17
+ apply(effort) {
18
+ if (effort === 'none') {
19
+ return {
20
+ additionalModelRequestFields: { reasoningConfig: { type: 'disabled' } }
21
+ };
22
+ }
23
+ const app = {
24
+ additionalModelRequestFields: {
25
+ reasoningConfig: { type: 'enabled', maxReasoningEffort: effort }
26
+ }
27
+ };
28
+ if (effort === 'high') {
29
+ // Nova rejects these inference parameters when maxReasoningEffort='high'.
30
+ app.removeInferenceConfigKeys = ['temperature', 'topP', 'maxTokens'];
31
+ app.warnings = [
32
+ "Nova at reasoningEffort 'high' forbids temperature/topP/maxTokens; " +
33
+ 'these were removed from inferenceConfig.'
34
+ ];
35
+ }
36
+ return app;
37
+ }
38
+ }
39
+ exports.NovaReasoningStrategy = NovaReasoningStrategy;
40
+ //# sourceMappingURL=nova-reasoning.strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nova-reasoning.strategy.js","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/nova-reasoning.strategy.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;GAQG;AACH,MAAa,qBAAqB;IAAlC;QACW,SAAI,GAAG,sBAAsB,CAAC;IA0BzC,CAAC;IAxBC,KAAK,CAAC,MAAuB;QAC3B,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO;gBACL,4BAA4B,EAAE,EAAE,eAAe,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;aACxE,CAAC;QACJ,CAAC;QAED,MAAM,GAAG,GAAgC;YACvC,4BAA4B,EAAE;gBAC5B,eAAe,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE;aACjE;SACF,CAAC;QAEF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,0EAA0E;YAC1E,GAAG,CAAC,yBAAyB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;YACrE,GAAG,CAAC,QAAQ,GAAG;gBACb,qEAAqE;oBACrE,0CAA0C;aAC3C,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA3BD,sDA2BC"}
@@ -0,0 +1,15 @@
1
+ import { ReasoningEffort } from '../../types';
2
+ import { BedrockReasoningStrategy, BedrockReasoningApplication } from './bedrock-reasoning.types';
3
+ /**
4
+ * Reasoning strategy for models that accept the OpenAI-style `reasoning_effort`
5
+ * (low/medium/high) via `additionalModelRequestFields` on the Bedrock Converse API.
6
+ *
7
+ * Verified live (all return native reasoningContent): Qwen3, Kimi K2.5,
8
+ * gpt-oss-120b/20b, GLM-5, GLM-4.7, DeepSeek V3.2. This is the de-facto standard
9
+ * for open-weight models on Bedrock, so it also serves as the default strategy.
10
+ */
11
+ export declare class ReasoningEffortStrategy implements BedrockReasoningStrategy {
12
+ readonly name = "reasoning_effort";
13
+ apply(effort: ReasoningEffort): BedrockReasoningApplication;
14
+ }
15
+ //# sourceMappingURL=reasoning-effort.strategy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-effort.strategy.d.ts","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/reasoning-effort.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAElG;;;;;;;GAOG;AACH,qBAAa,uBAAwB,YAAW,wBAAwB;IACtE,QAAQ,CAAC,IAAI,sBAAsB;IAEnC,KAAK,CAAC,MAAM,EAAE,eAAe,GAAG,2BAA2B;CAc5D"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReasoningEffortStrategy = void 0;
4
+ /**
5
+ * Reasoning strategy for models that accept the OpenAI-style `reasoning_effort`
6
+ * (low/medium/high) via `additionalModelRequestFields` on the Bedrock Converse API.
7
+ *
8
+ * Verified live (all return native reasoningContent): Qwen3, Kimi K2.5,
9
+ * gpt-oss-120b/20b, GLM-5, GLM-4.7, DeepSeek V3.2. This is the de-facto standard
10
+ * for open-weight models on Bedrock, so it also serves as the default strategy.
11
+ */
12
+ class ReasoningEffortStrategy {
13
+ constructor() {
14
+ this.name = 'reasoning_effort';
15
+ }
16
+ apply(effort) {
17
+ if (effort === 'none') {
18
+ // These models reason by default and expose no reliable "off" switch via
19
+ // Converse (thinking:{type:disabled} is ignored). We omit the field so the
20
+ // model uses its default, and warn that reasoning likely stays on.
21
+ return {
22
+ warnings: [
23
+ "reasoningEffort 'none' has no reliable effect on reasoning_effort models " +
24
+ '(Qwen/Kimi/gpt-oss/GLM/DeepSeek); reasoning may remain enabled.'
25
+ ]
26
+ };
27
+ }
28
+ return { additionalModelRequestFields: { reasoning_effort: effort } };
29
+ }
30
+ }
31
+ exports.ReasoningEffortStrategy = ReasoningEffortStrategy;
32
+ //# sourceMappingURL=reasoning-effort.strategy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reasoning-effort.strategy.js","sourceRoot":"","sources":["../../../../../../src/middleware/services/llm/providers/bedrock-reasoning/reasoning-effort.strategy.ts"],"names":[],"mappings":";;;AAGA;;;;;;;GAOG;AACH,MAAa,uBAAuB;IAApC;QACW,SAAI,GAAG,kBAAkB,CAAC;IAgBrC,CAAC;IAdC,KAAK,CAAC,MAAuB;QAC3B,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,yEAAyE;YACzE,2EAA2E;YAC3E,mEAAmE;YACnE,OAAO;gBACL,QAAQ,EAAE;oBACR,2EAA2E;wBAC3E,iEAAiE;iBAClE;aACF,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,4BAA4B,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,EAAE,CAAC;IACxE,CAAC;CACF;AAjBD,0DAiBC"}
@@ -3,4 +3,5 @@ export * from './ollama-provider';
3
3
  export * from './anthropic-provider';
4
4
  export * from './gemini-provider';
5
5
  export * from './requesty-provider';
6
+ export * from './bedrock-provider';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/providers/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/providers/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -21,6 +21,7 @@ __exportStar(require("./ollama-provider"), exports);
21
21
  __exportStar(require("./anthropic-provider"), exports);
22
22
  __exportStar(require("./gemini-provider"), exports);
23
23
  __exportStar(require("./requesty-provider"), exports);
24
+ __exportStar(require("./bedrock-provider"), exports);
24
25
  // Future providers will be added here:
25
26
  // export * from './openai-provider';
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gBAAgB;AAChB,sDAAoC;AAEpC,qBAAqB;AACrB,oDAAkC;AAClC,uDAAqC;AACrC,oDAAkC;AAClC,sDAAoC;AAEpC,uCAAuC;AACvC,qCAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gBAAgB;AAChB,sDAAoC;AAEpC,qBAAqB;AACrB,oDAAkC;AAClC,uDAAqC;AACrC,oDAAkC;AAClC,sDAAoC;AACpC,qDAAmC;AAEnC,uCAAuC;AACvC,qCAAqC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * AWS Bedrock-specific types and interfaces.
3
+ *
4
+ * Based on the Bedrock Converse API, which provides a model-agnostic message
5
+ * format that works consistently across Claude, Nova, Llama, Mistral, Qwen, etc.
6
+ * @see https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
7
+ *
8
+ * Authentication uses a Bedrock API key as a Bearer token in the Authorization
9
+ * header — no AWS SDK or SigV4 signing required. This keeps the provider aligned
10
+ * with the existing axios-based providers (e.g. Anthropic, Vertex AI).
11
+ */
12
+ import { CommonLLMOptions, CommonLLMResponse } from './common.types';
13
+ /**
14
+ * Bedrock-specific request options.
15
+ * Extends common options with Bedrock/Converse-specific parameters.
16
+ */
17
+ export interface BedrockRequestOptions extends CommonLLMOptions {
18
+ /**
19
+ * AWS region for the bedrock-runtime endpoint (e.g. 'eu-central-1').
20
+ * Falls back to BEDROCK_REGION env, then 'eu-central-1' (Frankfurt, EU residency).
21
+ */
22
+ region?: string;
23
+ /** Nucleus sampling — maps to Converse inferenceConfig.topP (0.0 to 1.0) */
24
+ topP?: number;
25
+ /** Stop sequences — maps to Converse inferenceConfig.stopSequences */
26
+ stopSequences?: string[];
27
+ /** Request timeout in milliseconds (default: 180000) */
28
+ timeout?: number;
29
+ }
30
+ /**
31
+ * Request content block. Text-only for now; image blocks
32
+ * ({ image: { format, source: { bytes } } }) are a planned follow-up.
33
+ */
34
+ export interface BedrockContentBlock {
35
+ text: string;
36
+ }
37
+ /** Converse message (request side) */
38
+ export interface BedrockMessage {
39
+ role: 'user' | 'assistant';
40
+ content: BedrockContentBlock[];
41
+ }
42
+ /** Converse system prompt block — `system` is an array of these (top-level, not inside messages) */
43
+ export interface BedrockSystemBlock {
44
+ text: string;
45
+ }
46
+ /** Converse inferenceConfig — standardized inference parameters across all models */
47
+ export interface BedrockInferenceConfig {
48
+ maxTokens?: number;
49
+ temperature?: number;
50
+ topP?: number;
51
+ stopSequences?: string[];
52
+ }
53
+ /** Bedrock Converse API request payload */
54
+ export interface BedrockConverseRequest {
55
+ messages: BedrockMessage[];
56
+ /** Optional system prompt(s) */
57
+ system?: BedrockSystemBlock[];
58
+ /** Standardized inference parameters */
59
+ inferenceConfig?: BedrockInferenceConfig;
60
+ /**
61
+ * Model-specific parameters that the Converse API does not standardize
62
+ * (escape hatch, e.g. for per-model reasoning toggles).
63
+ */
64
+ additionalModelRequestFields?: Record<string, unknown>;
65
+ }
66
+ /**
67
+ * Reasoning content emitted by reasoning-capable models (e.g. Qwen3, Claude
68
+ * extended thinking) within a response content block.
69
+ */
70
+ export interface BedrockReasoningContent {
71
+ reasoningText?: {
72
+ text: string;
73
+ signature?: string;
74
+ };
75
+ }
76
+ /**
77
+ * Response content block — carries either generated `text` or `reasoningContent`.
78
+ * A single response message may contain multiple blocks of different kinds.
79
+ */
80
+ export interface BedrockResponseContentBlock {
81
+ text?: string;
82
+ reasoningContent?: BedrockReasoningContent;
83
+ }
84
+ /** Converse token usage. cache* fields appear when prompt caching is active. */
85
+ export interface BedrockUsage {
86
+ inputTokens: number;
87
+ outputTokens: number;
88
+ totalTokens: number;
89
+ cacheReadInputTokens?: number;
90
+ cacheWriteInputTokens?: number;
91
+ }
92
+ /** Bedrock Converse API response payload */
93
+ export interface BedrockConverseResponse {
94
+ output: {
95
+ message: {
96
+ role: 'assistant';
97
+ content: BedrockResponseContentBlock[];
98
+ };
99
+ };
100
+ /** e.g. 'end_turn', 'max_tokens', 'stop_sequence' */
101
+ stopReason: string;
102
+ usage: BedrockUsage;
103
+ metrics?: {
104
+ latencyMs: number;
105
+ };
106
+ }
107
+ /**
108
+ * Bedrock-specific response (normalized to CommonLLMResponse).
109
+ * Keeps the raw stopReason for consumers that need it.
110
+ */
111
+ export interface BedrockResponse extends CommonLLMResponse {
112
+ stopReason?: string;
113
+ }
114
+ //# sourceMappingURL=bedrock.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock.types.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/bedrock.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAErE;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,sCAAsC;AACtC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAChC;AAED,oGAAoG;AACpG,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qFAAqF;AACrF,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,gCAAgC;IAChC,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,wCAAwC;IACxC,eAAe,CAAC,EAAE,sBAAsB,CAAC;IACzC;;;OAGG;IACH,4BAA4B,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxD;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;CAC5C;AAED,gFAAgF;AAChF,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE;QACN,OAAO,EAAE;YACP,IAAI,EAAE,WAAW,CAAC;YAClB,OAAO,EAAE,2BAA2B,EAAE,CAAC;SACxC,CAAC;KACH,CAAC;IACF,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * AWS Bedrock-specific types and interfaces.
4
+ *
5
+ * Based on the Bedrock Converse API, which provides a model-agnostic message
6
+ * format that works consistently across Claude, Nova, Llama, Mistral, Qwen, etc.
7
+ * @see https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
8
+ *
9
+ * Authentication uses a Bedrock API key as a Bearer token in the Authorization
10
+ * header — no AWS SDK or SigV4 signing required. This keeps the provider aligned
11
+ * with the existing axios-based providers (e.g. Anthropic, Vertex AI).
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ //# sourceMappingURL=bedrock.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bedrock.types.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/bedrock.types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG"}
@@ -143,7 +143,9 @@ export declare enum LLMProvider {
143
143
  GOOGLE = "google",
144
144
  REQUESTY = "requesty",
145
145
  /** Google Vertex AI - Service Account auth, EU hosting support */
146
- VERTEX_AI = "vertex_ai"
146
+ VERTEX_AI = "vertex_ai",
147
+ /** AWS Bedrock - Bearer token (API key) auth via Converse API, EU hosting support */
148
+ BEDROCK = "bedrock"
147
149
  }
148
150
  /**
149
151
  * Debug information interface (provider-agnostic)
@@ -1 +1 @@
1
- {"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/common.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,YAAY,CAAC,EAAE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AAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC"}
1
+ {"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/common.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC,+CAA+C;IAC/C,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEvC;;;;OAIG;IACH,KAAK,CAAC,EAAE,WAAW,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oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,kEAAkE;IAClE,SAAS,cAAc;IACvB,qFAAqF;IACrF,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,KAAK,CAAC,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,GAAG,CAAC;KACf,CAAC;IAGF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAGlB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC"}
@@ -16,5 +16,7 @@ var LLMProvider;
16
16
  LLMProvider["REQUESTY"] = "requesty";
17
17
  /** Google Vertex AI - Service Account auth, EU hosting support */
18
18
  LLMProvider["VERTEX_AI"] = "vertex_ai";
19
+ /** AWS Bedrock - Bearer token (API key) auth via Converse API, EU hosting support */
20
+ LLMProvider["BEDROCK"] = "bedrock";
19
21
  })(LLMProvider || (exports.LLMProvider = LLMProvider = {}));
20
22
  //# sourceMappingURL=common.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.types.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/common.types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA6JH;;GAEG;AACH,IAAY,WAQX;AARD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,kEAAkE;IAClE,sCAAuB,CAAA;AACzB,CAAC,EARW,WAAW,2BAAX,WAAW,QAQtB"}
1
+ {"version":3,"file":"common.types.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/common.types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA6JH;;GAEG;AACH,IAAY,WAUX;AAVD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,gCAAiB,CAAA;IACjB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,kEAAkE;IAClE,sCAAuB,CAAA;IACvB,qFAAqF;IACrF,kCAAmB,CAAA;AACrB,CAAC,EAVW,WAAW,2BAAX,WAAW,QAUtB"}
@@ -5,4 +5,5 @@ export * from './anthropic.types';
5
5
  export * from './gemini.types';
6
6
  export * from './requesty.types';
7
7
  export * from './vertex-ai.types';
8
+ export * from './bedrock.types';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
@@ -24,4 +24,5 @@ __exportStar(require("./anthropic.types"), exports);
24
24
  __exportStar(require("./gemini.types"), exports);
25
25
  __exportStar(require("./requesty.types"), exports);
26
26
  __exportStar(require("./vertex-ai.types"), exports);
27
+ __exportStar(require("./bedrock.types"), exports);
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,iDAA+B;AAE/B,wCAAwC;AACxC,qDAAmC;AAEnC,0BAA0B;AAC1B,iDAA+B;AAC/B,oDAAkC;AAClC,iDAA+B;AAC/B,mDAAiC;AACjC,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/middleware/services/llm/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,iDAA+B;AAE/B,wCAAwC;AACxC,qDAAmC;AAEnC,0BAA0B;AAC1B,iDAA+B;AAC/B,oDAAkC;AAClC,iDAA+B;AAC/B,mDAAiC;AACjC,oDAAkC;AAClC,kDAAgC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loonylabs/llm-middleware",
3
- "version": "2.27.1",
3
+ "version": "2.28.0",
4
4
  "description": "Complete middleware infrastructure for LLM-based backends with multi-provider support (Ollama, Anthropic, OpenAI, Google)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,6 +26,7 @@
26
26
  "test:provider:anthropic": "TEST_PROVIDER=anthropic ts-node tests/manual/provider-smoke-test.ts",
27
27
  "test:provider:requesty": "TEST_PROVIDER=requesty ts-node tests/manual/provider-smoke-test.ts",
28
28
  "test:provider:vertex": "ts-node tests/manual/vertex-ai-smoke-test.ts",
29
+ "test:provider:bedrock": "TEST_PROVIDER=bedrock ts-node tests/manual/provider-smoke-test.ts",
29
30
  "test:vertex:smoke": "ts-node tests/manual/vertex-ai-smoke-test.ts",
30
31
  "test:integration:reasoning": "LLM_INTEGRATION_TESTS=true jest tests/integration/reasoning-control.integration.test.ts --testTimeout=120000",
31
32
  "test:live": "LLM_INTEGRATION_TESTS=true jest tests/integration/*.integration.test.ts --testTimeout=120000",