chat with AWS Bedrock()

Prev Next

This function allows you to conduct chat sessions with AWS Bedrock.

Parameters

Parameter

Description

a

The prompt is the input (text) given to a generative AI model.

b

The model ID is a specific, unique identifier used to identify a particular generative AI model. A list of available IDs for the various base models can be found in the official AWS documentation on Amazon Bedrock model IDs. Example: amazon.nova-lite-v1:0

c

(optional) The Max. Tokens parameter specifies the maximum length of the response generated by the generative AI model, measured in tokens (words or parts of words), before generation is truncated. This value can be set between 1 and 4096 tokens to limit the response length and control costs.

d

(optional) The Temperature parameter controls the randomness of a generative AI model's output by “smoothing” or “sharpening” the probability distribution of the next tokens. A value in the range from 0.1 (deterministic) to 1.0 (more creative/random) influences the originality of the generated response.

e

(optional) Top P (also known as “nucleus sampling”) is a parameter that controls the diversity and creativity of text output in generative AI models by limiting the selection of the next words to the statistically most probable candidates. A value in the range of 0.1 (less diversity) to 1.0 (maximum diversity) influences how many of the most probable next tokens are considered for sampling.

f

The AWS Access Key ID is a unique identifier that is used in conjunction with a secret access key to programmatically authenticate a specific IAM user or root user account. You can learn more about creating, managing, and best practices for access keys in the official AWS documentation on IAM access keys. Example: AKIA3TD2XXXXXOYUQ37X

g

The AWS Secret Access Key is a confidential alphanumeric string that is used in conjunction with the Access Key ID to cryptographically sign programmatic AWS requests, thereby verifying the identity of the sender. Because the Secret Access Key is treated like a password and cannot be recovered if lost, you should use secure methods to manage it, as described in the official AWS documentation on access keys. Example: ++a3/n/Zz0ifMU9FLkqq9E4TjJ0xaXXXXXXjABHS

h

An AWS Region is a physical, geographically distinct location in the world where AWS data centers are grouped to ensure data residency, compliance, and low latency for end users. For detailed information on global infrastructure and available regions, see the official AWS documentation on Regions and Availability Zones. Example: eu-central-1

i

The AWS Role ARN (Amazon Resource Name) is a globally unique identifier for a specific IAM role within AWS that defines the exact resource. Example: arn:aws:iam::791233509111:role/bedrock_role_poc

j

The AWS Role Session Name is a unique identifier that you specify when assuming an IAM role to track the actions of the temporary security credentials in AWS CloudTrail. You can learn more about using this parameter in the official AWS documentation on AssumeRole. Example: BedrockSession