Skip to content

Commit d38afc5

Browse files
committed
Document Bedrock Titan Embedding API and clients
- Remove outdated Bedrock README fiels and add references to the main docs.
1 parent ed52a3e commit d38afc5

18 files changed

+211
-178
lines changed

models/spring-ai-bedrock/README.md

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) is a managed service that provides foundation models from various AI providers, available through a unified API.
44

5-
65
Spring AI implements `API` clients for the [Bedrock models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html) along with implementations for the `ChatClient`, `StreamingChatClient` and the `EmbeddingClient`.
76

87
The API clients provide structured, type-safe implementation for the Bedrock models, while the `ChatClient`, `StreamingChatClient` and the `EmbeddingClient` implementations provide Chat and Embedding clients compliant with the Spring-AI API. Later can be used interchangeably with the other (e.g. OpenAI, Azure OpenAI,
@@ -21,64 +20,13 @@ Also Spring-AI provides Spring Auto-Configurations and Boot Starters for all cli
2120

2221
Go to [Amazon Bedrock](https://us-east-1.console.aws.amazon.com/bedrock/home) and from the [Model Access](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess) menu on the left configure the access to the models you are going to use.
2322

24-
## Quick start
25-
26-
Add the `spring-ai-bedrock-ai-spring-boot-starter` dependency to your project POM:
27-
28-
```xml
29-
<dependency>
30-
<artifactId>spring-ai-bedrock-ai-spring-boot-starter</artifactId>
31-
<groupId>org.springframework.ai</groupId>
32-
<version>0.8.0-SNAPSHOT</version>
33-
</dependency>
34-
```
35-
36-
### Connect to AWS Bedrock
37-
38-
Use the `BedrockAwsConnectionProperties` to configure the AWS credentials and region:
39-
40-
```shell
41-
spring.ai.bedrock.aws.region=us-east-1
42-
43-
spring.ai.bedrock.aws.access-key=YOUR_ACCESS_KEY
44-
spring.ai.bedrock.aws.secret-key=YOUR_SECRET_KEY
45-
```
46-
47-
The `region` property is compulsory.
48-
49-
The AWS credentials are resolved in the following this order:
50-
51-
* Spring-AI Bedrock `spring.ai.bedrock.aws.access-key` and `spring.ai.bedrock.aws.secret-key` properties.
52-
* Java System Properties - `aws.accessKeyId` and `aws.secretAccessKey`
53-
* Environment Variables - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
54-
* Web Identity Token credentials from system properties or environment variables
55-
* Credential profiles file at the default location (`~/.aws/credentials`) shared by all AWS SDKs and the AWS CLI
56-
* Credentials delivered through the Amazon EC2 container service if `AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`" environment variable is set and security manager has permission to access the variable,
57-
* Instance profile credentials delivered through the Amazon EC2 metadata service or set the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables.
58-
59-
### Enable selected Bedrock model
60-
61-
> **NOTE**: By default all models are disabled. You have to enable the chosen Bedrock models explicitly, using the `spring.ai.bedrock.<model>.<chat|embedding>.enabled=true` property.
62-
63-
Here are the supported `<model>` and `<chat|embedding>` combinations:
64-
65-
| Model | Chat | Chat Streaming | Embedding |
66-
| ------------- | ------------- | ------------- | ------------- |
67-
| llama2 | Yes | Yes | No |
68-
| cohere | Yes | Yes | Yes |
69-
| anthropic | Yes | Yes | No |
70-
| jurassic2 | Yes | No | No |
71-
| titan | Yes | Yes | Yes (no batch mode!) |
72-
73-
For example to enable the bedrock Llama2 Chat client you need to set the
74-
`spring.ai.bedrock.llama2.chat.enabled=true`.
23+
## User guides
7524

76-
Next you can use the `spring.ai.bedrock.<model>.<chat|embedding>.*` properties to configure each model as provided in its documentation:
25+
[Amazon Bedrock Overview](https://docs.spring.io/spring-ai/reference/api/bedrock.html)
7726

78-
* [Spring AI Bedrock Llama2 Chat](./README_LLAMA2_CHAT.md) - `spring.ai.bedrock.llama2.chat.enabled=true`
79-
* [Spring AI Bedrock Cohere Chat](./README_COHERE_CHAT.md) - `spring.ai.bedrock.cohere.chat.enabled=true`
80-
* [Spring AI Bedrock Cohere Embedding](./README_COHERE_EMBEDDING.md) - `spring.ai.bedrock.cohere.embedding.enabled=true`
81-
* [Spring AI Bedrock Anthropic Chat](./README_ANTHROPIC_CHAT.md) - `spring.ai.bedrock.anthropic.chat.enabled=true`
82-
* [Spring AI Bedrock Titan Chat](./README_TITAN_CHAT.md) - `spring.ai.bedrock.titan.chat.enabled=true`
83-
* [Spring AI Bedrock Titan Embedding](./README_TITAN_EMBEDDING.md) - `spring.ai.bedrock.titan.embedding.enabled=true`
84-
* (WIP) [Spring AI Bedrock Ai21 Jurassic2 Chat](./README_JURASSIC2_CHAT.md) - `spring.ai.bedrock.jurassic2.chat.enabled=true`
27+
- [Anthropic Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-anthropic.html).
28+
- [Cohere Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-cohere.html).
29+
- [Cohere Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/bedrock-cohere-embedding.html).
30+
- [Llama2 Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-llama2.html).
31+
- [Titan Chat Documentation](https://docs.spring.io/spring-ai/reference/api/clients/bedrock/bedrock-titan.html).
32+
- [Titan Embedding Documentation](https://docs.spring.io/spring-ai/reference/api/embeddings/bedrock-titan-embedding.html).

models/spring-ai-bedrock/README_ANTHROPIC_CHAT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

models/spring-ai-bedrock/README_COHERE_CHAT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

models/spring-ai-bedrock/README_COHERE_EMBEDDING.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

models/spring-ai-bedrock/README_LLAMA2_CHAT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

models/spring-ai-bedrock/README_TITAN_CHAT.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/spring-ai-bedrock/README_TITAN_EMBEDDING.md

Lines changed: 0 additions & 95 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)