Skip to content

Conversation

@Radheshg04
Copy link
Contributor

@Radheshg04 Radheshg04 commented Jan 19, 2026

Summary

Add support for image generation in the Bedrock provider, enabling the use of Amazon's image generation models like Nova Canvas and Titan Image Generator.

Changes

  • Implemented ImageGeneration function in the Bedrock provider
  • Added support for multiple Bedrock image generation models:
    • nova-canvas-v1:0
    • titan-image-generator-v1:0
    • titan-image-generator-v2:0
  • Created new types for Bedrock image generation requests and responses
  • Added utility functions to convert between Bifrost and Bedrock image formats
  • Implemented model type detection for proper request handling

Type of change

  • Feature
  • Bug fix
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

  1. Configure Bedrock credentials with access to image generation models
  2. Send an image generation request to the Bedrock provider:
curl -X POST http://localhost:8000/v1/images/generations \
  -H "Content-Type: application/json" \
  -d '{
    "model": "amazon.titan-image-generator-v1:0",
    "prompt": "A serene mountain landscape at sunset",
    "n": 1,
    "size": "1024x1024"
  }'
  1. Verify that the response contains the generated image(s) in base64 format

Breaking changes

  • No
  • Yes

Related issues

N/A

Security considerations

This implementation maintains the existing authentication and authorization mechanisms for Bedrock API calls.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Bedrock provider now supports text-to-image generation for supported Nova/Titan models; responses include standardized image data and enriched metadata (provider, model, deployment, latency).
  • Bug Fixes

    • Improved validation and clearer errors for unsupported models, invalid inputs, and API failures; optional inclusion of raw request/response for troubleshooting.
  • Documentation

    • Updated provider docs and support matrix with Image Generation examples, mappings, and a full workflow.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Implements Bedrock ImageGeneration: adds image-generation types, conversion helpers, model detection, full request construction/signing/execution, response parsing and enrichment, and documentation updates for Bedrock image support.

Changes

Cohort / File(s) Summary
Image Generation Implementation
core/providers/bedrock/bedrock.go
Implements ImageGeneration flow: validates operation and config, determines model type, builds/signs/executes Bedrock requests, records latency, parses responses per model, enriches Bifrost response (Provider, ModelRequested, ModelDeployment, Latency, RequestType), and returns context-rich errors or configured response.
Image Conversion Utilities
core/providers/bedrock/images.go
Adds ToBedrockImageGenerationRequest, ToBifrostImageGenerationResponse, and DetermineImageGenModelType; maps fields (n, negativePrompt, seed, quality, style, cfgScale), parses size as WIDTHxHEIGHT (ignores "auto"), and normalizes known Bedrock model identifiers.
Type Definitions
core/providers/bedrock/types.go
Adds exported types/constants: TaskTypeTextImage, BedrockImageGenerationRequest, BedrockTextToImageParams, ImageGenerationConfig, and BedrockImageGenerationResponse to represent Bedrock text→image request/response shapes.
Docs: Bedrock Image Gen & Matrix
docs/providers/supported-providers/bedrock.mdx, docs/providers/supported-providers/overview.mdx
Adds Image Generation support details, examples, request/response mappings, reorders sections, and updates provider support matrix to reflect Bedrock streaming image support.

Sequence Diagram

sequenceDiagram
    participant Client as Client
    participant Provider as BedrockProvider
    participant Detector as ModelDetector
    participant ConverterReq as RequestConverter
    participant BedrockAPI as BedrockAPI
    participant ConverterRes as ResponseParser

    Client->>Provider: ImageGeneration(Bifrost request)
    Provider->>Provider: Validate operation & Bedrock config
    Provider->>Detector: DetermineImageGenModelType(model)
    Detector-->>Provider: model identifier / unsupported
    Provider->>ConverterReq: ToBedrockImageGenerationRequest(request)
    ConverterReq-->>Provider: BedrockImageGenerationRequest
    Provider->>BedrockAPI: signAndExecute(model, request)
    BedrockAPI-->>Provider: BedrockImageGenerationResponse (with latency)
    Provider->>ConverterRes: ToBifrostImageGenerationResponse(response)
    ConverterRes-->>Provider: BifrostImageGenerationResponse
    Provider->>Provider: Enrich response (Provider, ModelRequested, Deployment, Latency, RequestType)
    Provider-->>Client: BifrostImageGenerationResponse or error
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I nibble prompts at break of day,
Pixels bloom where words convey,
Seeds and sizes, brushes hum,
Bedrock crafts what dreams become,
A rabbit cheers — the images run! 🐇🎨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main feature addition—implementing image generation support for the Bedrock provider, which aligns with the core changes across multiple files.
Description check ✅ Passed The description covers all required template sections: Summary, Changes, Type of change, Affected areas, How to test, Breaking changes, Related issues, Security considerations, and Checklist. All key information is present and complete.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 01-19-feat_added_image_generation_support_for_bedrock

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1384

