Googolplexic commited on
Commit
577c06f
·
1 Parent(s): 6decc46

Add README loading functionality and update README section in app.py

Browse files
Files changed (2) hide show
  1. README.md +2 -5
  2. app.py +34 -2
README.md CHANGED
@@ -49,11 +49,8 @@ Hermes requires users to generate an MCP API key, which you can do right [here a
49
 
50
  ### ⚠️ Important! ⚠️
51
 
52
- Our Key Generation and Key Validation server is Deployed on Render and spins down if unused for extended periods of time.
53
- It may take up to 60 seconds for requests to go through if you are the first person on the site in a while. If requests or the website time
54
- out while loading, please try again after a minute or two. We plan on moving off of Render soon!
55
-
56
- Call results and configurations will be deleted 14 days after the last call to the API. This is to ensure that the database does not get too large and to protect user privacy.
57
 
58
  ## Complete Workflow Process
59
 
 
49
 
50
  ### ⚠️ Important! ⚠️
51
 
52
+ - Call results and configurations will be deleted 14 days after the last call to the API. This is to ensure that the database does not get too large and to protect user privacy.
53
+ - Render is used to host the backend, which means that the server will go to sleep after a period of inactivity. This may cause a delay in the first request after a period of inactivity, but subsequent requests should be faster. If it does not work, try refreshing the page/the agent.
 
 
 
54
 
55
  ## Complete Workflow Process
56
 
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from api_monitor import (
3
  validate_api_configuration,
4
  activate_monitoring,
@@ -6,6 +7,27 @@ from api_monitor import (
6
  )
7
 
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  # API Validation Tab
10
  validation_tab = gr.Interface(
11
  fn=validate_api_configuration,
@@ -161,10 +183,20 @@ retrieve_tab = gr.Interface(
161
  ],
162
  )
163
 
 
 
 
 
 
 
 
 
 
 
164
  # Create tabbed interface
165
  demo = gr.TabbedInterface(
166
- [validation_tab, scheduler_tab, retrieve_tab],
167
- ["Validate & Store", "Activate Scheduler", "Retrieve Data"],
168
  title="Hermes - Automated Asynchronous REST API Monitoring",
169
  )
170
 
 
1
  import gradio as gr
2
+ import os
3
  from api_monitor import (
4
  validate_api_configuration,
5
  activate_monitoring,
 
7
  )
8
 
9
 
10
+ def load_readme():
11
+ """Load and return the README content."""
12
+ try:
13
+ readme_path = os.path.join(os.path.dirname(__file__), "README.md")
14
+ with open(readme_path, "r", encoding="utf-8") as f:
15
+ content = f.read()
16
+ # Remove the YAML front matter for cleaner display
17
+ if content.startswith("---"):
18
+ lines = content.split("\n")
19
+ yaml_end = -1
20
+ for i, line in enumerate(lines[1:], 1):
21
+ if line.strip() == "---":
22
+ yaml_end = i
23
+ break
24
+ if yaml_end > 0:
25
+ content = "\n".join(lines[yaml_end + 1 :])
26
+ return content
27
+ except Exception as e:
28
+ return f"Error loading README: {str(e)}"
29
+
30
+
31
  # API Validation Tab
32
  validation_tab = gr.Interface(
33
  fn=validate_api_configuration,
 
183
  ],
184
  )
185
 
186
+ # README Tab
187
+ readme_tab = gr.Interface(
188
+ fn=load_readme,
189
+ inputs=[],
190
+ outputs=gr.Markdown(label="Documentation/Readme", value=load_readme()),
191
+ title="Documentation & Guide",
192
+ description="Complete documentation and usage guide for Hermes API Monitoring tool. This includes setup instructions, workflow examples, and troubleshooting information.",
193
+ flagging_mode="auto",
194
+ )
195
+
196
  # Create tabbed interface
197
  demo = gr.TabbedInterface(
198
+ [validation_tab, scheduler_tab, retrieve_tab, readme_tab],
199
+ ["Validate & Store", "Activate Scheduler", "Retrieve Data", "Documentation"],
200
  title="Hermes - Automated Asynchronous REST API Monitoring",
201
  )
202