Spaces:
Build error
Build error
kamaleswar Mohanta commited on
Commit ·
7c7b5f1
1
Parent(s): 3b1d5fe
ui tested
Browse files- src/langgraphagenticai/LLMS/__pycache__/groqllm.cpython-312.pyc +0 -0
- src/langgraphagenticai/LLMS/groqllm.py +3 -3
- src/langgraphagenticai/__pycache__/main.cpython-312.pyc +0 -0
- src/langgraphagenticai/{graphs → graph}/__init__.py +0 -0
- src/langgraphagenticai/graph/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/graph/__pycache__/graph_builder.cpython-312.pyc +0 -0
- src/langgraphagenticai/{graphs → graph}/graph_builder.py +0 -0
- src/langgraphagenticai/nodes/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/nodes/__pycache__/basic_chatbot_node.cpython-312.pyc +0 -0
- src/langgraphagenticai/state/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/state/__pycache__/state.cpython-312.pyc +0 -0
- src/langgraphagenticai/ui/streamlitui/__pycache__/display_result.cpython-312.pyc +0 -0
- src/langgraphagenticai/ui/streamlitui/__pycache__/loadui.cpython-312.pyc +0 -0
- src/langgraphagenticai/ui/streamlitui/display_result.py +23 -0
- src/langgraphagenticai/ui/streamlitui/loadui.py +7 -7
src/langgraphagenticai/LLMS/__pycache__/groqllm.cpython-312.pyc
CHANGED
|
Binary files a/src/langgraphagenticai/LLMS/__pycache__/groqllm.cpython-312.pyc and b/src/langgraphagenticai/LLMS/__pycache__/groqllm.cpython-312.pyc differ
|
|
|
src/langgraphagenticai/LLMS/groqllm.py
CHANGED
|
@@ -5,18 +5,18 @@ from langchain_groq import ChatGroq
|
|
| 5 |
|
| 6 |
class GroqLLM:
|
| 7 |
def __init__(self,user_controls_input):
|
| 8 |
-
self.
|
| 9 |
|
| 10 |
def get_llm_model(self):
|
| 11 |
try:
|
| 12 |
groq_api_key=self.user_controls_input["GROQ_API_KEY"]
|
| 13 |
-
selected_groq_model=self.
|
| 14 |
if groq_api_key=="" and os.environ["GROQ_API_KEY"]=="":
|
| 15 |
st.error("Please Enter the Groq API KEY")
|
| 16 |
|
| 17 |
llm=ChatGroq(api_key=groq_api_key,model=selected_groq_model)
|
| 18 |
|
| 19 |
except Exception as e:
|
| 20 |
-
raise ValueError(f"Error Occurred with
|
| 21 |
return llm
|
| 22 |
|
|
|
|
| 5 |
|
| 6 |
class GroqLLM:
|
| 7 |
def __init__(self,user_controls_input):
|
| 8 |
+
self.user_controls_input=user_controls_input
|
| 9 |
|
| 10 |
def get_llm_model(self):
|
| 11 |
try:
|
| 12 |
groq_api_key=self.user_controls_input["GROQ_API_KEY"]
|
| 13 |
+
selected_groq_model=self.user_controls_input['selected_groq_model']
|
| 14 |
if groq_api_key=="" and os.environ["GROQ_API_KEY"]=="":
|
| 15 |
st.error("Please Enter the Groq API KEY")
|
| 16 |
|
| 17 |
llm=ChatGroq(api_key=groq_api_key,model=selected_groq_model)
|
| 18 |
|
| 19 |
except Exception as e:
|
| 20 |
+
raise ValueError(f"Error Occurred with exception : {e}")
|
| 21 |
return llm
|
| 22 |
|
src/langgraphagenticai/__pycache__/main.cpython-312.pyc
CHANGED
|
Binary files a/src/langgraphagenticai/__pycache__/main.cpython-312.pyc and b/src/langgraphagenticai/__pycache__/main.cpython-312.pyc differ
|
|
|
src/langgraphagenticai/{graphs → graph}/__init__.py
RENAMED
|
File without changes
|
src/langgraphagenticai/graph/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (210 Bytes). View file
|
|
|
src/langgraphagenticai/graph/__pycache__/graph_builder.cpython-312.pyc
ADDED
|
Binary file (2.3 kB). View file
|
|
|
src/langgraphagenticai/{graphs → graph}/graph_builder.py
RENAMED
|
File without changes
|
src/langgraphagenticai/nodes/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (210 Bytes). View file
|
|
|
src/langgraphagenticai/nodes/__pycache__/basic_chatbot_node.cpython-312.pyc
ADDED
|
Binary file (1.06 kB). View file
|
|
|
src/langgraphagenticai/state/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (210 Bytes). View file
|
|
|
src/langgraphagenticai/state/__pycache__/state.cpython-312.pyc
ADDED
|
Binary file (839 Bytes). View file
|
|
|
src/langgraphagenticai/ui/streamlitui/__pycache__/display_result.cpython-312.pyc
ADDED
|
Binary file (1.9 kB). View file
|
|
|
src/langgraphagenticai/ui/streamlitui/__pycache__/loadui.cpython-312.pyc
CHANGED
|
Binary files a/src/langgraphagenticai/ui/streamlitui/__pycache__/loadui.cpython-312.pyc and b/src/langgraphagenticai/ui/streamlitui/__pycache__/loadui.cpython-312.pyc differ
|
|
|
src/langgraphagenticai/ui/streamlitui/display_result.py
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from langchain_core.messages import HumanMessage, AIMessage, ToolMessage
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
class DisplayResultStreamlit:
|
| 6 |
+
def __init__(self,usecase,graph,user_message):
|
| 7 |
+
self.usecase= usecase
|
| 8 |
+
self.graph= graph
|
| 9 |
+
self.user_message=user_message
|
| 10 |
+
|
| 11 |
+
def display_result_on_ui(self):
|
| 12 |
+
usecase= self.usecase
|
| 13 |
+
graph = self.graph
|
| 14 |
+
user_message = self.user_message
|
| 15 |
+
if usecase =="Basic Chatbot":
|
| 16 |
+
for event in graph.stream({'messages':("user",user_message)}):
|
| 17 |
+
print(event.values())
|
| 18 |
+
for value in event.values():
|
| 19 |
+
print(value['messages'])
|
| 20 |
+
with st.chat_message("user"):
|
| 21 |
+
st.write(user_message)
|
| 22 |
+
with st.chat_message("assistant"):
|
| 23 |
+
st.write(value["messages"].content)
|
src/langgraphagenticai/ui/streamlitui/loadui.py
CHANGED
|
@@ -56,13 +56,13 @@ class LoadStreamlitUI:
|
|
| 56 |
# Use case selection
|
| 57 |
self.user_controls["selected_usecase"] = st.selectbox("Select Usecases", usecase_options)
|
| 58 |
|
| 59 |
-
if self.user_controls["selected_usecase"] =="Chatbot with Tool":
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
|
| 67 |
if "state" not in st.session_state:
|
| 68 |
st.session_state.state = self.initialize_session()
|
|
|
|
| 56 |
# Use case selection
|
| 57 |
self.user_controls["selected_usecase"] = st.selectbox("Select Usecases", usecase_options)
|
| 58 |
|
| 59 |
+
# if self.user_controls["selected_usecase"] =="Chatbot with Tool":
|
| 60 |
+
# # API key input
|
| 61 |
+
# os.environ["TAVILY_API_KEY"] = self.user_controls["TAVILY_API_KEY"] = st.session_state["TAVILY_API_KEY"] = st.text_input("TAVILY API KEY",
|
| 62 |
+
# type="password")
|
| 63 |
+
# # Validate API key
|
| 64 |
+
# if not self.user_controls["TAVILY_API_KEY"]:
|
| 65 |
+
# st.warning("⚠️ Please enter your TAVILY_API_KEY key to proceed. Don't have? refer : https://app.tavily.com/home")
|
| 66 |
|
| 67 |
if "state" not in st.session_state:
|
| 68 |
st.session_state.state = self.initialize_session()
|