ea4all-gradio-agents-mcp-hackathon-ui-retrofit
Browse files- ea4all/ea4all_mcp.py +0 -5
- ea4all/utils/utils.py +14 -13
ea4all/ea4all_mcp.py
CHANGED
@@ -65,19 +65,14 @@
|
|
65 |
## Gradio Agents MCP Hackathon: retrofit to expose EA4ALL Agentic System Agents only
|
66 |
from langchain.callbacks.tracers import LangChainTracer
|
67 |
from langchain.callbacks.tracers.langchain import wait_for_all_tracers
|
68 |
-
from langchain_community.document_loaders import ConfluenceLoader
|
69 |
from langchain_core.messages import HumanMessage
|
70 |
from langchain_core.runnables import RunnableConfig
|
71 |
|
72 |
from ea4all.src.shared.configuration import BaseConfiguration, APM_MOCK_QNA, PMO_MOCK_QNA
|
73 |
-
from ea4all.src.shared import vectorstore
|
74 |
from ea4all.src.ea4all_gra.configuration import AgentConfiguration as gra
|
75 |
-
from ea4all.src.ea4all_indexer.configuration import IndexConfiguration
|
76 |
-
import ea4all.src.ea4all_apm.graph as e4a
|
77 |
import ea4all.src.ea4all_vqa.graph as e4v
|
78 |
import ea4all.src.ea4all_gra.graph as e4t
|
79 |
import ea4all.src.shared.utils as e4u
|
80 |
-
from ea4all.src.ea4all_indexer.graph import indexer_graph
|
81 |
from ea4all.src.graph import super_graph
|
82 |
#from ea4all.src.pmo_crew.crew_runner import run_pmo_crew
|
83 |
|
|
|
65 |
## Gradio Agents MCP Hackathon: retrofit to expose EA4ALL Agentic System Agents only
|
66 |
from langchain.callbacks.tracers import LangChainTracer
|
67 |
from langchain.callbacks.tracers.langchain import wait_for_all_tracers
|
|
|
68 |
from langchain_core.messages import HumanMessage
|
69 |
from langchain_core.runnables import RunnableConfig
|
70 |
|
71 |
from ea4all.src.shared.configuration import BaseConfiguration, APM_MOCK_QNA, PMO_MOCK_QNA
|
|
|
72 |
from ea4all.src.ea4all_gra.configuration import AgentConfiguration as gra
|
|
|
|
|
73 |
import ea4all.src.ea4all_vqa.graph as e4v
|
74 |
import ea4all.src.ea4all_gra.graph as e4t
|
75 |
import ea4all.src.shared.utils as e4u
|
|
|
76 |
from ea4all.src.graph import super_graph
|
77 |
#from ea4all.src.pmo_crew.crew_runner import run_pmo_crew
|
78 |
|
ea4all/utils/utils.py
CHANGED
@@ -2,7 +2,16 @@ import ea4all.src.ea4all_apm.graph as e4a
|
|
2 |
import ea4all.src.ea4all_vqa.graph as e4v
|
3 |
import ea4all.src.ea4all_gra.graph as e4t
|
4 |
import ea4all.src.shared.utils as e4u
|
|
|
5 |
from ea4all.src.shared import vectorstore
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
import uuid
|
8 |
import os
|
@@ -85,13 +94,17 @@ def get_user_feedback(evt: gr.SelectData, request:gr.Request):
|
|
85 |
#Set initial state of apm, llm and capture user-ip
|
86 |
async def ea4all_agent_init(request:gr.Request):
|
87 |
|
|
|
|
|
|
|
|
|
88 |
#capture user IP address
|
89 |
#ea4all_user = e4u.get_user_identification(request)
|
90 |
gr.Info("Thank you for connecting! I'd love to hear your feedback! Thumbs up or Thumbs down. LinkedIn comment.")
|
91 |
|
92 |
# Set initial landscape vectorstore
|
93 |
|
94 |
-
await indexer_graph.ainvoke(input={"docs":[]}, config=config)
|
95 |
|
96 |
#set chatbot description w/ user apm columns
|
97 |
df = vectorstore.apm_dataframe_loader(e4u._join_paths(BaseConfiguration.ea4all_store, IndexConfiguration.apm_catalogue))
|
@@ -136,18 +149,6 @@ def load_dbr(file):
|
|
136 |
def unload_dbr():
|
137 |
return gr.TextArea(visible=False)
|
138 |
|
139 |
-
def on_dbrtext(file):
|
140 |
-
if file:
|
141 |
-
return gr.TextArea(visible=True)
|
142 |
-
return gr.TextArea(visible=False)
|
143 |
-
|
144 |
-
#Upload & clear business requirement
|
145 |
-
def load_dbr(file):
|
146 |
-
return file.decode()
|
147 |
-
|
148 |
-
def unload_dbr():
|
149 |
-
return gr.TextArea(visible=False)
|
150 |
-
|
151 |
#vqa_chatbot (ChatInterface -> Chatbot)
|
152 |
def add_message(message, history):
|
153 |
if message["text"] is not None:
|
|
|
2 |
import ea4all.src.ea4all_vqa.graph as e4v
|
3 |
import ea4all.src.ea4all_gra.graph as e4t
|
4 |
import ea4all.src.shared.utils as e4u
|
5 |
+
from ea4all.src.ea4all_gra.configuration import AgentConfiguration as gra
|
6 |
from ea4all.src.shared import vectorstore
|
7 |
+
from ea4all.src.shared.configuration import BaseConfiguration
|
8 |
+
from ea4all.src.ea4all_indexer.configuration import IndexConfiguration
|
9 |
+
from ea4all.src.ea4all_indexer.graph import indexer_graph
|
10 |
+
|
11 |
+
|
12 |
+
from langchain_community.document_loaders import ConfluenceLoader
|
13 |
+
from langchain_core.messages import ChatMessage
|
14 |
+
from langsmith import Client
|
15 |
|
16 |
import uuid
|
17 |
import os
|
|
|
94 |
#Set initial state of apm, llm and capture user-ip
|
95 |
async def ea4all_agent_init(request:gr.Request):
|
96 |
|
97 |
+
agentic_qna_desc="""Hi,
|
98 |
+
improve effieciency, knowledge sharing, and get valuable insights from your IT landscape using natural language.
|
99 |
+
As an Enterprise Architect Agentic System I can answer questions related to Enterprise Architecture, Technology, plus the following IT Landscape sample dataset: """
|
100 |
+
|
101 |
#capture user IP address
|
102 |
#ea4all_user = e4u.get_user_identification(request)
|
103 |
gr.Info("Thank you for connecting! I'd love to hear your feedback! Thumbs up or Thumbs down. LinkedIn comment.")
|
104 |
|
105 |
# Set initial landscape vectorstore
|
106 |
|
107 |
+
#await indexer_graph.ainvoke(input={"docs":[]}, config=config)
|
108 |
|
109 |
#set chatbot description w/ user apm columns
|
110 |
df = vectorstore.apm_dataframe_loader(e4u._join_paths(BaseConfiguration.ea4all_store, IndexConfiguration.apm_catalogue))
|
|
|
149 |
def unload_dbr():
|
150 |
return gr.TextArea(visible=False)
|
151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
#vqa_chatbot (ChatInterface -> Chatbot)
|
153 |
def add_message(message, history):
|
154 |
if message["text"] is not None:
|