Skip to content

Commit 271a054

Browse files
authored
Merge branch 'spring-projects:main' into main
2 parents 4671200 + c24ef4e commit 271a054

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/bedrock-converse.adoc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
= Bedrock Converse API
22

3-
link:https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html[Amazon Bedrock] Converse API provides a unified interface for conversational AI models with enhanced capabilities including function/tool calling, multimodal inputs, and streaming responses.
3+
link:https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html[Amazon Bedrock Converse API] provides a unified interface for conversational AI models with enhanced capabilities including function/tool calling, multimodal inputs, and streaming responses.
44

55
The Bedrock Converse API has the following high-level features:
66

77
* Tool/Function Calling: Support for function definitions and tool use during conversations
88
* Multimodal Input: Ability to process both text and image inputs in conversations
99
* Streaming Support: Real-time streaming of model responses
1010
* System Messages: Support for system-level instructions and context setting
11-
* Metrics Integration: Built-in support for observation and metrics tracking
12-
13-
The https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html[Amazon Bedrock User Guide] contains detailed information on how to use the AWS hosted service.
11+
// * Metrics Integration: Built-in support for observation and metrics tracking
1412
1513
TIP: The Bedrock Converse API provides a unified interface across multiple model providers while handling AWS-specific authentication and infrastructure concerns.
1614

15+
[NOTE]
16+
====
17+
Following the Bedrock recommendations, Spring AI is transitioning to using Amazon Bedrock's Converse API for all chat conversation implementations in Spring AI.
18+
While the existing `InvokeModel API` supports conversation applications, we strongly recommend adopting the Converse API for several key benefits:
19+
20+
- Unified Interface: Write your code once and use it with any supported Amazon Bedrock model
21+
- Model Flexibility: Seamlessly switch between different conversation models without code changes
22+
- Extended Functionality: Support for model-specific parameters through dedicated structures
23+
- Tool Support: Native integration with function calling and tool usage capabilities
24+
- Multimodal Capabilities: Built-in support for vision and other multimodal features
25+
- Future-Proof: Aligned with Amazon Bedrock's recommended best practices
26+
27+
The Converse API does not support embedding operations, so these will remain in the current API and the embedding model functionality in the existing `InvokeModel API` will be maintained
28+
====
29+
1730
== Prerequisites
1831

19-
Refer to the xref:api/bedrock.adoc[Spring AI documentation on Amazon Bedrock] for setting up API access.
32+
Refer to https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.html[Getting started with Amazon Bedrock] for setting up API access
2033

2134
* Obtain AWS credentials: If you don't have an AWS account and AWS CLI configured yet, this video guide can help you configure it: link:https://youtu.be/gswVHTrRX8I?si=buaY7aeI0l3-bBVb[AWS CLI & SDK Setup in Less Than 4 Minutes!]. You should be able to obtain your access and security keys.
2235

@@ -74,7 +87,7 @@ The prefix `spring.ai.bedrock.converse.chat` is the property prefix that configu
7487
| Property | Description | Default
7588

7689
| spring.ai.bedrock.converse.chat.enabled | Enable Bedrock Converse chat model. | true
77-
| spring.ai.bedrock.converse.chat.options.model | The model ID to use. You can use the https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html[Supported models and model features] | anthropic.claude-3-sonnet-20240229-v1:0
90+
| spring.ai.bedrock.converse.chat.options.model | The model ID to use. You can use the https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html[Supported models and model features] | None. Select your https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/models[modelId] from the AWS Bedrock console.
7891
| spring.ai.bedrock.converse.chat.options.temperature | Controls the randomness of the output. Values can range over [0.0,1.0] | 0.8
7992
| spring.ai.bedrock.converse.chat.options.top-p | The maximum cumulative probability of tokens to consider when sampling. | AWS Bedrock default
8093
| spring.ai.bedrock.converse.chat.options.top-k | Number of token choices for generating the next token. | AWS Bedrock default
@@ -135,6 +148,8 @@ spring.ai.bedrock.aws.region=eu-central-1
135148
spring.ai.bedrock.aws.timeout=10m
136149
spring.ai.bedrock.aws.access-key=${AWS_ACCESS_KEY_ID}
137150
spring.ai.bedrock.aws.secret-key=${AWS_SECRET_ACCESS_KEY}
151+
# session token is only required for temporary credentials
152+
spring.ai.bedrock.aws.session-token=${AWS_SESSION_TOKEN}
138153
139154
spring.ai.bedrock.converse.chat.options.temperature=0.8
140155
spring.ai.bedrock.converse.chat.options.top-k=15

0 commit comments

Comments
 (0)