@Radheshg04 Radheshg04 marked this pull request as ready for review January 19, 2026 15:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In `@core/providers/bedrock/bedrock.go`:
- Line 1539: The comment "ImageGeneration is not supported by the Bedrock
provider" is stale—update the comment near the ImageGeneration symbol in the
Bedrock provider implementation (e.g., the ImageGeneration-related function/type
in bedrock.go) to reflect that image generation is now supported; replace the
old negation with a concise positive statement indicating that the Bedrock
provider supports ImageGeneration and, if relevant, note any limitations or
required flags/options.
- Around line 1579-1607: The final "return nil,
providerUtils.NewUnsupportedOperationError(schemas.ImageGenerationRequest,
schemas.Bedrock)" is unreachable because the earlier switch on modelType already
returns in its case and the outer switch has a default return; remove this
trailing unreachable return or restructure the switch so that unsupported-path
handling is the single exit (e.g., move the NewUnsupportedOperationError into
the outer switch default or convert the inner switch to set bifrostResponse and
break instead of returning). Update references: modelType switch,
ToBifrostImageGenerationResponse, providerUtils.NewUnsupportedOperationError,
schemas.ImageGenerationRequest, schemas.Bedrock.

In `@core/providers/bedrock/images.go`:
- Around line 79-85: Remove the debug print in the loop over response.Images:
delete the fmt.Println(image) call inside the for index, image := range
response.Images loop that populates bifrostResponse.Data with schemas.ImageData;
after removing the print, ensure the fmt import is removed if it becomes unused
so the file compiles cleanly.
- Around line 24-43: The code accesses request.Params.Size before verifying
request.Params is non-nil which can panic; update the logic in the image size
parsing block (where request.Params.Size is read and parsed, and
bedrockReq.ImageGenerationConfig.Width/Height are set) to first check that
request.Params != nil and then check Params.Size != nil; move or add the nil
guard around the existing size parsing (including the strings.Split,
strconv.Atoi and assignments to bedrockReq.ImageGenerationConfig) so all
accesses to request.Params are safe.
- Around line 17-22: The code dereferences request.Input.Prompt when building
BedrockNovaCanvasImageGenerationRequest which can panic if request.Input is nil;
update the image generation function to validate request.Input (and optionally
request.Input.Prompt) before use, returning an error (or handling the missing
input) if nil, then construct BedrockTextToImageParams using the validated
prompt; ensure references to BedrockNovaCanvasImageGenerationRequest,
BedrockTextToImageParams, and request.Input.Prompt are updated accordingly.
🧹 Nitpick comments (3)
core/providers/bedrock/types.go (2)

585-592: Consider adding Bedrock prefix for naming consistency.

The ImageGenerationConfig struct lacks the Bedrock prefix that other types in this file consistently use (e.g., BedrockNovaCanvasImageGenerationRequest, BedrockTextToImageParams). Consider renaming to BedrockImageGenerationConfig for consistency.


594-599: Consider using pointer types for optional response fields.

The MaskImage and Error fields are documented as optional but declared as non-pointer strings. This means they'll serialize as empty strings ("") rather than being omitted when not present. Consider using *string with omitempty tags if omission is preferred.

