Skip to content

Commit 8620d76

Browse files
Chatbot prompt improvement, bug fixes and a new gif (#132)
1 parent 89c8607 commit 8620d76

File tree

5 files changed

+4
-3
lines changed

5 files changed

+4
-3
lines changed
+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
FLASK_APP=api/app.py
22
FLASK_RUN_PORT=3001
3+
FLASK_DEBUG=1

example-apps/chatbot-rag-app/api/llm_integrations.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def init_bedrock(temperature):
4444
"vertex": init_vertex_chat,
4545
}
4646

47-
def get_llm(temperature=0.2):
47+
def get_llm(temperature=0):
4848
if not LLM_TYPE in MAP_LLM_TYPE_TO_CHAT_MODEL:
4949
raise Exception("LLM type not found. Please set LLM_TYPE to one of: " + ", ".join(MAP_LLM_TYPE_TO_CHAT_MODEL.keys()) + ".")
5050

example-apps/chatbot-rag-app/api/templates/rag_prompt.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Use the following passages to answer the user's question.
2-
Each passage has a NAME which is the title of the document. When answering, give the source name of the passages you are answering from at the end. Put them in a comma separated list, prefixed with SOURCES:.
2+
Each passage has a NAME which is the title of the document. After your answer, leave a blank line and then give the source name of the passages you answered from. Put them in a comma separated list, prefixed with SOURCES:.
33

44
Example:
55

108 KB
Loading

example-apps/chatbot-rag-app/frontend/src/store/provider.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export const thunkActions = {
233233

234234
dispatch(actions.setStatus({ status: AppStatus.Done }))
235235
} else {
236-
message += message && event.data.trim() === '' ? '\n' : event.data
236+
message += event.data
237237

238238
dispatch(
239239
actions.updateMessage({

0 commit comments

Comments
 (0)