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: src/lambda/chat_with_document_resolver/index.py
+12-2Lines changed: 12 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,18 @@ def handler(event, context):
47
47
48
48
objectKey=event['arguments']['s3Uri']
49
49
prompt=event['arguments']['prompt']
50
+
history=event['arguments']['history']
51
+
52
+
full_prompt="You are an assistant that's responsible for getting details from document text attached here based on questions from the user.\n\n"
53
+
full_prompt+="If you don't know the answer, just say that you don't know. Don't try to make up an answer.\n\n"
54
+
full_prompt+="Additionally, use the user and assistant responses in the following JSON object to see what's been asked and what the resposes were in the past.\n\n"
55
+
full_prompt+="The JSON object is: "+json.dumps(history) +".\n\n"
56
+
full_prompt+="The user's question is: "+prompt
50
57
51
58
# this feature is not enabled until the model can be selected on the chat screen
0 commit comments