MTeguri commited on
Commit
fdb4212
·
verified ·
1 Parent(s): d33fd7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -1
app.py CHANGED
@@ -1,7 +1,8 @@
1
  """
2
  BMSKステータス表示ミニアプリ
3
  --------------------------------
4
- Gradio の `load` イベントでランダムな警告文を1件表示します。
 
5
  """
6
 
7
  from __future__ import annotations
@@ -16,6 +17,12 @@ def display_message() -> str:
16
  """
17
  ステータス用のメッセージ候補から1件をランダムに選んで返す。
18
 
 
 
 
 
 
 
19
  Returns:
20
  str: ランダムに選ばれた警告メッセージ。
21
  """
@@ -29,6 +36,13 @@ def display_message() -> str:
29
 
30
 
31
  with gr.Blocks() as demo:
 
 
 
 
 
 
 
32
  gr.Markdown("# BMSKステータス")
33
  output_text = gr.Textbox(label="ステータス", interactive=False)
34
 
@@ -37,4 +51,8 @@ with gr.Blocks() as demo:
37
 
38
 
39
  if __name__ == "__main__":
 
 
 
 
40
  demo.launch(mcp_server=True)
 
1
  """
2
  BMSKステータス表示ミニアプリ
3
  --------------------------------
4
+ Gradio の `load` イベントでランダムな警告文を1件表示するミニアプリ
5
+ 主に処理水の水質指標に関する警告メッセージをユーザーに提示する。
6
  """
7
 
8
  from __future__ import annotations
 
17
  """
18
  ステータス用のメッセージ候補から1件をランダムに選んで返す。
19
 
20
+ 警告対象は以下を含む:
21
+ - T-N
22
+ - T-P
23
+ - SS
24
+ - CODMn
25
+
26
  Returns:
27
  str: ランダムに選ばれた警告メッセージ。
28
  """
 
36
 
37
 
38
  with gr.Blocks() as demo:
39
+ """
40
+ Gradio アプリ本体。
41
+ - Markdown タイトルを表示
42
+ - ステータス出力用の Textbox を設置
43
+ - アプリ読み込み時 (`load` イベント) に display_message() を呼び出し、
44
+ 警告メッセージを Textbox に出力する
45
+ """
46
  gr.Markdown("# BMSKステータス")
47
  output_text = gr.Textbox(label="ステータス", interactive=False)
48
 
 
51
 
52
 
53
  if __name__ == "__main__":
54
+ """
55
+ スクリプトを直接実行した場合に Gradio アプリを起動するエントリーポイント。
56
+ mcp_server=True により Model Context Protocol サーバーとしても起動可能。
57
+ """
58
  demo.launch(mcp_server=True)