@@ -38,7 +38,7 @@ def error_function():
38
38
return BedrockFunctionResponse (
39
39
body = "Invalid input" ,
40
40
response_state = "REPROMPT" ,
41
- session_attributes = {"error" : "true" }
41
+ session_attributes = {"error" : "true" },
42
42
)
43
43
44
44
@app .tool (description = "Function that raises error" )
@@ -61,6 +61,7 @@ def test_bedrock_agent_function_registration():
61
61
62
62
# WHEN registering without description or with duplicate name
63
63
with pytest .raises (ValueError , match = "Tool description is required" ):
64
+
64
65
@app .tool ()
65
66
def test_function ():
66
67
return "test"
@@ -70,6 +71,7 @@ def first_function():
70
71
return "test"
71
72
72
73
with pytest .raises (ValueError , match = "Tool 'custom' already registered" ):
74
+
73
75
@app .tool (name = "custom" , description = "Second registration" )
74
76
def second_function ():
75
77
return "test"
@@ -85,12 +87,12 @@ def test_function():
85
87
body = "Hello" ,
86
88
session_attributes = {"userId" : "123" },
87
89
prompt_session_attributes = {"context" : "test" },
88
- knowledge_bases = [{
89
- "knowledgeBaseId" : "kb1" ,
90
- "retrievalConfiguration " : {
91
- "vectorSearchConfiguration" : {"numberOfResults" : 5 }
92
- }
93
- }]
90
+ knowledge_bases = [
91
+ {
92
+ "knowledgeBaseId " : "kb1" ,
93
+ "retrievalConfiguration" : { " vectorSearchConfiguration" : {"numberOfResults" : 5 }},
94
+ },
95
+ ],
94
96
)
95
97
96
98
# WHEN calling the event handler
@@ -111,4 +113,4 @@ def test_bedrock_agent_function_invalid_event():
111
113
112
114
# WHEN calling with invalid event
113
115
with pytest .raises (ValueError , match = "Missing required field" ):
114
- app .resolve ({}, {})
116
+ app .resolve ({}, {})
0 commit comments