Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,6 +24,7 @@ co = cohere.ClientV2(api_key=os.environ.get("COHERE_API_KEY"))
|
|
| 24 |
|
| 25 |
|
| 26 |
def greeting(profile: gr.OAuthProfile | None) -> str:
|
|
|
|
| 27 |
if profile is None:
|
| 28 |
return "⛔️"
|
| 29 |
return f"ようこそ! {profile.name}さん"
|
|
@@ -42,7 +43,7 @@ def list_private_models(profile: gr.OAuthProfile | None, oauth_token: gr.OAuthTo
|
|
| 42 |
return profile.username, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
| 43 |
|
| 44 |
def user_info(state):
|
| 45 |
-
gr.Info("ユーザー情報:
|
| 46 |
|
| 47 |
def auth(user_name, password):
|
| 48 |
encoded = base64.b64encode(password.encode("utf-8"))
|
|
@@ -215,15 +216,6 @@ with gr.Blocks(css="footer {visibility: hidden;} .custom-btn {width: 150px; heig
|
|
| 215 |
m2 = gr.Markdown()
|
| 216 |
ku.load(greeting, inputs=None, outputs=m1)
|
| 217 |
|
| 218 |
-
with gr.Column():
|
| 219 |
-
gr.HTML('<div id="header"><span>🛡️ Knowledge Utility</span><img id="logo" src="https://www.ryhintl.com/images/ryhlogo/ryhlogo.png" width="64" height="64" alt="Logo"></div>')
|
| 220 |
-
gr.Markdown("# ナレッジ・エージェント")
|
| 221 |
-
gr.Markdown("📧 ベクターDBに保存されている知識ベースのインベントリを使用して知識共有します。")
|
| 222 |
-
user_btn = gr.Button("ユーザー情報", elem_classes=["custom-btn"])
|
| 223 |
-
|
| 224 |
-
user_btn.click(fn=user_info, inputs=[state], outputs=None)
|
| 225 |
-
|
| 226 |
-
|
| 227 |
with gr.Sidebar(open=False):
|
| 228 |
gr.HTML("""
|
| 229 |
<!DOCTYPE html>
|
|
@@ -300,6 +292,14 @@ with gr.Blocks(css="footer {visibility: hidden;} .custom-btn {width: 150px; heig
|
|
| 300 |
</html>
|
| 301 |
""")
|
| 302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 303 |
with gr.Tab("KU 検索") as tab_find:
|
| 304 |
with gr.Row():
|
| 305 |
query_input = gr.Textbox(
|
|
|
|
| 24 |
|
| 25 |
|
| 26 |
def greeting(profile: gr.OAuthProfile | None) -> str:
|
| 27 |
+
state.value["loginuser"] = profile.name
|
| 28 |
if profile is None:
|
| 29 |
return "⛔️"
|
| 30 |
return f"ようこそ! {profile.name}さん"
|
|
|
|
| 43 |
return profile.username, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
| 44 |
|
| 45 |
def user_info(state):
|
| 46 |
+
gr.Info("ユーザー情報: "+state["loginuser"])
|
| 47 |
|
| 48 |
def auth(user_name, password):
|
| 49 |
encoded = base64.b64encode(password.encode("utf-8"))
|
|
|
|
| 216 |
m2 = gr.Markdown()
|
| 217 |
ku.load(greeting, inputs=None, outputs=m1)
|
| 218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
with gr.Sidebar(open=False):
|
| 220 |
gr.HTML("""
|
| 221 |
<!DOCTYPE html>
|
|
|
|
| 292 |
</html>
|
| 293 |
""")
|
| 294 |
|
| 295 |
+
with gr.Column():
|
| 296 |
+
gr.HTML('<div id="header"><span>🛡️ Knowledge Utility</span><img id="logo" src="https://www.ryhintl.com/images/ryhlogo/ryhlogo.png" width="64" height="64" alt="Logo"></div>')
|
| 297 |
+
gr.Markdown("# ナレッジ・エージェント")
|
| 298 |
+
gr.Markdown("📧 ベクターDBに保存されている知識ベースのインベントリを使用して知識共有します。")
|
| 299 |
+
user_btn = gr.Button("ユーザー情報", elem_classes=["custom-btn"])
|
| 300 |
+
|
| 301 |
+
user_btn.click(fn=user_info, inputs=[state], outputs=None)
|
| 302 |
+
|
| 303 |
with gr.Tab("KU 検索") as tab_find:
|
| 304 |
with gr.Row():
|
| 305 |
query_input = gr.Textbox(
|