Suggested change
 // BedrockImageGenerationResponse represents a Bedrock image generation response
 type BedrockImageGenerationResponse struct {
 	Images    []string `json:"images"`    // list of Base64 encoded images
-	MaskImage string   `json:"maskImage"` // Base64 encoded mask image (optional)
-	Error     string   `json:"error"`     // error message (if present)
+	MaskImage *string  `json:"maskImage,omitempty"` // Base64 encoded mask image (optional)
+	Error     *string  `json:"error,omitempty"`     // error message (if present)
 }
core/providers/bedrock/bedrock.go (1)

1557-1572: Consider checking for Bedrock API error in response.

The BedrockImageGenerationResponse has an Error field. After unmarshaling at line 1582, consider checking if imageResp.Error is non-empty and returning an appropriate error to the caller rather than silently returning a response that may contain an error message.

Suggested addition after unmarshal
 		var imageResp BedrockImageGenerationResponse
 		if err := sonic.Unmarshal(rawResponse, &imageResp); err != nil {
 			return nil, providerUtils.EnrichError(ctx, providerUtils.NewBifrostOperationError("error parsing image generation response", err, providerName), jsonData, rawResponse, provider.sendBackRawRequest, provider.sendBackRawResponse)
 		}
+		if imageResp.Error != "" {
+			return nil, providerUtils.EnrichError(ctx, providerUtils.NewBifrostOperationError(imageResp.Error, nil, providerName), jsonData, rawResponse, provider.sendBackRawRequest, provider.sendBackRawResponse)
+		}
 		bifrostResponse = ToBifrostImageGenerationResponse(&imageResp)

@Radheshg04 Radheshg04 force-pushed the 01-19-feat_added_image_generation_support_for_bedrock branch from 90b9d93 to 7b490fa Compare January 19, 2026 16:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@core/providers/bedrock/bedrock.go`:
- Around line 1542-1556: Add an early validation guard in
BedrockProvider.ImageGeneration to fast-fail on nil or invalid image-generation
requests before calling DetermineImageGenModelType or
CheckContextAndGetRequestBody: check that request is non-nil, request.Input is
non-nil, and the prompt (request.Input.Prompt) is not empty (or return a Bifrost
configuration/request error via
providerUtils.NewConfigurationError/NewRequestError). Place this check
immediately after verifying key.BedrockKeyConfig and before the
DetermineImageGenModelType call so downstream conversions cannot dereference nil
values.
♻️ Duplicate comments (1)
core/providers/bedrock/images.go (1)

12-22: Validate request.Input and prompt before dereference.

Line 20 dereferences request.Input.Prompt; if Input is nil (or prompt empty) this can panic or produce invalid requests. Add a guard after the request == nil check.

🛠️ Suggested fix
 	if request == nil {
 		return nil, fmt.Errorf("request is nil")
 	}
+	if request.Input == nil || strings.TrimSpace(request.Input.Prompt) == "" {
+		return nil, fmt.Errorf("prompt cannot be empty")
+	}

Based on learnings, ensure image-generation inputs are non-nil before conversion.

🧹 Nitpick comments (1)
core/providers/bedrock/images.go (1)

57-58: Use the repo pointer helper for width/height.

Consider replacing &width/&height with the repo’s pointer helper (e.g., bifrost.Ptr) for consistency.

♻️ Suggested refactor
-			bedrockReq.ImageGenerationConfig.Width = &width
-			bedrockReq.ImageGenerationConfig.Height = &height
+			bedrockReq.ImageGenerationConfig.Width = bifrost.Ptr(width)
+			bedrockReq.ImageGenerationConfig.Height = bifrost.Ptr(height)

Based on learnings, prefer bifrost.Ptr(...) over the address operator for pointer creation.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@core/providers/bedrock/bedrock.go`:
- Around line 1552-1574: The code calls
DetermineImageGenModelType(request.Model) before mapping deployment aliases,
causing valid custom deployment names (from BedrockKeyConfig.Deployments) to be
treated as unsupported; change the flow to resolve the deployment alias first
(use the existing provider.getModelPath or the deployment-mapping logic that
looks up BedrockKeyConfig.Deployments) and then run DetermineImageGenModelType
against the resolved deployment/model string (or check both request.Model and
the resolved deployment) before the switch; update the logic around
DetermineImageGenModelType, getModelPath, and completeRequest to use the
resolved deployment variable so supported image generators are recognized.
♻️ Duplicate comments (1)
core/providers/bedrock/images.go (1)

