Skip to content

Commit 8b217f4

Browse files
committed
try fix summary
1 parent 8523088 commit 8b217f4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

index.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import json
2+
3+
24
try:
35
from .src.module import chat_module
6+
from .src.agents.utils.types import JsonType
47
except ImportError:
58
from src.module import chat_module
9+
from src.agents.utils.types import JsonType
610

7-
def handler(event, context):
11+
def handler(event: JsonType, context):
812
"""
913
Lambda handler function
1014
"""
@@ -45,7 +49,7 @@ def handler(event, context):
4549
# Create a response
4650
response = {
4751
"statusCode": 200,
48-
"body": chatbot_response
52+
"body": json.dumps(chatbot_response)
4953
}
5054

5155
# Log the response for debugging purposes

src/module.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
try:
77
from .agents.utils.parse_json_context_to_prompt import parse_json_to_prompt
88
from .agents.base_agent.base_agent import invoke_base_agent
9+
from .agents.utils.types import JsonType
910
except ImportError:
1011
from src.agents.utils.parse_json_context_to_prompt import parse_json_to_prompt
1112
from src.agents.base_agent.base_agent import invoke_base_agent
13+
from src.agents.utils.types import JsonType
1214

13-
def chat_module(message: Any, params: Params) -> Result:
15+
def chat_module(message: Any, params: Params) -> JsonType:
1416
"""
1517
Function used by student to converse with a chatbot.
1618
---

0 commit comments

Comments
 (0)