bedrock-wrapper 2.5.0 → 2.6.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/CHANGELOG.md +6 -0
- package/README.md +39 -2
- package/bedrock-models.js +72 -0
- package/bedrock-wrapper.js +85 -11
- package/logs/e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3/notification.json +14 -0
- package/logs/e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3/post_tool_use.json +1106 -0
- package/logs/e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3/pre_tool_use.json +430 -0
- package/logs/e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3/stop.json +7 -0
- package/logs/e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3/user_prompt_submit.json +7 -0
- package/package.json +6 -5
|
@@ -2537,5 +2537,435 @@
|
|
|
2537
2537
|
"file_path": "C:\\git\\bedrock-wrapper\\CLAUDE.md",
|
|
2538
2538
|
"content": "# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\nBedrock Wrapper (v2.5.0) is an npm package that translates OpenAI-compatible API objects to AWS Bedrock's serverless inference LLMs. It supports 32+ models including Claude, Nova, GPT-OSS, Llama, and Mistral families with features like vision support, thinking modes, and stop sequences.\n\n## Core Architecture\n\nThe system has two main API paths and three core components:\n\n### API Paths\n\n1. **Converse API Path** (`useConverseAPI: true`):\n - Unified request/response format across all models\n - Simplified message handling without model-specific formatting\n - Native system prompt support\n - Cleaner multimodal handling\n - Located at lines 510-677 in bedrock-wrapper.js\n\n2. **Invoke API Path** (default):\n - Model-specific request formatting and response parsing\n - Complex prompt construction for non-messages API models\n - Located at lines 680-727 in bedrock-wrapper.js\n\n### Core Components\n\n1. **bedrock-wrapper.js**: Main async generator function\n - `bedrockWrapper()`: Entry point supporting both APIs\n - `convertToConverseFormat()`: Converts OpenAI messages to Converse API format\n - `processMessagesForInvoke()`: Handles model-specific message processing\n - `buildInvokePrompt()`: Constructs model-specific prompts\n - `buildInvokeRequest()`: Creates model-specific request objects\n - Thinking mode support with `<think>` tags for Claude and `<reasoning>` tags for GPT-OSS\n\n2. **bedrock-models.js**: Model configuration registry\n - Each model entry contains: modelName, modelId, vision support, API type, response paths\n - Special configurations for thinking models (budget_tokens, anthropic_beta headers)\n - Stop sequences parameter mapping per model family\n\n3. **utils.js**: Helper utilities\n\n## Development Commands\n\n```bash\n# Install dependencies\nnpm install\n\n# Clean reinstall\nnpm run clean\n\n# Test all models with both APIs (comparison mode)\nnpm run test\n\n# Test with specific API\nnpm run test:invoke # Invoke API only\nnpm run test:converse # Converse API only\n\n# Test vision capabilities (11 vision-enabled models)\nnpm run test-vision\nnpm run test-vision:invoke\nnpm run test-vision:converse\n\n# Test stop sequences (Claude, Nova, GPT-OSS, Mistral)\nnpm run test-stop\nnpm run test-stop:invoke\nnpm run test-stop:converse\n\n# Test Converse API specifically\nnpm run test-converse\n\n# Interactive CLI testing\nnpm run interactive\n```\n\n## Environment Configuration\n\nCreate `.env` file:\n```\nAWS_REGION=us-west-2\nAWS_ACCESS_KEY_ID=your_access_key\nAWS_SECRET_ACCESS_KEY=your_secret_key\nLLM_MAX_GEN_TOKENS=1024\nLLM_TEMPERATURE=0.1\nLLM_TOP_P=0.9\n```\n\n## Adding New Models\n\nRequired fields in bedrock-models.js:\n- `modelName`: Consumer-facing name\n- `modelId`: AWS Bedrock identifier\n- `vision`: Boolean for image support\n- `messages_api`: Boolean (true for Claude/Nova/GPT-OSS, false for prompt-based)\n- `response_chunk_element`: JSON path for streaming responses\n- `response_nonchunk_element`: JSON path for non-streaming responses\n- `special_request_schema`: Model-specific requirements\n- `stop_sequences_param_name`: Parameter name for stop sequences\n\n## Critical Implementation Details\n\n### Converse API Thinking Support\n- Thinking configuration added via `additionalModelRequestFields`\n- Response thinking data extracted from `reasoningContent.reasoningText.text`\n- Budget tokens calculated with constraints: 1024 <= budget_tokens <= (maxTokens * 0.8)\n- Temperature forced to 1.0, top_p removed for thinking models\n\n### Nova Models Special Handling\n- Detect via `special_request_schema.schemaVersion === \"messages-v1\"`\n- Content must be array format: `[{text: content}]`\n- Parameters nested in `inferenceConfig` object\n\n### Image Processing\n- Sharp library resizes images to max 2048x2048\n- Converts all images to JPEG format\n- Supports base64, data URLs, and HTTP URLs\n- Image-only messages are valid (no text required)\n\n### Stop Sequences Support Matrix\n| Model Family | Support | Parameter | Max Count |\n|-------------|---------|-----------|-----------|\n| Claude | \u00e2\u0153\u2026 | stop_sequences | 8,191 |\n| Nova | \u00e2\u0153\u2026 | stopSequences | 4 |\n| GPT-OSS | \u00e2\u0153\u2026 | stop_sequences | TBD |\n| Mistral | \u00e2\u0153\u2026 | stop | 10 |\n| Llama | \u00e2\udc9d\u0152 | N/A | N/A |\n\n### Test Files Output\n- `test-models-output.txt`: Full model test results\n- `test-vision-models-output.txt`: Vision test results\n- `test-stop-sequences-output.txt`: Stop sequences test results\n- `test-converse-api-output.txt`: Converse API comparison results\n\n## Common Issues and Solutions\n\n### Thinking Models Not Showing Tags\n- Ensure `include_thinking_data: true` is in the request\n- Converse API extracts from `reasoningContent.reasoningText.text`\n- Invoke API uses model-specific `thinking_response_chunk_element`\n\n### Stop Sequences Not Working\n- Llama models don't support stop sequences (AWS limitation)\n- Stop sequence stops generation BEFORE the sequence appears\n- Both `stop` and `stop_sequences` parameters are accepted\n\n### Image Processing Failures\n- Ensure images are under 2048x2048 pixels\n- Use JPEG format for best compatibility\n- Check model has `vision: true` in configuration\n\n## Testing Best Practices\n- Always test with both APIs using `--both` flag for comparison\n- Check output files for detailed error messages\n- Use `npm run interactive` for debugging specific models\n- Test thinking models with `include_thinking_data: true`"
|
|
2539
2539
|
}
|
|
2540
|
+
},
|
|
2541
|
+
{
|
|
2542
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2543
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2544
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2545
|
+
"hook_event_name": "PreToolUse",
|
|
2546
|
+
"tool_name": "LS",
|
|
2547
|
+
"tool_input": {
|
|
2548
|
+
"path": "C:\\git\\bedrock-proxy-endpoint"
|
|
2549
|
+
}
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2553
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2554
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2555
|
+
"hook_event_name": "PreToolUse",
|
|
2556
|
+
"tool_name": "Read",
|
|
2557
|
+
"tool_input": {
|
|
2558
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\server.js"
|
|
2559
|
+
}
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2563
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2564
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2565
|
+
"hook_event_name": "PreToolUse",
|
|
2566
|
+
"tool_name": "Read",
|
|
2567
|
+
"tool_input": {
|
|
2568
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\package.json"
|
|
2569
|
+
}
|
|
2570
|
+
},
|
|
2571
|
+
{
|
|
2572
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2573
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2574
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2575
|
+
"hook_event_name": "PreToolUse",
|
|
2576
|
+
"tool_name": "Read",
|
|
2577
|
+
"tool_input": {
|
|
2578
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\README.md"
|
|
2579
|
+
}
|
|
2580
|
+
},
|
|
2581
|
+
{
|
|
2582
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2583
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2584
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2585
|
+
"hook_event_name": "PreToolUse",
|
|
2586
|
+
"tool_name": "Read",
|
|
2587
|
+
"tool_input": {
|
|
2588
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\example\\example.js"
|
|
2589
|
+
}
|
|
2590
|
+
},
|
|
2591
|
+
{
|
|
2592
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2593
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2594
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2595
|
+
"hook_event_name": "PreToolUse",
|
|
2596
|
+
"tool_name": "Read",
|
|
2597
|
+
"tool_input": {
|
|
2598
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\CHANGELOG.md"
|
|
2599
|
+
}
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2603
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2604
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2605
|
+
"hook_event_name": "PreToolUse",
|
|
2606
|
+
"tool_name": "ExitPlanMode",
|
|
2607
|
+
"tool_input": {
|
|
2608
|
+
"plan": "## Plan to Add `useConverseAPI` Parameter to Bedrock Proxy Endpoint\n\nI'll add the `useConverseAPI` optional parameter to the bedrock-proxy-endpoint project, following the same pattern as the existing `include_thinking_data` parameter.\n\n### Changes Required:\n\n#### 1. **server.js** (Main proxy server file)\n- **Line 128-129**: Add `use_converse_api = false` to the parameter extraction, right after `include_thinking_data`\n- **Line 172**: Add `use_converse_api` to the `openaiChatCompletionsCreateObject`\n- **Line 193**: Update the `bedrockWrapper` call to pass `useConverseAPI: use_converse_api` in the options object\n- **Line 209**: Update the non-streaming `bedrockWrapper` call similarly\n\n#### 2. **README.md** (Documentation)\n- Add documentation for the new `use_converse_api` parameter in the \"Important values\" section (around line 90)\n- Update the example code to show the new parameter (around line 134)\n- Add a note explaining the benefits of the Converse API\n\n#### 3. **example/example.js** (Example file)\n- Add the `use_converse_api` parameter to the example (around line 40)\n- Add a comment explaining when to use it\n\n#### 4. **package.json**\n- Update version from 2.4.5 to 2.5.0 to match the bedrock-wrapper version that includes Converse API support\n\n#### 5. **CHANGELOG.md**\n- Add a new entry for version 2.5.0 documenting the Converse API support\n\n### Implementation Details:\n\nThe parameter will:\n- Default to `false` to maintain backward compatibility (uses Invoke API by default)\n- When set to `true`, use AWS Bedrock's Converse API for unified request/response format\n- Work exactly like `include_thinking_data` - as an optional boolean parameter in the OpenAI chat completions request\n\n### Benefits of this addition:\n- Allows users to opt-in to the simpler, unified Converse API\n- Provides better consistency across different model families\n- Maintains full backward compatibility with existing implementations\n- Follows the established pattern for optional parameters in the codebase"
|
|
2609
|
+
}
|
|
2610
|
+
},
|
|
2611
|
+
{
|
|
2612
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2613
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2614
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2615
|
+
"hook_event_name": "PreToolUse",
|
|
2616
|
+
"tool_name": "TodoWrite",
|
|
2617
|
+
"tool_input": {
|
|
2618
|
+
"todos": [
|
|
2619
|
+
{
|
|
2620
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2621
|
+
"status": "pending",
|
|
2622
|
+
"id": "1"
|
|
2623
|
+
},
|
|
2624
|
+
{
|
|
2625
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2626
|
+
"status": "pending",
|
|
2627
|
+
"id": "2"
|
|
2628
|
+
},
|
|
2629
|
+
{
|
|
2630
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2631
|
+
"status": "pending",
|
|
2632
|
+
"id": "3"
|
|
2633
|
+
},
|
|
2634
|
+
{
|
|
2635
|
+
"content": "Update package.json version to 2.5.0",
|
|
2636
|
+
"status": "pending",
|
|
2637
|
+
"id": "4"
|
|
2638
|
+
},
|
|
2639
|
+
{
|
|
2640
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2641
|
+
"status": "pending",
|
|
2642
|
+
"id": "5"
|
|
2643
|
+
}
|
|
2644
|
+
]
|
|
2645
|
+
}
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2649
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2650
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2651
|
+
"hook_event_name": "PreToolUse",
|
|
2652
|
+
"tool_name": "TodoWrite",
|
|
2653
|
+
"tool_input": {
|
|
2654
|
+
"todos": [
|
|
2655
|
+
{
|
|
2656
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2657
|
+
"status": "in_progress",
|
|
2658
|
+
"id": "1"
|
|
2659
|
+
},
|
|
2660
|
+
{
|
|
2661
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2662
|
+
"status": "pending",
|
|
2663
|
+
"id": "2"
|
|
2664
|
+
},
|
|
2665
|
+
{
|
|
2666
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2667
|
+
"status": "pending",
|
|
2668
|
+
"id": "3"
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
"content": "Update package.json version to 2.5.0",
|
|
2672
|
+
"status": "pending",
|
|
2673
|
+
"id": "4"
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2677
|
+
"status": "pending",
|
|
2678
|
+
"id": "5"
|
|
2679
|
+
}
|
|
2680
|
+
]
|
|
2681
|
+
}
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2685
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2686
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2687
|
+
"hook_event_name": "PreToolUse",
|
|
2688
|
+
"tool_name": "Edit",
|
|
2689
|
+
"tool_input": {
|
|
2690
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\server.js",
|
|
2691
|
+
"old_string": " // Extract parameters from the incoming request\n const {\n messages = [],\n model = 'Llama-3-8b',\n max_tokens = 800,\n temperature = 0.1,\n top_p = 0.9,\n stream = true,\n include_thinking_data = false\n } = req.body;",
|
|
2692
|
+
"new_string": " // Extract parameters from the incoming request\n const {\n messages = [],\n model = 'Llama-3-8b',\n max_tokens = 800,\n temperature = 0.1,\n top_p = 0.9,\n stream = true,\n include_thinking_data = false,\n use_converse_api = false\n } = req.body;"
|
|
2693
|
+
}
|
|
2694
|
+
},
|
|
2695
|
+
{
|
|
2696
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2697
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2698
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2699
|
+
"hook_event_name": "PreToolUse",
|
|
2700
|
+
"tool_name": "Edit",
|
|
2701
|
+
"tool_input": {
|
|
2702
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\server.js",
|
|
2703
|
+
"old_string": " // ----------------------------------------------------------------------\n // -- create an object that copies your openai chat completions object --\n // ----------------------------------------------------------------------\n const openaiChatCompletionsCreateObject = {\n messages: messages,\n model: model,\n max_tokens: max_tokens,\n stream: stream,\n temperature: temperature,\n top_p: top_p,\n include_thinking_data: include_thinking_data,\n ...(req.body.stop && { stop: req.body.stop }),\n ...(req.body.stop_sequences && { stop_sequences: req.body.stop_sequences })\n };",
|
|
2704
|
+
"new_string": " // ----------------------------------------------------------------------\n // -- create an object that copies your openai chat completions object --\n // ----------------------------------------------------------------------\n const openaiChatCompletionsCreateObject = {\n messages: messages,\n model: model,\n max_tokens: max_tokens,\n stream: stream,\n temperature: temperature,\n top_p: top_p,\n include_thinking_data: include_thinking_data,\n use_converse_api: use_converse_api,\n ...(req.body.stop && { stop: req.body.stop }),\n ...(req.body.stop_sequences && { stop_sequences: req.body.stop_sequences })\n };"
|
|
2705
|
+
}
|
|
2706
|
+
},
|
|
2707
|
+
{
|
|
2708
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2709
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2710
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2711
|
+
"hook_event_name": "PreToolUse",
|
|
2712
|
+
"tool_name": "Edit",
|
|
2713
|
+
"tool_input": {
|
|
2714
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\server.js",
|
|
2715
|
+
"old_string": " // -------------------\n // -- streamed call --\n // -------------------\n for await (const chunk of bedrockWrapper(awsCreds, openaiChatCompletionsCreateObject, { logging: CONSOLE_LOGGING })) {",
|
|
2716
|
+
"new_string": " // -------------------\n // -- streamed call --\n // -------------------\n for await (const chunk of bedrockWrapper(awsCreds, openaiChatCompletionsCreateObject, { logging: CONSOLE_LOGGING, useConverseAPI: use_converse_api })) {"
|
|
2717
|
+
}
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2721
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2722
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2723
|
+
"hook_event_name": "PreToolUse",
|
|
2724
|
+
"tool_name": "Edit",
|
|
2725
|
+
"tool_input": {
|
|
2726
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\server.js",
|
|
2727
|
+
"old_string": " // ---------------------\n // -- unstreamed call --\n // ---------------------\n const response = await bedrockWrapper(awsCreds, openaiChatCompletionsCreateObject, { logging: CONSOLE_LOGGING });",
|
|
2728
|
+
"new_string": " // ---------------------\n // -- unstreamed call --\n // ---------------------\n const response = await bedrockWrapper(awsCreds, openaiChatCompletionsCreateObject, { logging: CONSOLE_LOGGING, useConverseAPI: use_converse_api });"
|
|
2729
|
+
}
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2733
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2734
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2735
|
+
"hook_event_name": "PreToolUse",
|
|
2736
|
+
"tool_name": "TodoWrite",
|
|
2737
|
+
"tool_input": {
|
|
2738
|
+
"todos": [
|
|
2739
|
+
{
|
|
2740
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2741
|
+
"status": "completed",
|
|
2742
|
+
"id": "1"
|
|
2743
|
+
},
|
|
2744
|
+
{
|
|
2745
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2746
|
+
"status": "in_progress",
|
|
2747
|
+
"id": "2"
|
|
2748
|
+
},
|
|
2749
|
+
{
|
|
2750
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2751
|
+
"status": "pending",
|
|
2752
|
+
"id": "3"
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
"content": "Update package.json version to 2.5.0",
|
|
2756
|
+
"status": "pending",
|
|
2757
|
+
"id": "4"
|
|
2758
|
+
},
|
|
2759
|
+
{
|
|
2760
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2761
|
+
"status": "pending",
|
|
2762
|
+
"id": "5"
|
|
2763
|
+
}
|
|
2764
|
+
]
|
|
2765
|
+
}
|
|
2766
|
+
},
|
|
2767
|
+
{
|
|
2768
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2769
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2770
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2771
|
+
"hook_event_name": "PreToolUse",
|
|
2772
|
+
"tool_name": "Edit",
|
|
2773
|
+
"tool_input": {
|
|
2774
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\README.md",
|
|
2775
|
+
"old_string": "- Important values\n - `baseUrl`: Root address of server based on your `.env` configuration.\n - `apiKey`: Descibed in the *Authentication* section above.\n - `messages`: Array of objects in role / content format.\n - `model`: This is the `modelName` from the list of supported models found on the `Bedrock Wrapper` README file [here](https://github.com/jparkerweb/bedrock-wrapper?tab=readme-ov-file#supported-models); The `/models` enpoint of this server will also return a list of supported models.\n - `include_thinking_data`: _Optional_ boolean parameter that when set to `true` will include the model's thinking process in the response (only used with thinking models such as `Claude-3-7-Sonnet-Thinking`).\n - `stop` or `stop_sequences`: _Optional_ parameter to specify text sequences that will cause the model to stop generating (e.g., `[\"STOP\", \"END\"]`).",
|
|
2776
|
+
"new_string": "- Important values\n - `baseUrl`: Root address of server based on your `.env` configuration.\n - `apiKey`: Descibed in the *Authentication* section above.\n - `messages`: Array of objects in role / content format.\n - `model`: This is the `modelName` from the list of supported models found on the `Bedrock Wrapper` README file [here](https://github.com/jparkerweb/bedrock-wrapper?tab=readme-ov-file#supported-models); The `/models` enpoint of this server will also return a list of supported models.\n - `include_thinking_data`: _Optional_ boolean parameter that when set to `true` will include the model's thinking process in the response (only used with thinking models such as `Claude-3-7-Sonnet-Thinking`).\n - `use_converse_api`: _Optional_ boolean parameter that when set to `true` will use AWS Bedrock's Converse API instead of the Invoke API. The Converse API provides a unified request/response format across all models, better conversation management, and cleaner multimodal handling. Defaults to `false` for backward compatibility.\n - `stop` or `stop_sequences`: _Optional_ parameter to specify text sequences that will cause the model to stop generating (e.g., `[\"STOP\", \"END\"]`)."
|
|
2777
|
+
}
|
|
2778
|
+
},
|
|
2779
|
+
{
|
|
2780
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2781
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2782
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2783
|
+
"hook_event_name": "PreToolUse",
|
|
2784
|
+
"tool_name": "Edit",
|
|
2785
|
+
"tool_input": {
|
|
2786
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\README.md",
|
|
2787
|
+
"old_string": " const chatCompletion = await openai.chat.completions.create({\n messages: messages,\n model: \"Claude-4-Sonnet\",\n max_tokens: 2048,\n temperature: 0.4,\n top_p: 0.7,\n stream: true,\n include_thinking_data: false, // Set to true for thinking models like \"Claude-4-Sonnet-Thinking\"\n });",
|
|
2788
|
+
"new_string": " const chatCompletion = await openai.chat.completions.create({\n messages: messages,\n model: \"Claude-4-Sonnet\",\n max_tokens: 2048,\n temperature: 0.4,\n top_p: 0.7,\n stream: true,\n include_thinking_data: false, // Set to true for thinking models like \"Claude-4-Sonnet-Thinking\"\n use_converse_api: false, // Set to true to use the unified Converse API instead of Invoke API\n });"
|
|
2789
|
+
}
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2793
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2794
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2795
|
+
"hook_event_name": "PreToolUse",
|
|
2796
|
+
"tool_name": "TodoWrite",
|
|
2797
|
+
"tool_input": {
|
|
2798
|
+
"todos": [
|
|
2799
|
+
{
|
|
2800
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2801
|
+
"status": "completed",
|
|
2802
|
+
"id": "1"
|
|
2803
|
+
},
|
|
2804
|
+
{
|
|
2805
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2806
|
+
"status": "completed",
|
|
2807
|
+
"id": "2"
|
|
2808
|
+
},
|
|
2809
|
+
{
|
|
2810
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2811
|
+
"status": "in_progress",
|
|
2812
|
+
"id": "3"
|
|
2813
|
+
},
|
|
2814
|
+
{
|
|
2815
|
+
"content": "Update package.json version to 2.5.0",
|
|
2816
|
+
"status": "pending",
|
|
2817
|
+
"id": "4"
|
|
2818
|
+
},
|
|
2819
|
+
{
|
|
2820
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2821
|
+
"status": "pending",
|
|
2822
|
+
"id": "5"
|
|
2823
|
+
}
|
|
2824
|
+
]
|
|
2825
|
+
}
|
|
2826
|
+
},
|
|
2827
|
+
{
|
|
2828
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2829
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2830
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2831
|
+
"hook_event_name": "PreToolUse",
|
|
2832
|
+
"tool_name": "Edit",
|
|
2833
|
+
"tool_input": {
|
|
2834
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\example\\example.js",
|
|
2835
|
+
"old_string": " const chatCompletion = await openai.chat.completions.create({\n messages: messages,\n model: \"Claude-3-7-Sonnet-Thinking\", // Try: \"Claude-4-Sonnet\", \"Claude-4-Opus\", \"Claude-4-Sonnet-Thinking\", \"Claude-4-Opus-Thinking\"\n max_tokens: 2048,\n temperature: 0.4,\n top_p: 0.7,\n stream: true,\n include_thinking_data: true, // Works with thinking models\n });",
|
|
2836
|
+
"new_string": " const chatCompletion = await openai.chat.completions.create({\n messages: messages,\n model: \"Claude-3-7-Sonnet-Thinking\", // Try: \"Claude-4-Sonnet\", \"Claude-4-Opus\", \"Claude-4-Sonnet-Thinking\", \"Claude-4-Opus-Thinking\"\n max_tokens: 2048,\n temperature: 0.4,\n top_p: 0.7,\n stream: true,\n include_thinking_data: true, // Works with thinking models\n use_converse_api: false, // Set to true to use the unified Converse API (better consistency across models)\n });"
|
|
2837
|
+
}
|
|
2838
|
+
},
|
|
2839
|
+
{
|
|
2840
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2841
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2842
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2843
|
+
"hook_event_name": "PreToolUse",
|
|
2844
|
+
"tool_name": "TodoWrite",
|
|
2845
|
+
"tool_input": {
|
|
2846
|
+
"todos": [
|
|
2847
|
+
{
|
|
2848
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2849
|
+
"status": "completed",
|
|
2850
|
+
"id": "1"
|
|
2851
|
+
},
|
|
2852
|
+
{
|
|
2853
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2854
|
+
"status": "completed",
|
|
2855
|
+
"id": "2"
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2859
|
+
"status": "completed",
|
|
2860
|
+
"id": "3"
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
"content": "Update package.json version to 2.5.0",
|
|
2864
|
+
"status": "in_progress",
|
|
2865
|
+
"id": "4"
|
|
2866
|
+
},
|
|
2867
|
+
{
|
|
2868
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2869
|
+
"status": "pending",
|
|
2870
|
+
"id": "5"
|
|
2871
|
+
}
|
|
2872
|
+
]
|
|
2873
|
+
}
|
|
2874
|
+
},
|
|
2875
|
+
{
|
|
2876
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2877
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2878
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2879
|
+
"hook_event_name": "PreToolUse",
|
|
2880
|
+
"tool_name": "Edit",
|
|
2881
|
+
"tool_input": {
|
|
2882
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\package.json",
|
|
2883
|
+
"old_string": " \"version\": \"2.4.5\",",
|
|
2884
|
+
"new_string": " \"version\": \"2.5.0\","
|
|
2885
|
+
}
|
|
2886
|
+
},
|
|
2887
|
+
{
|
|
2888
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2889
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2890
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2891
|
+
"hook_event_name": "PreToolUse",
|
|
2892
|
+
"tool_name": "TodoWrite",
|
|
2893
|
+
"tool_input": {
|
|
2894
|
+
"todos": [
|
|
2895
|
+
{
|
|
2896
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2897
|
+
"status": "completed",
|
|
2898
|
+
"id": "1"
|
|
2899
|
+
},
|
|
2900
|
+
{
|
|
2901
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2902
|
+
"status": "completed",
|
|
2903
|
+
"id": "2"
|
|
2904
|
+
},
|
|
2905
|
+
{
|
|
2906
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2907
|
+
"status": "completed",
|
|
2908
|
+
"id": "3"
|
|
2909
|
+
},
|
|
2910
|
+
{
|
|
2911
|
+
"content": "Update package.json version to 2.5.0",
|
|
2912
|
+
"status": "completed",
|
|
2913
|
+
"id": "4"
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2917
|
+
"status": "in_progress",
|
|
2918
|
+
"id": "5"
|
|
2919
|
+
}
|
|
2920
|
+
]
|
|
2921
|
+
}
|
|
2922
|
+
},
|
|
2923
|
+
{
|
|
2924
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2925
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2926
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2927
|
+
"hook_event_name": "PreToolUse",
|
|
2928
|
+
"tool_name": "Edit",
|
|
2929
|
+
"tool_input": {
|
|
2930
|
+
"file_path": "C:\\git\\bedrock-proxy-endpoint\\CHANGELOG.md",
|
|
2931
|
+
"old_string": "# Changelog\nAll notable changes to this project will be documented in this file.\n\n## [2.4.5] - 2025-08-06",
|
|
2932
|
+
"new_string": "# Changelog\nAll notable changes to this project will be documented in this file.\n\n## [2.5.0] - 2025-08-12\n### Added\n- Updated to use Bedrock Wrapper v2.5.0\n- Support for AWS Bedrock Converse API via `use_converse_api` parameter\n - Optional boolean parameter that defaults to `false` for backward compatibility\n - When set to `true`, uses the unified Converse API instead of Invoke API\n - Provides consistent request/response format across all model families\n - Simplifies conversation management and multimodal handling\n - Better support for system prompts and tool use (where applicable)\n- Converse API benefits include:\n - Unified API format across Claude, Nova, GPT-OSS, Llama, and Mistral models\n - Cleaner handling of thinking models with proper `reasoningContent` extraction\n - Simplified message format without model-specific prompt construction\n - Native support for system prompts as a separate field\n\n### Technical Details\n- The `use_converse_api` parameter follows the same pattern as `include_thinking_data`\n- Passes through to bedrock-wrapper's `useConverseAPI` option\n- Works with both streaming and non-streaming responses\n- Maintains full backward compatibility when not specified or set to `false`\n\n## [2.4.5] - 2025-08-06"
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2935
|
+
{
|
|
2936
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
2937
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
2938
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
2939
|
+
"hook_event_name": "PreToolUse",
|
|
2940
|
+
"tool_name": "TodoWrite",
|
|
2941
|
+
"tool_input": {
|
|
2942
|
+
"todos": [
|
|
2943
|
+
{
|
|
2944
|
+
"content": "Update server.js to add use_converse_api parameter extraction and pass to bedrockWrapper",
|
|
2945
|
+
"status": "completed",
|
|
2946
|
+
"id": "1"
|
|
2947
|
+
},
|
|
2948
|
+
{
|
|
2949
|
+
"content": "Update README.md to document the new use_converse_api parameter",
|
|
2950
|
+
"status": "completed",
|
|
2951
|
+
"id": "2"
|
|
2952
|
+
},
|
|
2953
|
+
{
|
|
2954
|
+
"content": "Update example/example.js to include use_converse_api in the example",
|
|
2955
|
+
"status": "completed",
|
|
2956
|
+
"id": "3"
|
|
2957
|
+
},
|
|
2958
|
+
{
|
|
2959
|
+
"content": "Update package.json version to 2.5.0",
|
|
2960
|
+
"status": "completed",
|
|
2961
|
+
"id": "4"
|
|
2962
|
+
},
|
|
2963
|
+
{
|
|
2964
|
+
"content": "Update CHANGELOG.md to document version 2.5.0 with Converse API support",
|
|
2965
|
+
"status": "completed",
|
|
2966
|
+
"id": "5"
|
|
2967
|
+
}
|
|
2968
|
+
]
|
|
2969
|
+
}
|
|
2540
2970
|
}
|
|
2541
2971
|
]
|
|
@@ -76,6 +76,13 @@
|
|
|
76
76
|
"hook_event_name": "Stop",
|
|
77
77
|
"stop_hook_active": false
|
|
78
78
|
},
|
|
79
|
+
{
|
|
80
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
81
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
82
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
83
|
+
"hook_event_name": "Stop",
|
|
84
|
+
"stop_hook_active": false
|
|
85
|
+
},
|
|
79
86
|
{
|
|
80
87
|
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
81
88
|
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
@@ -82,5 +82,12 @@
|
|
|
82
82
|
"cwd": "C:\\git\\bedrock-wrapper",
|
|
83
83
|
"hook_event_name": "UserPromptSubmit",
|
|
84
84
|
"prompt": "/init "
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"session_id": "e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3",
|
|
88
|
+
"transcript_path": "C:\\Users\\Justin.Parker\\.claude\\projects\\C--git-bedrock-wrapper\\e4cf59ef-9d22-45bf-9c6c-53e3cb9efda3.jsonl",
|
|
89
|
+
"cwd": "C:\\git\\bedrock-wrapper",
|
|
90
|
+
"hook_event_name": "UserPromptSubmit",
|
|
91
|
+
"prompt": "I want to add our \"use converse api\" optional parameter to the `bedrock-proxy-endpoint` project. We use an optional paramaeter in a similar way for `include_thinking_data`; lets use this same approach."
|
|
85
92
|
}
|
|
86
93
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bedrock-wrapper",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "🪨 Bedrock Wrapper is an npm package that simplifies the integration of existing OpenAI-compatible API objects with AWS Bedrock's serverless inference LLMs.",
|
|
5
5
|
"homepage": "https://www.equilllabs.com/projects/bedrock-wrapper",
|
|
6
6
|
"repository": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"test-stop:invoke": "node test-stop-sequences.js",
|
|
24
24
|
"test-stop:converse": "node test-stop-sequences.js --converse",
|
|
25
25
|
"test-converse": "node test-converse-api.js",
|
|
26
|
+
"test:all": "npm run test && npm run test-vision && npm run test-stop && npm run test-converse",
|
|
26
27
|
"interactive": "node interactive-example.js"
|
|
27
28
|
},
|
|
28
29
|
"main": "bedrock-wrapper.js",
|
|
@@ -40,11 +41,11 @@
|
|
|
40
41
|
"author": "",
|
|
41
42
|
"license": "ISC",
|
|
42
43
|
"dependencies": {
|
|
43
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
|
44
|
-
"dotenv": "^17.2.
|
|
45
|
-
"sharp": "^0.34.
|
|
44
|
+
"@aws-sdk/client-bedrock-runtime": "^3.899.0",
|
|
45
|
+
"dotenv": "^17.2.3",
|
|
46
|
+
"sharp": "^0.34.4"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"chalk": "^5.
|
|
49
|
+
"chalk": "^5.6.2"
|
|
49
50
|
}
|
|
50
51
|
}
|