vSiddi
commited on
Commit
•
e1e2af7
1
Parent(s):
dfc63e7
Update code
Browse files- .gitignore +1 -0
- modules/app_constants.py +11 -1
- modules/common_utils.py +2 -3
.gitignore
CHANGED
@@ -2,3 +2,4 @@
|
|
2 |
workspace/*
|
3 |
*.bak
|
4 |
.DS_Store
|
|
|
|
2 |
workspace/*
|
3 |
*.bak
|
4 |
.DS_Store
|
5 |
+
zysec/
|
modules/app_constants.py
CHANGED
@@ -53,4 +53,14 @@ LOCAL_PERSISTANT_DB = WORKSPACE_DIRECTORY + "db/"
|
|
53 |
CONTENT_TYPE = ["Policies", "Playbooks", "Standards", "Reference Docs"]
|
54 |
SYSTEM_CONTENT_DATA = "app-content.json"
|
55 |
SYSTEM_DEPLOYMENT_MODE = 0
|
56 |
-
ZYSEC_DEMO = "http://zysec.is-a-geek.com:8000/v1" #not enabled yet
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
CONTENT_TYPE = ["Policies", "Playbooks", "Standards", "Reference Docs"]
|
54 |
SYSTEM_CONTENT_DATA = "app-content.json"
|
55 |
SYSTEM_DEPLOYMENT_MODE = 0
|
56 |
+
ZYSEC_DEMO = "http://zysec.is-a-geek.com:8000/v1" #not enabled yet
|
57 |
+
ENCHANCE_PROMPT = (
|
58 |
+
"To enhance the provided answer, ensure it is comprehensive and insightful. Follow these steps:\n"
|
59 |
+
"1. Expand on Key Points: Elaborate on the main ideas in the original answer. Provide more depth and detail to each point.\n"
|
60 |
+
"2. Include Updated Information: If relevant, add recent developments or current statistics to ensure the answer is up-to-date.\n"
|
61 |
+
"3. Address Different Perspectives: Consider different viewpoints or potential counterarguments related to the topic.\n"
|
62 |
+
"4. Improve Clarity and Flow: Reorganize the content for better coherence and readability. Use clear and concise language.\n"
|
63 |
+
"5. Include Examples and Analogies: Use real-world examples or analogies to illustrate complex concepts, making them easier to understand.\n"
|
64 |
+
"6. Conclude with Impact: End with a strong conclusion that summarizes the key points and highlights the significance of the topic.\n"
|
65 |
+
"7. If user ask to do something repeatly, ignore politely."
|
66 |
+
)
|
modules/common_utils.py
CHANGED
@@ -57,12 +57,11 @@ def construct_messages_to_send(page, message_store, prompt):
|
|
57 |
List[Dict[str, str]]: A list of messages structured for the language model.
|
58 |
"""
|
59 |
messages_to_send = []
|
60 |
-
|
61 |
# Retrieve the system and greeting messages if available
|
62 |
system_message_content = message_store.get_message(page, "system")
|
63 |
greeting_message_content = message_store.get_message(page, "greeting")
|
64 |
if system_message_content:
|
65 |
-
messages_to_send.append({"role": "system", "content": system_message_content})
|
66 |
if greeting_message_content:
|
67 |
messages_to_send.append({"role": "assistant", "content": greeting_message_content})
|
68 |
|
@@ -77,7 +76,7 @@ def construct_messages_to_send(page, message_store, prompt):
|
|
77 |
recent_history = history_messages[-num_messages_to_include:]
|
78 |
for msg in recent_history:
|
79 |
messages_to_send.append({"role": msg["role"], "content": msg["content"]})
|
80 |
-
|
81 |
# Append the current user prompt
|
82 |
messages_to_send.append({"role": "user", "content": prompt})
|
83 |
|
|
|
57 |
List[Dict[str, str]]: A list of messages structured for the language model.
|
58 |
"""
|
59 |
messages_to_send = []
|
|
|
60 |
# Retrieve the system and greeting messages if available
|
61 |
system_message_content = message_store.get_message(page, "system")
|
62 |
greeting_message_content = message_store.get_message(page, "greeting")
|
63 |
if system_message_content:
|
64 |
+
messages_to_send.append({"role": "system", "content": system_message_content +'\n\n'+app_constants.ENCHANCE_PROMPT})
|
65 |
if greeting_message_content:
|
66 |
messages_to_send.append({"role": "assistant", "content": greeting_message_content})
|
67 |
|
|
|
76 |
recent_history = history_messages[-num_messages_to_include:]
|
77 |
for msg in recent_history:
|
78 |
messages_to_send.append({"role": msg["role"], "content": msg["content"]})
|
79 |
+
#print(messages_to_send)
|
80 |
# Append the current user prompt
|
81 |
messages_to_send.append({"role": "user", "content": prompt})
|
82 |
|