Skip to content

Support for ChatOptions.ResponseFormat in AWSSDK.Extensions.Bedrock.MEAI #3911

@ailur

Description

@ailur

Describe the feature

Support ChatOptions.ResponseFormat in the AWSSDK.Extensions.Bedrock.MEAI implementation of IChatClient.
Currently, the ResponseFormat property is ignored regardless of whether it's set to Text, Json, or a custom ChatResponseFormatJson with a schema. This makes it impossible to request structured responses from models via Bedrock using the standardized interface from Microsoft.Extensions.AI.

Use Case

I'm integrating Bedrock models into a .NET application using the standard Microsoft.Extensions.AI abstractions.
When using other providers, setting the ChatOptions.ResponseFormat to Json or a custom schema ensures the model returns structured data, which is critical for reliably parsing responses in applications. However, when using the AWSSDK.Extensions.Bedrock.MEAI package, this setting is silently ignored, making Bedrock a non-drop-in replacement and limiting its usefulness in structured workflows.

Support for ResponseFormat would allow for consistent behavior across providers and improve the developer experience when using Amazon Bedrock through the standardized IChatClient interface.

Proposed Solution

No response

Other Information

https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.chatoptions.responseformat

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS .NET SDK and/or Package version used

AWSSDK.Extensions.Bedrock.MEAI 4.0.2
AWSSDK.BedrockAgentRuntime 4.0.4.8

Targeted .NET Platform

.NET 8

Operating System and version

Windows 11, AmazonLinux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions