AWS Bedrock - Programmatically fetch model-specific JSON schemas for InvokeModel requests #8888
Closed
1 of 2 tasks
Labels
bedrock
feature-request
A feature should be added or improved.
service-api
This issue is due to a problem in a service API, not the SDK implementation.
Describe the feature
I'd like a way to programmatically retrieve metadata on which inference parameters are available on a model-by-model basis. Bonus points for doing the same for response parameters as well.
Use Case
I have an app through which users can interact with multiple Bedrock foundation models. However, different models accept different inference parameters, and also not every model accepts a
"prompt"
key. This complicates the creation of a standardized interface for my app.Unfortunately, asking model developers to standardized their schemas is a nonstarter. So instead, if the AWS CLI provided a way to fetch this information, that would go a long way towards simplifying things. Without that, I simply have to visit the model documentation page enumerating a request schema (example), then somehow hardcode that into my application, then endlessly maintain it as breaking changes are introduced.
Proposed Solution
aws bedrock list-foundation-models
outputs an array of model summaries such as the following:Perhaps a
requestSchema
field could be added which maps to a JSON schema for the request, e.g.:If an equivalent
responseSchema
field could also be added, that would be equally useful for the same reason.This proposal would satisfied the original need with only minimal perturbations to the current AWS CLI.
Other Information
No response
Acknowledgements
CLI version used
aws-cli/2.17.13 Python/3.11.9 Darwin/23.5.0 exe/x86_64
Environment details (OS name and version, etc.)
MacOS Sonoma 14.5
The text was updated successfully, but these errors were encountered: