Skip to content

AWS: Refactor provider to use Bedrock Converse API#171

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/refactor-aws-package-converse-api
Draft

AWS: Refactor provider to use Bedrock Converse API#171
Copilot wants to merge 4 commits intomainfrom
copilot/refactor-aws-package-converse-api

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

The AWS provider had three separate model-family-specific implementations (Anthropic/Claude, Llama/Mistral, Cohere), each with their own request/response format. The Converse API provides a unified interface across all Bedrock chat models.

Changes

Unified chat execution (aws.ts)

  • Replaced executeAnthropicModel, executeLlamaStyleModel, executeCohereModel (and their streaming counterparts + all helper methods) with a single executeWithConverse() / streamWithConverse() pair
  • Message/system/tool conversion now happens through a single convertRequestToConverse() pipeline rather than three divergent paths
  • Hook types updated from InvokeModelCommand | InvokeModelWithResponseStreamCommandConverseCommand | ConverseStreamCommand
  • Dropped anthropic-specific config block (version, beta, emptyMessage) — not applicable to the Converse API
  • Fixed broken imports (isModelInfo from wrong path, unused http module, Anthropic SDK types)
  • Streaming now handles reasoningContent blocks natively via Converse API events
// Before: routing to family-specific implementations
if (family === 'anthropic') return self.executeAnthropicModel(...)
else if (family === 'meta' || family === 'mistral') return self.executeLlamaStyleModel(...)
else if (family === 'cohere') return self.executeCohereModel(...)

// After: single Converse API path for all chat models
return self.executeWithConverse(modelInput, request, ctx)

Capability detection (common.ts)

  • Expanded tools capability to Llama 3.1+, Mistral Large, and Cohere Command R — models that support tool use via the Converse API but were previously excluded

Removed dependency

  • @anthropic-ai/sdk devDependency dropped; Anthropic-specific SDK types are no longer needed

Image generation (Stability AI) and embeddings (Amazon Titan) continue to use InvokeModelCommand — they are not part of the Converse API surface.

Copilot AI linked an issue Mar 31, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits March 31, 2026 10:46
Agent-Logs-Url: https://github.com/ClickerMonkey/aeye/sessions/f9ae043b-e57a-411d-a2b1-6a78c7e125df

Co-authored-by: ClickerMonkey <421233+ClickerMonkey@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor AWS package to use Converse API for model calls AWS: Refactor provider to use Bedrock Converse API Mar 31, 2026
Copilot AI requested a review from ClickerMonkey March 31, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AWS: Converse API

2 participants