Spaces:
Runtime error
Runtime error
Commit
·
52cc181
1
Parent(s):
591c00d
update prompt
Browse files
app.py
CHANGED
|
@@ -993,6 +993,36 @@ Example of final answer:\n\
|
|
| 993 |
```\n
|
| 994 |
"""
|
| 995 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 996 |
SUFFIX = """
|
| 997 |
Begin!
|
| 998 |
|
|
@@ -1099,7 +1129,7 @@ agent_STRUCTURED_ZEROSHOT_REACT = initialize_agent(tools_remote, GPTfake,
|
|
| 1099 |
memory = memory3,
|
| 1100 |
agent_kwargs={
|
| 1101 |
'prefix': PREFIX_3,
|
| 1102 |
-
|
| 1103 |
# 'suffix': SUFFIX2,
|
| 1104 |
"memory_prompts": [MessagesPlaceholder(variable_name="chat_history")],
|
| 1105 |
'input_variables': input_variables,
|
|
@@ -1883,7 +1913,7 @@ with gr.Blocks() as demo:
|
|
| 1883 |
# UserRecord.append((None, timestr+'\n'+WelcomeStr))
|
| 1884 |
with gr.Column() as main2:
|
| 1885 |
title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
|
| 1886 |
-
<center> v0.7.
|
| 1887 |
chatbot = gr.Chatbot(
|
| 1888 |
avatar_images=((os.path.join(os.path.dirname(__file__),"User.png")), (os.path.join(os.path.dirname(__file__),"AI.png"))),
|
| 1889 |
)
|
|
|
|
| 993 |
```\n
|
| 994 |
"""
|
| 995 |
|
| 996 |
+
FORMAT_INSTRUCTIONS_STRUC = """
|
| 997 |
+
When it is necessary to use tools and you must use the following format to output "Thought", "Action" (json blob):\n\
|
| 998 |
+
'''
|
| 999 |
+
Thought: you should always think about what to do and consider previous and subsequent steps
|
| 1000 |
+
Action:
|
| 1001 |
+
```
|
| 1002 |
+
{
|
| 1003 |
+
"action": $TOOL_NAME, the action to take, should be one of [{tool_names}].
|
| 1004 |
+
"action_input": $INPUT, the input to the action.
|
| 1005 |
+
}
|
| 1006 |
+
```
|
| 1007 |
+
Observation: the result of the action.
|
| 1008 |
+
'''
|
| 1009 |
+
If **Thought**, **Action** is missing in the response of using tools, you must re-write the response.\n
|
| 1010 |
+
|
| 1011 |
+
---\n When you are able to provide final answer, you must use the following format to output "Thought", "Action" (json blob):\n\
|
| 1012 |
+
Thought: I know what to respond
|
| 1013 |
+
Action:
|
| 1014 |
+
```
|
| 1015 |
+
{
|
| 1016 |
+
"action": "Final Answer",
|
| 1017 |
+
"action_input": $OUTPUT, Final response to human
|
| 1018 |
+
}
|
| 1019 |
+
```
|
| 1020 |
+
If **Thought**, **Action** is missing in the response of using tools, you must re-write the response.\n
|
| 1021 |
+
|
| 1022 |
+
"""
|
| 1023 |
+
|
| 1024 |
+
|
| 1025 |
+
|
| 1026 |
SUFFIX = """
|
| 1027 |
Begin!
|
| 1028 |
|
|
|
|
| 1129 |
memory = memory3,
|
| 1130 |
agent_kwargs={
|
| 1131 |
'prefix': PREFIX_3,
|
| 1132 |
+
'format_instructions': FORMAT_INSTRUCTIONS_STRUC,
|
| 1133 |
# 'suffix': SUFFIX2,
|
| 1134 |
"memory_prompts": [MessagesPlaceholder(variable_name="chat_history")],
|
| 1135 |
'input_variables': input_variables,
|
|
|
|
| 1913 |
# UserRecord.append((None, timestr+'\n'+WelcomeStr))
|
| 1914 |
with gr.Column() as main2:
|
| 1915 |
title = gr.Markdown("""# <center> STLA BABY - YOUR FRIENDLY GUIDE
|
| 1916 |
+
<center> v0.7.8: Powered by MECH Core Team - GPT4 REMOTE MODE"""),
|
| 1917 |
chatbot = gr.Chatbot(
|
| 1918 |
avatar_images=((os.path.join(os.path.dirname(__file__),"User.png")), (os.path.join(os.path.dirname(__file__),"AI.png"))),
|
| 1919 |
)
|