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
* Class representing a response from a Bedrock agent function.
5
+
*
6
+
* You can use this class to customize the response sent back to the Bedrock agent with additional fields like:
7
+
* - session attributes
8
+
* - prompt session attributes
9
+
* - response state (`FAILURE` or `REPROMPT`)
10
+
*
11
+
* When working with the {@link BedrockAgentFunctionResolver} class, this is built automatically
12
+
* when you return anything from your function handler other than an instance of this class.
13
+
*/
14
+
classBedrockFunctionResponse{
15
+
/**
16
+
* The name of the action group, this comes from the `event.actionGroup` field
17
+
* in the Bedrock agent function event.
18
+
*/
19
+
readonlyactionGroup: string;
20
+
/**
21
+
* The name of the function returning the response, this comes from the `event.function` field
22
+
* in the Bedrock agent function event.
23
+
*/
24
+
readonlyfunc: string;
25
+
/**
26
+
* The response object that defines the response from execution of the function.
27
+
*/
28
+
readonlybody: string;
29
+
/**
30
+
* Optional field to indicate the whether the response is a failure or a reprompt.
31
+
* If not provided, the default is undefined, which means no specific response state is set.
32
+
*
33
+
* - `FAILURE`: The agent throws a `DependencyFailedException` for the current session.
34
+
* - `REPROMPT`: The agent passes a response string to the model to reprompt it.
35
+
*/
36
+
readonlyresponseState?: 'FAILURE'|'REPROMPT';
37
+
/**
38
+
* Optional field to store session attributes and their values.
39
+
* @see {@link https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html#session-state-attributes | Bedrock Agent Session State Attributes} for more details.
40
+
*/
41
+
readonlysessionAttributes: Record<string,string>;
42
+
/**
43
+
* Optional field to instruct the agent to prompt attributes and their values.
44
+
* @see {@link https://docs.aws.amazon.com/bedrock/latest/userguide/agents-session-state.html#session-state-attributes | Bedrock Agent Session State Attributes} for more details.
* Builds the Bedrock function response object according to the Bedrock agent function {@link https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html#agents-lambda-response | response format}.
0 commit comments