bedrock-wrapper 2.6.2 → 2.7.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.
- package/.example.env +12 -13
- package/CHANGELOG.md +55 -25
- package/LICENSE +21 -21
- package/README.md +8 -25
- package/bedrock-models.js +116 -18
- package/bedrock-wrapper.js +27 -84
- package/example-converse-api.js +1 -3
- package/interactive-example.js +0 -2
- package/package.json +3 -3
- package/test-converse-api.js +0 -4
- package/test-deepseek-quick.js +66 -0
- package/test-deepseek.js +64 -0
- package/test-models.js +0 -2
- package/test-stop-sequences.js +0 -1
- package/logs/ab845abf-67e2-4cb9-95e2-3942e38326c7/notification.json +0 -16
- package/logs/ab845abf-67e2-4cb9-95e2-3942e38326c7/post_tool_use.json +0 -560
- package/logs/ab845abf-67e2-4cb9-95e2-3942e38326c7/pre_tool_use.json +0 -186
- package/logs/ab845abf-67e2-4cb9-95e2-3942e38326c7/stop.json +0 -18
- package/logs/ab845abf-67e2-4cb9-95e2-3942e38326c7/subagent_stop.json +0 -10
- package/logs/ab845abf-67e2-4cb9-95e2-3942e38326c7/user_prompt_submit.json +0 -18
package/.example.env
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
# ========================
|
|
2
|
-
# == AWS AUTH VARIABLES ==
|
|
3
|
-
# ========================
|
|
4
|
-
AWS_REGION = "us-west-2"
|
|
5
|
-
AWS_ACCESS_KEY_ID = "AKxxxxxxxxxxxxxxxxxx"
|
|
6
|
-
AWS_SECRET_ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
7
|
-
|
|
8
|
-
# ================
|
|
9
|
-
# == LLM PARAMS ==
|
|
10
|
-
# ================
|
|
11
|
-
LLM_MAX_GEN_TOKENS = 800
|
|
12
|
-
LLM_TEMPERATURE = 0.
|
|
13
|
-
LLM_TOP_P = 0.9
|
|
1
|
+
# ========================
|
|
2
|
+
# == AWS AUTH VARIABLES ==
|
|
3
|
+
# ========================
|
|
4
|
+
AWS_REGION = "us-west-2"
|
|
5
|
+
AWS_ACCESS_KEY_ID = "AKxxxxxxxxxxxxxxxxxx"
|
|
6
|
+
AWS_SECRET_ACCESS_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
7
|
+
|
|
8
|
+
# ================
|
|
9
|
+
# == LLM PARAMS ==
|
|
10
|
+
# ================
|
|
11
|
+
LLM_MAX_GEN_TOKENS = 800
|
|
12
|
+
LLM_TEMPERATURE = 0.2
|
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
|
|
4
|
+
## [2.7.0] - 2025-11-18 (DeepSeek & Qwen 3)
|
|
5
|
+
### ✨ Added
|
|
6
|
+
- Support for DeepSeek foundation models
|
|
7
|
+
- DeepSeek-R1 (reasoning model with chain-of-thought capabilities, 8K max output tokens)
|
|
8
|
+
- DeepSeek-V3.1 (hybrid thinking mode for complex reasoning, 8K max output tokens, **Converse API only**)
|
|
9
|
+
- Support for Qwen 3 foundation models
|
|
10
|
+
- Qwen3-32B (dense architecture, 32K max output tokens)
|
|
11
|
+
- Qwen3-Coder-30B-A3B (MoE architecture for code generation, 32K max output tokens)
|
|
12
|
+
- Qwen3-235B-A22B-2507 (MoE architecture for general reasoning, 32K max output tokens)
|
|
13
|
+
- Qwen3-Coder-480B-A35B (MoE architecture for advanced software engineering, 32K max output tokens)
|
|
14
|
+
- Reasoning content extraction for DeepSeek-R1 via `reasoningContent.reasoningText`
|
|
15
|
+
- Stop sequences support (max 10 items) for DeepSeek and Qwen models
|
|
16
|
+
- Text-to-text completion with streaming support
|
|
17
|
+
- MIT-licensed open weight models for commercial use (DeepSeek)
|
|
18
|
+
- `converse_api_only` flag for models that only support Converse API (automatically forces `useConverseAPI = true`)
|
|
19
|
+
- Long-context handling support for Qwen 3 (up to 256K tokens natively, 1M with extrapolation)
|
|
20
|
+
- Hybrid thinking modes for complex problem-solving vs. fast responses
|
|
21
|
+
- Repository-scale code analysis capabilities for Qwen Coder models
|
|
22
|
+
|
|
23
|
+
### 🤬 Breaking Changes
|
|
24
|
+
- Removed `top_p` parameter from all models as it is not fully supported by AWS Bedrock
|
|
25
|
+
- `temperature` should always be used instead
|
|
26
|
+
|
|
27
|
+
### ⚙️ Technical Details
|
|
28
|
+
- **Model Configuration**: All new models use messages API format (OpenAI-compatible)
|
|
29
|
+
- **API Compatibility**:
|
|
30
|
+
- Qwen 3 models: Support both Invoke API and Converse API
|
|
31
|
+
- DeepSeek-R1: Supports both Invoke API and Converse API
|
|
32
|
+
- DeepSeek-V3.1: Converse API only (automatically enforced)
|
|
33
|
+
|
|
4
34
|
## [2.6.2] - 2025-10-16 (Claude Haiku 4.5)
|
|
5
|
-
### Added
|
|
35
|
+
### ✨ Added
|
|
6
36
|
- Support for Claude Haiku 4.5 models
|
|
7
37
|
- Claude-4-5-Haiku
|
|
8
38
|
- Claude-4-5-Haiku-Thinking
|
|
@@ -12,16 +42,16 @@ All notable changes to this project will be documented in this file.
|
|
|
12
42
|
- Temperature/Top-P mutual exclusion parameter handling for Haiku 4.5 models
|
|
13
43
|
|
|
14
44
|
## [2.6.1] - 2025-09-30 (Claude Sonnet 4.5)
|
|
15
|
-
### Added
|
|
45
|
+
### ✨ Added
|
|
16
46
|
- Support for Claude Sonnet 4.5 models
|
|
17
47
|
- Claude-4-5-Sonnet
|
|
18
48
|
- Claude-4-5-Sonnet-Thinking
|
|
19
49
|
|
|
20
50
|
## [2.5.0] - 2025-08-12 (Converse API)
|
|
21
|
-
### Added
|
|
51
|
+
### ✨ Added
|
|
22
52
|
- Support for Converse API (streaming and non-streaming)
|
|
23
53
|
|
|
24
|
-
### Technical Details
|
|
54
|
+
### ⚙️ Technical Details
|
|
25
55
|
- **Model Configuration**: All models use standard messages API format
|
|
26
56
|
- **API Compatibility**: Supports OpenAI-style requests
|
|
27
57
|
- **Response Processing**: Automatic reasoning tag handling based on model variant
|
|
@@ -29,7 +59,7 @@ All notable changes to this project will be documented in this file.
|
|
|
29
59
|
- **Testing Coverage**: Full integration with existing test suites and interactive example
|
|
30
60
|
|
|
31
61
|
## [2.4.5] - 2025-08-06 (GPT-OSS Models)
|
|
32
|
-
### Added
|
|
62
|
+
### ✨ Added
|
|
33
63
|
- Support for OpenAI GPT-OSS models on AWS Bedrock
|
|
34
64
|
- GPT-OSS-120B (120B parameter open weight model)
|
|
35
65
|
- GPT-OSS-20B (20B parameter open weight model)
|
|
@@ -41,7 +71,7 @@ All notable changes to this project will be documented in this file.
|
|
|
41
71
|
- Non-streaming support for GPT-OSS models (streaming not supported by AWS Bedrock)
|
|
42
72
|
- OpenAI-compatible API format with `max_completion_tokens` parameter
|
|
43
73
|
|
|
44
|
-
### Technical Details
|
|
74
|
+
### ⚙️ Technical Details
|
|
45
75
|
- **Model Configuration**: All GPT-OSS models use standard messages API format
|
|
46
76
|
- **API Compatibility**: Supports OpenAI-style requests with Apache 2.0 licensed models
|
|
47
77
|
- **Response Processing**: Automatic reasoning tag handling based on model variant
|
|
@@ -49,13 +79,13 @@ All notable changes to this project will be documented in this file.
|
|
|
49
79
|
- **Testing Coverage**: Full integration with existing test suites and interactive example
|
|
50
80
|
|
|
51
81
|
## [2.4.4] - 2025-08-05 (Claude 4.1 Opus)
|
|
52
|
-
### Added
|
|
82
|
+
### ✨ Added
|
|
53
83
|
- Support for Claude 4.1 Opus models
|
|
54
84
|
- Claude-4-1-Opus
|
|
55
85
|
- Claude-4-1-Opus-Thinking
|
|
56
86
|
|
|
57
87
|
## [2.4.3] - 2025-07-31 (Stop Sequences Fixes)
|
|
58
|
-
### Fixed
|
|
88
|
+
### 🛠️ Fixed
|
|
59
89
|
- **Critical Discovery**: Removed stop sequences support from Llama models
|
|
60
90
|
- AWS Bedrock does not support stop sequences for Llama models (confirmed via official AWS documentation)
|
|
61
91
|
- Llama models only support: `prompt`, `temperature`, `top_p`, `max_gen_len`, `images`
|
|
@@ -64,7 +94,7 @@ All notable changes to this project will be documented in this file.
|
|
|
64
94
|
- Removed conflicting empty `inferenceConfig: {}` from Nova model configurations
|
|
65
95
|
- Improved error handling for empty responses when stop sequences trigger early
|
|
66
96
|
|
|
67
|
-
### Updated
|
|
97
|
+
### 📝 Updated
|
|
68
98
|
- **Documentation corrections**
|
|
69
99
|
- Corrected stop sequences support claims (removed "all models support" language)
|
|
70
100
|
- Added accurate model-specific support matrix with sequence limits
|
|
@@ -75,14 +105,14 @@ All notable changes to this project will be documented in this file.
|
|
|
75
105
|
- ✅ Mistral models: Full support (up to 10 sequences)
|
|
76
106
|
- ❌ Llama models: Not supported (AWS Bedrock limitation)
|
|
77
107
|
|
|
78
|
-
### Technical Details
|
|
108
|
+
### ⚙️ Technical Details
|
|
79
109
|
- Based on comprehensive research of official AWS Bedrock documentation
|
|
80
110
|
- All changes maintain full backward compatibility
|
|
81
111
|
- Test results show significant improvements in stop sequences reliability for supported models
|
|
82
112
|
- Added detailed explanations to help users understand AWS Bedrock's actual capabilities
|
|
83
113
|
|
|
84
114
|
## [2.4.2] - 2025-07-31 (Stop Sequences Support)
|
|
85
|
-
### Added
|
|
115
|
+
### ✨ Added
|
|
86
116
|
- Stop sequences support for compatible models
|
|
87
117
|
- OpenAI-compatible `stop` and `stop_sequences` parameters
|
|
88
118
|
- Automatic string-to-array conversion for compatibility
|
|
@@ -90,7 +120,7 @@ All notable changes to this project will be documented in this file.
|
|
|
90
120
|
- Enhanced request building logic to include stop sequences in appropriate API formats
|
|
91
121
|
- Comprehensive stop sequences testing and validation with `npm run test-stop`
|
|
92
122
|
|
|
93
|
-
### Fixed
|
|
123
|
+
### 🛠️ Fixed
|
|
94
124
|
- **Critical Discovery**: Removed stop sequences support from Llama models
|
|
95
125
|
- AWS Bedrock does not support stop sequences for Llama models (confirmed via official documentation)
|
|
96
126
|
- Llama models only support: `prompt`, `temperature`, `top_p`, `max_gen_len`, `images`
|
|
@@ -98,7 +128,7 @@ All notable changes to this project will be documented in this file.
|
|
|
98
128
|
- Fixed Nova model configuration conflicts that were causing stop sequence inconsistencies
|
|
99
129
|
- Improved error handling for empty responses when stop sequences trigger early
|
|
100
130
|
|
|
101
|
-
### Technical Details
|
|
131
|
+
### ⚙️ Technical Details
|
|
102
132
|
- **Model Support Matrix**:
|
|
103
133
|
- ✅ Claude models: Full support (up to 8,191 sequences)
|
|
104
134
|
- ✅ Nova models: Full support (up to 4 sequences)
|
|
@@ -110,7 +140,7 @@ All notable changes to this project will be documented in this file.
|
|
|
110
140
|
- Added comprehensive documentation in README.md and CLAUDE.md explaining support limitations
|
|
111
141
|
|
|
112
142
|
## [2.4.0] - 2025-07-24 (AWS Nova Models)
|
|
113
|
-
### Added
|
|
143
|
+
### ✨ Added
|
|
114
144
|
- Support for AWS Nova models
|
|
115
145
|
- Nova-Pro (300K context, multimodal, 5K output tokens)
|
|
116
146
|
- Nova-Lite (300K context, multimodal, optimized for speed)
|
|
@@ -120,7 +150,7 @@ All notable changes to this project will be documented in this file.
|
|
|
120
150
|
- Automatic content array formatting for Nova message compatibility
|
|
121
151
|
|
|
122
152
|
## [2.3.1] - 2025-05-22 (Claude 4 Opus / Sonnet)
|
|
123
|
-
### Added
|
|
153
|
+
### ✨ Added
|
|
124
154
|
- Support for Claude 4 Opus & Claude 4 Sonnet models
|
|
125
155
|
- Claude-4-Opus
|
|
126
156
|
- Claude-4-Opus-Thinking
|
|
@@ -128,7 +158,7 @@ All notable changes to this project will be documented in this file.
|
|
|
128
158
|
- Claude-4-Sonnet-Thinking
|
|
129
159
|
|
|
130
160
|
## [2.3.0] - 2025-02-15 (Claude 3.7 & Image Support)
|
|
131
|
-
### Added
|
|
161
|
+
### ✨ Added
|
|
132
162
|
- Support for Claude 3.7 models
|
|
133
163
|
- Claude-3-7-Sonnet
|
|
134
164
|
- Claude-3-7-Sonnet-Thinking
|
|
@@ -140,20 +170,20 @@ All notable changes to this project will be documented in this file.
|
|
|
140
170
|
- Enhanced message handling for multimodal content
|
|
141
171
|
- Documentation for image support usage
|
|
142
172
|
|
|
143
|
-
### Changed
|
|
173
|
+
### 🔄 Changed
|
|
144
174
|
- Updated model configuration for image-capable models
|
|
145
175
|
- Improved response handling for multimodal inputs
|
|
146
176
|
|
|
147
177
|
## [2.2.0] - 2025-01-01 (Llama 3.3 70b)
|
|
148
|
-
### Added
|
|
178
|
+
### ✨ Added
|
|
149
179
|
- Support for Llama 3.3 70b
|
|
150
180
|
|
|
151
181
|
## [2.1.0] - 2024-11-21 (Claude 3.5 Haiku)
|
|
152
|
-
### Added
|
|
182
|
+
### ✨ Added
|
|
153
183
|
- Support for Claude 3.5 Haiku
|
|
154
184
|
|
|
155
185
|
## [2.0.0] - 2024-10-31 (Claude Sonnet & Haiku)
|
|
156
|
-
### Added
|
|
186
|
+
### ✨ Added
|
|
157
187
|
- Support for Anthropic Sonnet & Haiku models
|
|
158
188
|
- Claude-3-5-Sonnet-v2
|
|
159
189
|
- Claude-3-5-Sonnet
|
|
@@ -163,14 +193,14 @@ All notable changes to this project will be documented in this file.
|
|
|
163
193
|
- Stardardize output to be a string via Streamed and non-Streamed responses
|
|
164
194
|
> **NOTE:** This is a breaking change for previous non-streaming responses. Existing streaming responses will remain unchanged.
|
|
165
195
|
|
|
166
|
-
### Changed
|
|
196
|
+
### 🔄 Changed
|
|
167
197
|
- Complete architecture overhaul for better model support
|
|
168
198
|
- Improved message handling with role-based formatting
|
|
169
199
|
- Enhanced error handling and response processing
|
|
170
200
|
- Standardized model configuration format
|
|
171
201
|
- Updated AWS SDK integration
|
|
172
202
|
|
|
173
|
-
### Technical Details
|
|
203
|
+
### ⚙️ Technical Details
|
|
174
204
|
- Implemented messages API support for compatible models
|
|
175
205
|
- Added system message handling as separate field where supported
|
|
176
206
|
- Configurable token limits per model
|
|
@@ -178,7 +208,7 @@ All notable changes to this project will be documented in this file.
|
|
|
178
208
|
- Cross-region profile support for certain models
|
|
179
209
|
|
|
180
210
|
## [1.3.0] - 2024-07-24 (Llama3.2)
|
|
181
|
-
### Added
|
|
211
|
+
### ✨ Added
|
|
182
212
|
- Support for Llama 3.2 series models
|
|
183
213
|
- Llama-3-2-1b
|
|
184
214
|
- Llama-3-2-3b
|
|
@@ -186,14 +216,14 @@ All notable changes to this project will be documented in this file.
|
|
|
186
216
|
- Llama-3-2-90b
|
|
187
217
|
|
|
188
218
|
## [1.1.0] - 2024-07-24 (Llama3.1)
|
|
189
|
-
### Added
|
|
219
|
+
### ✨ Added
|
|
190
220
|
- Support for Llama 3.1 series models
|
|
191
221
|
- Llama-3-1-8b
|
|
192
222
|
- Llama-3-1-70b
|
|
193
223
|
|
|
194
224
|
|
|
195
225
|
## [1.0.14] - 2024-05-06 (Initial Stable Release)
|
|
196
|
-
### Added
|
|
226
|
+
### ✨ Added
|
|
197
227
|
- Initial stablerelease of Bedrock Wrapper
|
|
198
228
|
- Basic AWS Bedrock integration
|
|
199
229
|
- OpenAI-compatible API object support
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Justin Parker
|
|
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 all
|
|
13
|
-
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 THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Justin Parker
|
|
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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -43,7 +43,6 @@ Bedrock Wrapper is an npm package that simplifies the integration of existing Op
|
|
|
43
43
|
"max_tokens": LLM_MAX_GEN_TOKENS,
|
|
44
44
|
"stream": true,
|
|
45
45
|
"temperature": LLM_TEMPERATURE,
|
|
46
|
-
"top_p": LLM_TOP_P,
|
|
47
46
|
"stop_sequences": ["STOP", "END"], // Optional: sequences that will stop generation
|
|
48
47
|
};
|
|
49
48
|
```
|
|
@@ -158,7 +157,11 @@ Bedrock Wrapper is an npm package that simplifies the integration of existing Op
|
|
|
158
157
|
| Mistral-7b | mistral.mistral-7b-instruct-v0:2 | ❌ |
|
|
159
158
|
| Mixtral-8x7b | mistral.mixtral-8x7b-instruct-v0:1 | ❌ |
|
|
160
159
|
| Mistral-Large | mistral.mistral-large-2402-v1:0 | ❌ |
|
|
161
|
-
|
|
160
|
+
| Qwen3-32B | alibaba.qwen3-32b-instruct-v1:0 | ❌ |
|
|
161
|
+
| Qwen3-Coder-30B-A3B | alibaba.qwen3-coder-30b-a3b-instruct-v1:0 | ❌ |
|
|
162
|
+
| Qwen3-235B-A22B-2507 | alibaba.qwen3-235b-a22b-instruct-2507-v1:0 | ❌ |
|
|
163
|
+
| Qwen3-Coder-480B-A35B | alibaba.qwen3-coder-480b-a35b-instruct-v1:0 | ❌ |
|
|
164
|
+
|
|
162
165
|
To return the list progrmatically you can import and call `listBedrockWrapperSupportedModels`:
|
|
163
166
|
```javascript
|
|
164
167
|
import { listBedrockWrapperSupportedModels } from 'bedrock-wrapper';
|
|
@@ -235,9 +238,10 @@ const openaiChatCompletionsCreateObject = {
|
|
|
235
238
|
|
|
236
239
|
**Model Support:**
|
|
237
240
|
- ✅ **Claude models**: Fully supported (up to 8,191 sequences)
|
|
238
|
-
- ✅ **Nova models**: Fully supported (up to 4 sequences)
|
|
241
|
+
- ✅ **Nova models**: Fully supported (up to 4 sequences)
|
|
239
242
|
- ✅ **GPT-OSS models**: Fully supported
|
|
240
243
|
- ✅ **Mistral models**: Fully supported (up to 10 sequences)
|
|
244
|
+
- ✅ **Qwen models**: Fully supported
|
|
241
245
|
- ❌ **Llama models**: Not supported (AWS Bedrock limitation)
|
|
242
246
|
|
|
243
247
|
**Features:**
|
|
@@ -251,7 +255,7 @@ const openaiChatCompletionsCreateObject = {
|
|
|
251
255
|
// Stop generation when model tries to output "7"
|
|
252
256
|
const result = await bedrockWrapper(awsCreds, {
|
|
253
257
|
messages: [{ role: "user", content: "Count from 1 to 10" }],
|
|
254
|
-
model: "Claude-3-5-Sonnet", // Use Claude, Nova, or
|
|
258
|
+
model: "Claude-3-5-Sonnet", // Use Claude, Nova, Mistral, or Qwen models
|
|
255
259
|
stop_sequences: ["7"]
|
|
256
260
|
});
|
|
257
261
|
// Response: "1, 2, 3, 4, 5, 6," (stops before "7")
|
|
@@ -274,27 +278,6 @@ Some AWS Bedrock models have specific parameter restrictions that are automatica
|
|
|
274
278
|
- Claude-4-Opus & Claude-4-Opus-Thinking
|
|
275
279
|
- Claude-4-1-Opus & Claude-4-1-Opus-Thinking
|
|
276
280
|
|
|
277
|
-
**Restriction:** These models cannot accept both `temperature` and `top_p` parameters simultaneously.
|
|
278
|
-
|
|
279
|
-
**Automatic Handling:** When both parameters are provided, the wrapper automatically:
|
|
280
|
-
1. **Keeps `temperature`** (prioritized as more commonly used)
|
|
281
|
-
2. **Removes `top_p`** to prevent validation errors
|
|
282
|
-
3. **Works with both APIs** (Invoke API and Converse API)
|
|
283
|
-
|
|
284
|
-
```javascript
|
|
285
|
-
const request = {
|
|
286
|
-
messages: [{ role: "user", content: "Hello" }],
|
|
287
|
-
model: "Claude-4-5-Sonnet",
|
|
288
|
-
temperature: 0.7, // ✅ Kept
|
|
289
|
-
top_p: 0.9 // ❌ Automatically removed
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
// No error thrown - wrapper handles the restriction automatically
|
|
293
|
-
const response = await bedrockWrapper(awsCreds, request);
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
**Why This Happens:** AWS Bedrock enforces this restriction on newer Claude models to ensure optimal performance and prevent conflicting sampling parameters.
|
|
297
|
-
|
|
298
281
|
---
|
|
299
282
|
|
|
300
283
|
### 🧪 Testing
|
package/bedrock-models.js
CHANGED
|
@@ -144,9 +144,6 @@ export const bedrock_models = [
|
|
|
144
144
|
"response_nonchunk_element": "content[0].text",
|
|
145
145
|
"thinking_response_chunk_element": "delta.thinking",
|
|
146
146
|
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
147
|
-
"parameter_restrictions": {
|
|
148
|
-
"mutually_exclusive": [["temperature", "top_p"]]
|
|
149
|
-
},
|
|
150
147
|
"special_request_schema": {
|
|
151
148
|
"anthropic_version": "bedrock-2023-05-31",
|
|
152
149
|
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
@@ -175,9 +172,6 @@ export const bedrock_models = [
|
|
|
175
172
|
"response_nonchunk_element": "content[0].text",
|
|
176
173
|
"thinking_response_chunk_element": "delta.thinking",
|
|
177
174
|
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
178
|
-
"parameter_restrictions": {
|
|
179
|
-
"mutually_exclusive": [["temperature", "top_p"]]
|
|
180
|
-
},
|
|
181
175
|
"special_request_schema": {
|
|
182
176
|
"anthropic_version": "bedrock-2023-05-31",
|
|
183
177
|
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
@@ -210,9 +204,6 @@ export const bedrock_models = [
|
|
|
210
204
|
"response_nonchunk_element": "content[0].text",
|
|
211
205
|
"thinking_response_chunk_element": "delta.thinking",
|
|
212
206
|
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
213
|
-
"parameter_restrictions": {
|
|
214
|
-
"mutually_exclusive": [["temperature", "top_p"]]
|
|
215
|
-
},
|
|
216
207
|
"special_request_schema": {
|
|
217
208
|
"anthropic_version": "bedrock-2023-05-31",
|
|
218
209
|
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
@@ -241,9 +232,6 @@ export const bedrock_models = [
|
|
|
241
232
|
"response_nonchunk_element": "content[0].text",
|
|
242
233
|
"thinking_response_chunk_element": "delta.thinking",
|
|
243
234
|
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
244
|
-
"parameter_restrictions": {
|
|
245
|
-
"mutually_exclusive": [["temperature", "top_p"]]
|
|
246
|
-
},
|
|
247
235
|
"special_request_schema": {
|
|
248
236
|
"anthropic_version": "bedrock-2023-05-31",
|
|
249
237
|
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
@@ -276,9 +264,6 @@ export const bedrock_models = [
|
|
|
276
264
|
"response_nonchunk_element": "content[0].text",
|
|
277
265
|
"thinking_response_chunk_element": "delta.thinking",
|
|
278
266
|
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
279
|
-
"parameter_restrictions": {
|
|
280
|
-
"mutually_exclusive": [["temperature", "top_p"]]
|
|
281
|
-
},
|
|
282
267
|
"special_request_schema": {
|
|
283
268
|
"anthropic_version": "bedrock-2023-05-31",
|
|
284
269
|
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
@@ -307,9 +292,6 @@ export const bedrock_models = [
|
|
|
307
292
|
"response_nonchunk_element": "content[0].text",
|
|
308
293
|
"thinking_response_chunk_element": "delta.thinking",
|
|
309
294
|
"thinking_response_nonchunk_element": "content[0].thinking",
|
|
310
|
-
"parameter_restrictions": {
|
|
311
|
-
"mutually_exclusive": [["temperature", "top_p"]]
|
|
312
|
-
},
|
|
313
295
|
"special_request_schema": {
|
|
314
296
|
"anthropic_version": "bedrock-2023-05-31",
|
|
315
297
|
"anthropic_beta": ["output-128k-2025-02-19"],
|
|
@@ -978,4 +960,120 @@ export const bedrock_models = [
|
|
|
978
960
|
"stop_sequences_param_name": "stop",
|
|
979
961
|
"response_chunk_element": "outputs[0].text"
|
|
980
962
|
},
|
|
963
|
+
{
|
|
964
|
+
// ================
|
|
965
|
+
// == Qwen3-32B ==
|
|
966
|
+
// ================
|
|
967
|
+
"modelName": "Qwen3-32B",
|
|
968
|
+
"modelId": "qwen.qwen3-32b-v1:0",
|
|
969
|
+
"vision": false,
|
|
970
|
+
"messages_api": true,
|
|
971
|
+
"system_as_separate_field": false,
|
|
972
|
+
"display_role_names": true,
|
|
973
|
+
"max_tokens_param_name": "max_tokens",
|
|
974
|
+
"max_supported_response_tokens": 32768,
|
|
975
|
+
"stop_sequences_param_name": "stop",
|
|
976
|
+
"response_chunk_element": "choices[0].delta.content",
|
|
977
|
+
"response_nonchunk_element": "choices[0].message.content",
|
|
978
|
+
"special_request_schema": {}
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
// =========================
|
|
982
|
+
// == Qwen3-Coder-30B-A3B ==
|
|
983
|
+
// =========================
|
|
984
|
+
"modelName": "Qwen3-Coder-30B-A3B",
|
|
985
|
+
"modelId": "qwen.qwen3-coder-30b-a3b-v1:0",
|
|
986
|
+
"vision": false,
|
|
987
|
+
"messages_api": true,
|
|
988
|
+
"system_as_separate_field": false,
|
|
989
|
+
"display_role_names": true,
|
|
990
|
+
"max_tokens_param_name": "max_tokens",
|
|
991
|
+
"max_supported_response_tokens": 32768,
|
|
992
|
+
"stop_sequences_param_name": "stop",
|
|
993
|
+
"response_chunk_element": "choices[0].delta.content",
|
|
994
|
+
"response_nonchunk_element": "choices[0].message.content",
|
|
995
|
+
"special_request_schema": {}
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
// ==========================
|
|
999
|
+
// == Qwen3-235B-A22B-2507 ==
|
|
1000
|
+
// ==========================
|
|
1001
|
+
"modelName": "Qwen3-235B-A22B-2507",
|
|
1002
|
+
"modelId": "qwen.qwen3-235b-a22b-2507-v1:0",
|
|
1003
|
+
"vision": false,
|
|
1004
|
+
"messages_api": true,
|
|
1005
|
+
"system_as_separate_field": false,
|
|
1006
|
+
"display_role_names": true,
|
|
1007
|
+
"max_tokens_param_name": "max_tokens",
|
|
1008
|
+
"max_supported_response_tokens": 32768,
|
|
1009
|
+
"stop_sequences_param_name": "stop",
|
|
1010
|
+
"response_chunk_element": "choices[0].delta.content",
|
|
1011
|
+
"response_nonchunk_element": "choices[0].message.content",
|
|
1012
|
+
"special_request_schema": {}
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
// ===========================
|
|
1016
|
+
// == Qwen3-Coder-480B-A35B ==
|
|
1017
|
+
// ===========================
|
|
1018
|
+
"modelName": "Qwen3-Coder-480B-A35B",
|
|
1019
|
+
"modelId": "qwen.qwen3-coder-480b-a35b-v1:0",
|
|
1020
|
+
"vision": false,
|
|
1021
|
+
"messages_api": true,
|
|
1022
|
+
"system_as_separate_field": false,
|
|
1023
|
+
"display_role_names": true,
|
|
1024
|
+
"max_tokens_param_name": "max_tokens",
|
|
1025
|
+
"max_supported_response_tokens": 32768,
|
|
1026
|
+
"stop_sequences_param_name": "stop",
|
|
1027
|
+
"response_chunk_element": "choices[0].delta.content",
|
|
1028
|
+
"response_nonchunk_element": "choices[0].message.content",
|
|
1029
|
+
"special_request_schema": {}
|
|
1030
|
+
},
|
|
1031
|
+
{
|
|
1032
|
+
// =================
|
|
1033
|
+
// == DeepSeek-R1 ==
|
|
1034
|
+
// =================
|
|
1035
|
+
"modelName": "DeepSeek-R1",
|
|
1036
|
+
// "modelId": "deepseek.r1-v1:0",
|
|
1037
|
+
"modelId": "us.deepseek.r1-v1:0",
|
|
1038
|
+
"vision": false,
|
|
1039
|
+
"messages_api": false,
|
|
1040
|
+
"bos_text": "",
|
|
1041
|
+
"role_system_message_prefix": "",
|
|
1042
|
+
"role_system_message_suffix": "",
|
|
1043
|
+
"role_system_prefix": "",
|
|
1044
|
+
"role_system_suffix": "",
|
|
1045
|
+
"role_user_message_prefix": "",
|
|
1046
|
+
"role_user_message_suffix": "",
|
|
1047
|
+
"role_user_prefix": "",
|
|
1048
|
+
"role_user_suffix": "",
|
|
1049
|
+
"role_assistant_message_prefix": "",
|
|
1050
|
+
"role_assistant_message_suffix": "",
|
|
1051
|
+
"role_assistant_prefix": "",
|
|
1052
|
+
"role_assistant_suffix": "",
|
|
1053
|
+
"eom_text": "",
|
|
1054
|
+
"display_role_names": false,
|
|
1055
|
+
"max_tokens_param_name": "max_tokens",
|
|
1056
|
+
"max_supported_response_tokens": 8192,
|
|
1057
|
+
"stop_sequences_param_name": "stop",
|
|
1058
|
+
"response_chunk_element": "choices[0].text",
|
|
1059
|
+
"special_request_schema": {}
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
// ====================
|
|
1063
|
+
// == DeepSeek-V3.1 ==
|
|
1064
|
+
// ====================
|
|
1065
|
+
"modelName": "DeepSeek-V3.1",
|
|
1066
|
+
"modelId": "deepseek.v3-v1:0",
|
|
1067
|
+
"vision": false,
|
|
1068
|
+
"messages_api": true,
|
|
1069
|
+
"converse_api_only": true,
|
|
1070
|
+
"system_as_separate_field": false,
|
|
1071
|
+
"display_role_names": true,
|
|
1072
|
+
"max_tokens_param_name": "max_tokens",
|
|
1073
|
+
"max_supported_response_tokens": 8192,
|
|
1074
|
+
"stop_sequences_param_name": "stop",
|
|
1075
|
+
"response_chunk_element": "choices[0].delta.content",
|
|
1076
|
+
"response_nonchunk_element": "choices[0].message.content",
|
|
1077
|
+
"special_request_schema": {}
|
|
1078
|
+
},
|
|
981
1079
|
];
|