Ritvik19 commited on
Commit
00bc7cc
β€’
1 Parent(s): c672aaf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -23
app.py CHANGED
@@ -59,9 +59,7 @@ def download_conversation_wrapper(inputs=None):
59
  else []
60
  ),
61
  "document_snippets": (
62
- st.session_state.index
63
- if "index" in st.session_state
64
- else []
65
  ),
66
  "conversation": [
67
  {"human": message[0], "ai": message[1], "references": message[2]}
@@ -122,7 +120,26 @@ def query_llm_wrapper(inputs):
122
 
123
 
124
  def boot(command_center):
125
- st.title("Agent Xi - An ArXiv Chatbot")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  if "costing" not in st.session_state:
127
  st.session_state.costing = []
128
  if "messages" not in st.session_state:
@@ -144,28 +161,14 @@ def boot(command_center):
144
 
145
  if __name__ == "__main__":
146
  all_commands = [
147
- ("/upload", list, process_documents_wrapper, "Upload and process documents"),
148
- ("/index", None, index_documents_wrapper, "View index of processed documents"),
149
- ("/cost", None, calculate_cost_wrapper, "Calculate cost of conversation"),
150
- (
151
- "/download",
152
- None,
153
- download_conversation_wrapper,
154
- "Download conversation data",
155
- ),
156
  ]
157
- st.sidebar.title("Commands Menu")
158
- st.sidebar.write(
159
- pd.DataFrame(
160
- {
161
- "Command": [command[0] for command in all_commands],
162
- "Description": [command[3] for command in all_commands],
163
- }
164
- )
165
- )
166
  command_center = CommandCenter(
167
  default_input_type=str,
168
  default_function=query_llm_wrapper,
169
- all_commands=[command[:3] for command in all_commands],
170
  )
171
  boot(command_center)
 
59
  else []
60
  ),
61
  "document_snippets": (
62
+ st.session_state.index if "index" in st.session_state else []
 
 
63
  ),
64
  "conversation": [
65
  {"human": message[0], "ai": message[1], "references": message[2]}
 
120
 
121
 
122
  def boot(command_center):
123
+ st.write(
124
+ """
125
+ # Agent Xi
126
+ Hi I'm Agent Xi πŸ“š your AI assistant πŸ€–, dedicated to making your journey through machine learning research papers as insightful and interactive as possible. Whether you're diving into the latest studies or brushing up on foundational papers, I'm here to help navigate, discuss, and analyze content with you.
127
+
128
+ Here's a quick guide to getting started with me:
129
+
130
+ | Command | Description |
131
+ |---------|-------------|
132
+ | `/upload` | Upload and process documents for our conversation. |
133
+ | `/index` | View an index of processed documents to easily navigate your research. |
134
+ | `/cost` | Calculate the cost of our conversation, ensuring transparency in resource usage. |
135
+ | `/download` | Download conversation data for your records or further analysis. |
136
+
137
+ <br>
138
+
139
+ Feel free to use these commands to enhance your research experience. Let's embark on this exciting journey of discovery together!
140
+ """,
141
+ unsafe_allow_html=True,
142
+ )
143
  if "costing" not in st.session_state:
144
  st.session_state.costing = []
145
  if "messages" not in st.session_state:
 
161
 
162
  if __name__ == "__main__":
163
  all_commands = [
164
+ ("/upload", list, process_documents_wrapper),
165
+ ("/index", None, index_documents_wrapper),
166
+ ("/cost", None, calculate_cost_wrapper),
167
+ ("/download", None, download_conversation_wrapper),
 
 
 
 
 
168
  ]
 
 
 
 
 
 
 
 
 
169
  command_center = CommandCenter(
170
  default_input_type=str,
171
  default_function=query_llm_wrapper,
172
+ all_commands=all_commands,
173
  )
174
  boot(command_center)