12-22: Add a provider-level nil guard for request.Input.

request.Input.Prompt is dereferenced without ensuring request.Input is non-nil. If any non-HTTP entrypoint bypasses the handler validation, this can panic. Add a guard in the converter to fail fast.

🔧 Proposed fix
 func ToBedrockNovaCanvasImageGenerationRequest(request *schemas.BifrostImageGenerationRequest) (*BedrockNovaCanvasImageGenerationRequest, error) {
 	if request == nil {
 		return nil, fmt.Errorf("request is nil")
 	}
+	if request.Input == nil {
+		return nil, fmt.Errorf("request input is nil")
+	}

 	bedrockReq := &BedrockNovaCanvasImageGenerationRequest{
 		TaskType: "TEXT_IMAGE",
 		TextToImageParams: BedrockTextToImageParams{
 			Text: request.Input.Prompt,
 		},
 	}

Based on learnings, please keep a provider-level nil guard here.

@Radheshg04 Radheshg04 force-pushed the 01-19-feat_added_image_generation_support_for_bedrock branch from 7b490fa to e9ba497 Compare January 19, 2026 18:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/providers/supported-providers/bedrock.mdx (1)

586-615: Fix section numbering after inserting Image Generation.

Line 586 introduces “# 6. Batch API”, but the later headings still start at “# 6. Files API” (Line 615) and continue with #7/#8/#9, causing duplicate numbering. Please renumber the subsequent sections.

📝 Suggested update
-# 6. Files API
+# 7. Files API
...
-# 7. List Models
+# 8. List Models
...
-# 8. AWS Authentication & Configuration
+# 9. AWS Authentication & Configuration
...
-# 9. Error Handling
+# 10. Error Handling
♻️ Duplicate comments (2)
core/providers/bedrock/bedrock.go (2)

1542-1551: Add an early guard for nil request/Input or empty prompt.

Line 1552 reads request.Model, and downstream conversion accesses request.Input.Prompt. If non-HTTP entry points bypass validation, this can panic or send an empty prompt. Add a fast-fail guard before model type detection.

🛠️ Proposed fix
 	providerName := provider.GetProviderKey()
+	if request == nil || request.Input == nil || strings.TrimSpace(request.Input.Prompt) == "" {
+		return nil, providerUtils.NewBifrostOperationError("prompt cannot be empty", nil, providerName)
+	}
 	if key.BedrockKeyConfig == nil {
 		return nil, providerUtils.NewConfigurationError("bedrock key config is not provided", providerName)
 	}

Based on learnings, add provider-layer validation even if upstream handlers validate input.


1552-1571: Resolve deployment alias before determining image model type.

Line 1552 derives modelType from request.Model. If a deployment alias is configured, it won’t match the expected substrings and valid models will be rejected. Resolve the deployment first (or check both) and detect the model type from the resolved deployment.

🔧 Suggested flow
-	modelType := DetermineImageGenModelType(request.Model)
+	path, deployment := provider.getModelPath("invoke", request.Model, key)
+	modelType := DetermineImageGenModelType(deployment)
 	var rawResponse []byte
 	var jsonData []byte
 	var bifrostError *schemas.BifrostError
 	var latency time.Duration
-	var path string
-	var deployment string
 	switch modelType {
 	case "titan-image-generator-v1:0", "nova-canvas-v1:0", "titan-image-generator-v2:0":
 		jsonData, bifrostError = providerUtils.CheckContextAndGetRequestBody(
 			ctx,
 			request,
 			func() (any, error) { return ToBedrockNovaCanvasImageGenerationRequest(request) },
 			provider.GetProviderKey())
 		if bifrostError != nil {
 			return nil, bifrostError
 		}
-		path, deployment = provider.getModelPath("invoke", request.Model, key)
 		rawResponse, latency, bifrostError = provider.completeRequest(ctx, jsonData, path, key)
 	default:
 		return nil, providerUtils.NewConfigurationError("unsupported image generation model type", providerName)
 	}
🧹 Nitpick comments (1)
core/providers/bedrock/images.go (1)

62-63: Prefer pointer helper for width/height.

Lines 62–63 use &width/&height. The codebase convention is to use pointer helpers for consistency (e.g., schemas.Ptr).

♻️ Suggested tweak
-			bedrockReq.ImageGenerationConfig.Width = &width
-			bedrockReq.ImageGenerationConfig.Height = &height
+			bedrockReq.ImageGenerationConfig.Width = schemas.Ptr(width)
+			bedrockReq.ImageGenerationConfig.Height = schemas.Ptr(height)

Based on learnings, prefer pointer helpers over address-of operators.

@Radheshg04 Radheshg04 force-pushed the 01-19-feat_added_image_generation_support_for_bedrock branch from e9ba497 to a9761e2 Compare January 19, 2026 19:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@core/providers/bedrock/bedrock.go`:
- Around line 1583-1605: After unmarshaling into BedrockImageGenerationResponse,
validate the response.Error field and treat non-empty/nonnull error payloads as
failures: if imageResp.Error (or the actual error field on
BedrockImageGenerationResponse) is present, return an enriched Bifrost error
using providerUtils.EnrichError/providerUtils.NewBifrostOperationError (similar
to the existing parse error handling) instead of continuing to map with
ToBifrostImageGenerationResponse; do this immediately after sonic.Unmarshal and
before calling ToBifrostImageGenerationResponse or setting
bifrostResponse.ExtraFields so raw request/response handling remains unchanged.
🧹 Nitpick comments (1)
docs/providers/supported-providers/bedrock.mdx (1)

522-585: Clarify the expected size format to reduce request errors.

The converter expects WIDTHxHEIGHT; documenting this avoids avoidable failures.

✍️ Suggested doc tweak
 | `size` | `imageGenerationConfig.width` & `imageGenerationConfig.height` |
 
+**Note:** `size` must be in `WIDTHxHEIGHT` format (e.g., `1024x1024`).

@Radheshg04 Radheshg04 force-pushed the 01-19-feat_added_image_generation_support_for_bedrock branch from a9761e2 to f3aec9f Compare January 19, 2026 20:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@docs/providers/supported-providers/bedrock.mdx`:
- Around line 21-28: Update the provider attribution for Nova in the Bedrock
support table: replace the table row label "Nova (Anthropic)" with "Nova
(Amazon)" to match the model ID prefixes like "amazon.nova-canvas-v1" and
"us.amazon.nova-pro-v1" used elsewhere; also scan for any other occurrences of
the "Nova (Anthropic)" string in the same document and update them to "Nova
(Amazon)" to keep documentation consistent.
♻️ Duplicate comments (1)
core/providers/bedrock/bedrock.go (1)

1547-1553: Add provider-layer guard for nil/empty image generation requests.

request.Model is accessed before validation; if this provider is invoked outside the HTTP handler flow, a nil request/request.Input (or empty prompt) can panic or build an invalid payload. Add a fast-fail guard near providerName.

🛠️ Proposed fix
 	providerName := provider.GetProviderKey()
+	if request == nil || request.Input == nil || strings.TrimSpace(request.Input.Prompt) == "" {
+		return nil, providerUtils.NewBifrostOperationError("prompt cannot be empty", nil, providerName)
+	}
 	if key.BedrockKeyConfig == nil {
 		return nil, providerUtils.NewConfigurationError("bedrock key config is not provided", providerName)
 	}

Based on learnings, provider-layer guards should prevent nil input panics.

🧹 Nitpick comments (2)
docs/providers/supported-providers/bedrock.mdx (1)

528-537: Document cfgScale mapping for image generation.

The implementation supports cfgScale via extra_params, but it’s not shown in the parameter mapping table. Adding it helps users discover the supported tuning knob.

✏️ Suggested edit
 | `style` | `textToImageParams.style` |
 | `size` | `imageGenerationConfig.width` & `imageGenerationConfig.height` |
+| `cfgScale` (extra_params.cfgScale) | `imageGenerationConfig.cfgScale` |
core/providers/bedrock/images.go (1)

12-70: Trim size dimensions before parsing to tolerate whitespace.

Inputs like 1024 x 1024 will currently fail Atoi due to embedded spaces. Trimming each dimension makes the parsing more forgiving without changing valid cases.

♻️ Optional tweak
 		if request.Params.Size != nil && strings.TrimSpace(strings.ToLower(*request.Params.Size)) != "auto" {
 
 			size := strings.Split(strings.TrimSpace(strings.ToLower(*request.Params.Size)), "x")
 			if len(size) != 2 {
 				return nil, fmt.Errorf("invalid size format: expected 'WIDTHxHEIGHT', got %q", *request.Params.Size)
 			}
 
-			width, err := strconv.Atoi(size[0])
+			widthStr := strings.TrimSpace(size[0])
+			heightStr := strings.TrimSpace(size[1])
+			width, err := strconv.Atoi(widthStr)
 			if err != nil {
 				return nil, fmt.Errorf("invalid width in size %q: %w", *request.Params.Size, err)
 			}
 
-			height, err := strconv.Atoi(size[1])
+			height, err := strconv.Atoi(heightStr)
 			if err != nil {
 				return nil, fmt.Errorf("invalid height in size %q: %w", *request.Params.Size, err)
 			}

Comment on lines +21 to +28
| Family | Chat | Responses | Text | Embeddings | Image Generation |
|--------|------|-----------|------|------------|------------|
| **Claude (Anthropic)** ||||||
| **Nova (Anthropic)** ||||||
| **Mistral** ||||||
| **Llama** ||||||
| **Cohere** ||||||
| **Titan** ||||||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

git ls-files docs/providers/supported-providers/ | head -20

Repository: maximhq/bifrost

Length of output: 997


🏁 Script executed:

cat -n docs/providers/supported-providers/bedrock.mdx | head -50

Repository: maximhq/bifrost

Length of output: 2847


🏁 Script executed:

# Check if there are any references to Nova or Amazon in the codebase
rg -i "nova|amazon" docs/providers/supported-providers/bedrock.mdx -A 2 -B 2

Repository: maximhq/bifrost

Length of output: 2137


🏁 Script executed:

cat -n docs/providers/supported-providers/bedrock.mdx | sed -n '50,150p'

Repository: maximhq/bifrost

Length of output: 4071


🏁 Script executed:

# Search for any references to Nova provider or family details
rg -i "nova" docs/providers/supported-providers/bedrock.mdx -B 3 -A 3 | head -80

Repository: maximhq/bifrost

Length of output: 2429


🏁 Script executed:

# Check if there's any implementation code showing Nova model handling
rg -r "nova" --type go . | grep -i "provider\|family\|bedrock" | head -20

Repository: maximhq/bifrost

Length of output: 2966


🏁 Script executed:

# Search more carefully for Nova provider details
cat -n docs/providers/supported-providers/bedrock.mdx | sed -n '200,350p'

Repository: maximhq/bifrost

Length of output: 5539


🏁 Script executed:

# Look for Nova in image generation section
cat -n docs/providers/supported-providers/bedrock.mdx | sed -n '180,230p'

Repository: maximhq/bifrost

Length of output: 1934


🏁 Script executed:

# Check if there's actual implementation code showing model family detection
fd bedrock . -type f -name "*.go" | head -5

Repository: maximhq/bifrost

Length of output: 229


🏁 Script executed:

# Check provider metadata or model configuration
rg "amazon.nova\|anthropic.*nova" --type go -B 2 -A 2

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Look for bedrock Go files
fd "bedrock" --type f

Repository: maximhq/bifrost

Length of output: 610


🏁 Script executed:

# Check the bedrock.go file for Nova handling
cat transports/bifrost-http/integrations/bedrock.go | head -100

Repository: maximhq/bifrost

Length of output: 3781


🏁 Script executed:

# Search for model family detection logic
rg "nova" transports/bifrost-http/integrations/bedrock.go --line-number | grep -v "novanova" | head -20

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Check AWS Bedrock documentation by searching for Nova model IDs in the codebase
rg "amazon\.nova\|anthropic.*nova" . --type-list | head -20

Repository: maximhq/bifrost

Length of output: 448


🏁 Script executed:

# Try to find provider info or documentation references
rg -A 5 -B 5 "Nova Canvas" docs/providers/supported-providers/bedrock.mdx

Repository: maximhq/bifrost

Length of output: 316


🏁 Script executed:

# Check core bedrock provider code for model family detection
cat core/providers/bedrock/bedrock.go | head -150

Repository: maximhq/bifrost

Length of output: 5811


🏁 Script executed:

# Search for "Anthropic Nova" specifically to understand the context
rg "Anthropic Nova" . -B 3 -A 3

Repository: maximhq/bifrost

Length of output: 608


🏁 Script executed:

# Look for any configuration or constant that maps model families to providers
rg -i "modelFamily\|model.*family" core/providers/bedrock/ -A 2 -B 2

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Check if there's any documentation about Nova provider origin
rg -i "amazon.*nova\|nova.*amazon" docs/ -B 2 -A 2

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Let me check the full bedrock.mdx file around the "Anthropic Nova Models" section
cat -n docs/providers/supported-providers/bedrock.mdx | sed -n '230,250p'

Repository: maximhq/bifrost

Length of output: 729


🏁 Script executed:

# Check if there are references to both Anthropic and Amazon Nova in the codebase
rg -i "nova" core/providers/bedrock/ -B 2 -A 2 | head -50

Repository: maximhq/bifrost

Length of output: 3531


🏁 Script executed:

# Look for model family constants or enums
rg "const\|type.*Family\|Nova" core/providers/bedrock/bedrock.go | head -30

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Search in test files for Nova model examples
cat tests/integrations/python/tests/test_bedrock.py | grep -i nova -B 2 -A 2

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Check if there's documentation about model provider mapping
rg "model.*provider\|provider.*model" core/providers/bedrock/ -B 1 -A 1 | head -40

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Let's check the image generation section more completely
cat -n docs/providers/supported-providers/bedrock.mdx | sed -n '370,420p'

Repository: maximhq/bifrost

Length of output: 2029


🏁 Script executed:

# Check what the actual model prefix tells us about Nova models
rg "amazon\.nova|anthropic\.nova" docs/ -B 2 -A 2

Repository: maximhq/bifrost

Length of output: 2230


🏁 Script executed:

# Let's check if there's any reference to who makes Nova models in the codebase
rg -i "amazon.*nova\|nova.*amazon" . --type md -B 3 -A 3 | head -50

Repository: maximhq/bifrost

Length of output: 41


🏁 Script executed:

# Check the schemas to see how IsNovaModel is defined
rg "IsNovaModel" . -B 2 -A 5

Repository: maximhq/bifrost

Length of output: 4787


Change Nova family attribution from Anthropic to Amazon in support table.

The model IDs throughout the documentation use amazon.nova-* prefix (e.g., amazon.nova-canvas-v1:0 for image generation, us.amazon.nova-pro-v1:0 for chat), indicating Nova is an Amazon product. The table should reflect this provider attribution.

✏️ Suggested edit
-| **Nova (Anthropic)** | ✅ | ✅ | ❌ | ❌ | ✅ |
+| **Nova (Amazon)** | ✅ | ✅ | ❌ | ❌ | ✅ |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| Family | Chat | Responses | Text | Embeddings | Image Generation |
|--------|------|-----------|------|------------|------------|
| **Claude (Anthropic)** ||||||
| **Nova (Anthropic)** ||||||
| **Mistral** ||||||
| **Llama** ||||||
| **Cohere** ||||||
| **Titan** ||||||
| Family | Chat | Responses | Text | Embeddings | Image Generation |
|--------|------|-----------|------|------------|------------|
| **Claude (Anthropic)** ||||||
| **Nova (Amazon)** ||||||
| **Mistral** ||||||
| **Llama** ||||||
| **Cohere** ||||||
| **Titan** ||||||
🤖 Prompt for AI Agents
In `@docs/providers/supported-providers/bedrock.mdx` around lines 21 - 28, Update
the provider attribution for Nova in the Bedrock support table: replace the
table row label "Nova (Anthropic)" with "Nova (Amazon)" to match the model ID
prefixes like "amazon.nova-canvas-v1" and "us.amazon.nova-pro-v1" used
elsewhere; also scan for any other occurrences of the "Nova (Anthropic)" string
in the same document and update them to "Nova (Amazon)" to keep documentation
consistent.

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.

2 participants