You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: kotlin/services/bedrock-runtime/README.md
+14-43Lines changed: 14 additions & 43 deletions
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@
2
2
3
3
## Overview
4
4
5
-
Shows how to use the AWS SDK for Kotlin to work with Amazon Bedrock Runtime
5
+
Shows how to use the AWS SDK for Kotlin to work with Amazon Bedrock Runtime.
6
6
7
7
<!--custom.overview.start-->
8
8
This section provides examples that show how to invoke foundation models using the Amazon Bedrock Runtime API with the AWS SDK for Kotlin.
9
9
<!--custom.overview.end-->
10
10
11
-
_Amazon Bedrock enables you to build and scale generative AI applications with foundation models._
11
+
_Amazon Bedrock Runtime is a fully managed service that makes it easy to use foundation models from third-party providers and Amazon._
12
12
13
13
## ⚠ Important
14
14
@@ -26,15 +26,14 @@ _Amazon Bedrock enables you to build and scale generative AI applications with f
26
26
27
27
For prerequisites, see the [README](../../README.md#Prerequisites) in the `kotlin` folder.
28
28
29
+
29
30
<!--custom.prerequisites.start-->
30
31
> ⚠ You must request access to a model before you can use it. If you try to use the model (with the API or console) before you have requested access to it, you will receive an error message. For more information, see [Model access](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html).
31
32
<!--custom.prerequisites.end-->
33
+
### Amazon Titan Text
32
34
33
-
### Single actions
34
-
35
-
Code excerpts that show you how to call individual service functions.
-[InvokeModel](./src/main/kotlin/com/example/bedrockruntime/InvokeModel.kt) (Demonstrates how to invoke a foundation model to generate content)
38
37
39
38
<!--custom.examples.start-->
40
39
<!--custom.examples.end-->
@@ -43,64 +42,36 @@ Code excerpts that show you how to call individual service functions.
43
42
44
43
### Instructions
45
44
45
+
46
46
<!--custom.instructions.start-->
47
47
<!--custom.instructions.end-->
48
48
49
+
50
+
49
51
### Tests
50
52
51
53
⚠ Running tests might result in charges to your AWS account.
52
54
55
+
53
56
To find instructions for running these tests, see the [README](../../README.md#Tests)
54
57
in the `kotlin` folder.
55
58
59
+
60
+
56
61
<!--custom.tests.start-->
57
62
<!--custom.tests.end-->
58
63
59
64
## Additional resources
60
65
61
-
-[Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html)
62
-
-[Amazon Bedrock API Reference](https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html)
63
-
-[SDK for Kotlin Amazon Bedrock reference](https://sdk.amazonaws.com/kotlin/api/latest/bedrock/index.html)
66
+
-[Amazon Bedrock Runtime User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html)
67
+
-[Amazon Bedrock Runtime API Reference](https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html)
64
68
-[SDK for Kotlin Amazon Bedrock Runtime reference](https://sdk.amazonaws.com/kotlin/api/latest/bedrock-runtime/index.html)
65
69
66
70
<!--custom.resources.start-->
67
71
<!--custom.resources.end-->
68
72
69
-
### Input and Output Format
70
-
71
-
**Input:**
72
-
73
-
```json
74
-
{
75
-
"inputText": "Your prompt here.",
76
-
"textGenerationConfig": {
77
-
"maxTokenCount": 2000,
78
-
"stopSequences": [],
79
-
"temperature": 1.0,
80
-
"topP": 0.7
81
-
}
82
-
}
83
-
```
84
-
You may want to check the doc page [Inference Request Parameters](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html) on the AWS Bedrock documentation for more information on the parameters.
85
-
The structure of the input varies depending on the model you are using.
86
-
87
-
**Output:**
88
-
89
-
```json
90
-
/* Body only */
91
-
{
92
-
"inputTextTokenCount":7,
93
-
"results":[
94
-
{"tokenCount":9,
95
-
"outputText":"Generated answer.",
96
-
"completionReason":"FINISH"
97
-
}
98
-
]
99
-
}
100
-
```
101
-
102
73
---
103
74
104
75
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
0 commit comments