themissingCRAM
commited on
Commit
·
1cc1c81
1
Parent(s):
ac243ee
gradio
Browse files- .idea/.gitignore +3 -0
- .idea/inspectionProfiles/Project_Default.xml +14 -0
- .idea/inspectionProfiles/profiles_settings.xml +6 -0
- .idea/misc.xml +7 -0
- .idea/modules.xml +8 -0
- .idea/self_correcting_text_to_sql_agent.iml +8 -0
- .idea/vcs.xml +6 -0
- app.py +15 -3
.idea/.gitignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
# Default ignored files
|
2 |
+
/shelf/
|
3 |
+
/workspace.xml
|
.idea/inspectionProfiles/Project_Default.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<profile version="1.0">
|
3 |
+
<option name="myName" value="Project Default" />
|
4 |
+
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
5 |
+
<option name="ignoredPackages">
|
6 |
+
<value>
|
7 |
+
<list size="1">
|
8 |
+
<item index="0" class="java.lang.String" itemvalue="langchain" />
|
9 |
+
</list>
|
10 |
+
</value>
|
11 |
+
</option>
|
12 |
+
</inspection_tool>
|
13 |
+
</profile>
|
14 |
+
</component>
|
.idea/inspectionProfiles/profiles_settings.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<component name="InspectionProjectProfileManager">
|
2 |
+
<settings>
|
3 |
+
<option name="USE_PROJECT_PROFILE" value="false" />
|
4 |
+
<version value="1.0" />
|
5 |
+
</settings>
|
6 |
+
</component>
|
.idea/misc.xml
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="Black">
|
4 |
+
<option name="sdkName" value="agents" />
|
5 |
+
</component>
|
6 |
+
<component name="ProjectRootManager" version="2" project-jdk-name="agents" project-jdk-type="Python SDK" />
|
7 |
+
</project>
|
.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="ProjectModuleManager">
|
4 |
+
<modules>
|
5 |
+
<module fileurl="file://$PROJECT_DIR$/.idea/self_correcting_text_to_sql_agent.iml" filepath="$PROJECT_DIR$/.idea/self_correcting_text_to_sql_agent.iml" />
|
6 |
+
</modules>
|
7 |
+
</component>
|
8 |
+
</project>
|
.idea/self_correcting_text_to_sql_agent.iml
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="PYTHON_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager">
|
4 |
+
<content url="file://$MODULE_DIR$" />
|
5 |
+
<orderEntry type="jdk" jdkName="agents" jdkType="Python SDK" />
|
6 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
7 |
+
</component>
|
8 |
+
</module>
|
.idea/vcs.xml
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project version="4">
|
3 |
+
<component name="VcsDirectoryMappings">
|
4 |
+
<mapping directory="" vcs="Git" />
|
5 |
+
</component>
|
6 |
+
</project>
|
app.py
CHANGED
@@ -140,9 +140,21 @@ if __name__ == "__main__":
|
|
140 |
conversation_history.append(msg)
|
141 |
yield "", conversation_history
|
142 |
|
|
|
|
|
|
|
|
|
|
|
143 |
with gr.Blocks() as b:
|
144 |
chatbot = gr.Chatbot(type="messages", height=1000)
|
145 |
textbox = gr.Textbox(lines=3, label="")
|
146 |
-
|
147 |
-
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
conversation_history.append(msg)
|
141 |
yield "", conversation_history
|
142 |
|
143 |
+
|
144 |
+
def clear_message(chat_history: list):
|
145 |
+
return chat_history.clear(), ""
|
146 |
+
|
147 |
+
|
148 |
with gr.Blocks() as b:
|
149 |
chatbot = gr.Chatbot(type="messages", height=1000)
|
150 |
textbox = gr.Textbox(lines=3, label="")
|
151 |
+
enter_button = gr.Button("enter")
|
152 |
+
stop_generating_button = gr.Button("stop generating")
|
153 |
+
clear_messages_button = gr.Button("clear messages")
|
154 |
+
reply_button_click_event = enter_button.click(enter_message, [textbox, chatbot], [textbox, chatbot])
|
155 |
+
textbox.submit(enter_message, [textbox, chatbot], [textbox, chatbot])
|
156 |
+
clear_messages_button.click(fn=clear_message, inputs=chatbot, outputs=[chatbot, textbox],
|
157 |
+
cancels=[reply_button_click_event])
|
158 |
+
stop_generating_button.click(cancels=[reply_button_click_event])
|
159 |
+
|
160 |
+
b.launch()
|