Spaces:
Build error
Build error
suryanshp1 commited on
Commit ยท
f818b63
0
Parent(s):
first commit
Browse files- .github/workflows/main.yaml +0 -0
- .gitignore +2 -0
- README.md +0 -0
- app.py +4 -0
- requirements.txt +8 -0
- src/__init__.py +0 -0
- src/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/__init__.py +0 -0
- src/langgraphagenticai/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/__pycache__/main.cpython-312.pyc +0 -0
- src/langgraphagenticai/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/graph/graph_builder.py +22 -0
- src/langgraphagenticai/llms/__init__.py +0 -0
- src/langgraphagenticai/llms/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/llms/__pycache__/groqllm.cpython-312.pyc +0 -0
- src/langgraphagenticai/llms/groqllm.py +26 -0
- src/langgraphagenticai/main.py +53 -0
- src/langgraphagenticai/nodes/__init__.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/nodes/basic_chatbot_node.py +9 -0
- src/langgraphagenticai/state/__init__.py +0 -0
- src/langgraphagenticai/state/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/state/__pycache__/state.cpython-312.pyc +0 -0
- src/langgraphagenticai/state/state.py +8 -0
- src/langgraphagenticai/tools/__init__.py +0 -0
- src/langgraphagenticai/ui/__init__.py +0 -0
- src/langgraphagenticai/ui/__pycache__/__init__.cpython-312.pyc +0 -0
- src/langgraphagenticai/ui/__pycache__/uiconfigfile.cpython-312.pyc +0 -0
- src/langgraphagenticai/ui/streamlitui/__init__.py +0 -0
- src/langgraphagenticai/ui/streamlitui/__pycache__/__init__.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 +96 -0
- src/langgraphagenticai/ui/uiconfigfile.ini +5 -0
- src/langgraphagenticai/ui/uiconfigfile.py +19 -0
- src/langgraphagenticai/vectorstore/__init__.py +0 -0
.github/workflows/main.yaml
ADDED
|
File without changes
|
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.env
|
| 2 |
+
venv
|
README.md
ADDED
|
File without changes
|
app.py
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from src.langgraphagenticai.main import load_langgraph_agenticai_app
|
| 2 |
+
|
| 3 |
+
if __name__ == "__main__":
|
| 4 |
+
load_langgraph_agenticai_app()
|
requirements.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
langchain
|
| 2 |
+
langgraph
|
| 3 |
+
langchain_community
|
| 4 |
+
langchain_core
|
| 5 |
+
langchain_groq
|
| 6 |
+
langchain_openai
|
| 7 |
+
faiss-cpu
|
| 8 |
+
streamlit
|
src/__init__.py
ADDED
|
File without changes
|
src/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (167 Bytes). View file
|
|
|
src/langgraphagenticai/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (186 Bytes). View file
|
|
|
src/langgraphagenticai/__pycache__/main.cpython-312.pyc
ADDED
|
Binary file (2.31 kB). View file
|
|
|
src/langgraphagenticai/graph/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/graph/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (192 Bytes). View file
|
|
|
src/langgraphagenticai/graph/__pycache__/graph_builder.cpython-312.pyc
ADDED
|
Binary file (1.96 kB). View file
|
|
|
src/langgraphagenticai/graph/graph_builder.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from langgraph.graph import StateGraph, END, START, MessagesState
|
| 2 |
+
from langgraph.prebuilt import tools_condition, ToolNode
|
| 3 |
+
from langchain_core.prompts import ChatPromptTemplate
|
| 4 |
+
from src.langgraphagenticai.state.state import State
|
| 5 |
+
from src.langgraphagenticai.nodes.basic_chatbot_node import BasicChatbotNode
|
| 6 |
+
import datetime
|
| 7 |
+
|
| 8 |
+
class GraphBuilder:
|
| 9 |
+
def __init__(self, model):
|
| 10 |
+
self.llm = model
|
| 11 |
+
self.graph_builder = StateGraph(State)
|
| 12 |
+
|
| 13 |
+
def basic_chatbot_build_graph(self):
|
| 14 |
+
self.basic_chatbot_node = BasicChatbotNode(self.llm)
|
| 15 |
+
self.graph_builder.add_node("chatbot", self.basic_chatbot_node.process)
|
| 16 |
+
self.graph_builder.add_edge(START, "chatbot")
|
| 17 |
+
self.graph_builder.add_edge("chatbot", END)
|
| 18 |
+
|
| 19 |
+
def setup_graph(self, usecase: str):
|
| 20 |
+
if usecase == "Basic Chatbot":
|
| 21 |
+
self.basic_chatbot_build_graph()
|
| 22 |
+
return self.graph_builder.compile()
|
src/langgraphagenticai/llms/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/llms/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (191 Bytes). View file
|
|
|
src/langgraphagenticai/llms/__pycache__/groqllm.cpython-312.pyc
ADDED
|
Binary file (1.47 kB). View file
|
|
|
src/langgraphagenticai/llms/groqllm.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from langchain_groq import ChatGroq
|
| 4 |
+
|
| 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.get("GROQ_API_KEY")
|
| 13 |
+
selected_groq_model = self.user_controls_input.get("selected_groq_model")
|
| 14 |
+
|
| 15 |
+
if not groq_api_key or not selected_groq_model:
|
| 16 |
+
st.error("Please enter the GROQ API key and select a model")
|
| 17 |
+
return None
|
| 18 |
+
|
| 19 |
+
llm = ChatGroq(api_key=groq_api_key, model=selected_groq_model)
|
| 20 |
+
return llm
|
| 21 |
+
except Exception as e:
|
| 22 |
+
st.error(f"Error initializing ChatGroq: {str(e)}")
|
| 23 |
+
print(str(e))
|
| 24 |
+
return None
|
| 25 |
+
|
| 26 |
+
|
src/langgraphagenticai/main.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import json
|
| 3 |
+
from src.langgraphagenticai.ui.streamlitui.loadui import LoadStreamlitUI
|
| 4 |
+
from src.langgraphagenticai.llms.groqllm import GroqLLM
|
| 5 |
+
from src.langgraphagenticai.graph.graph_builder import GraphBuilder
|
| 6 |
+
from src.langgraphagenticai.ui.streamlitui.display_result import DisplayResultStremlit
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
# Main function START
|
| 10 |
+
def load_langgraph_agenticai_app():
|
| 11 |
+
# Load UI
|
| 12 |
+
ui = LoadStreamlitUI()
|
| 13 |
+
user_input = ui.load_streamlit_ui()
|
| 14 |
+
|
| 15 |
+
if not user_input:
|
| 16 |
+
st.error("Error: Failed to load user input from the UI")
|
| 17 |
+
|
| 18 |
+
# Text input for user message
|
| 19 |
+
if st.session_state.IsFetchButtonClicked:
|
| 20 |
+
user_message = st.session_state.timeframe
|
| 21 |
+
# elif st.session_state.IsSDLC:
|
| 22 |
+
# user_message = st.session_state.state
|
| 23 |
+
else:
|
| 24 |
+
user_message = st.chat_input("Enter your message :")
|
| 25 |
+
|
| 26 |
+
if user_message:
|
| 27 |
+
try:
|
| 28 |
+
# Configure LLM
|
| 29 |
+
obj_llm_config = GroqLLM(user_controls_input=user_input)
|
| 30 |
+
model = obj_llm_config.get_llm_model()
|
| 31 |
+
|
| 32 |
+
if not model:
|
| 33 |
+
st.error("Error: LLM model could not be initialized")
|
| 34 |
+
return
|
| 35 |
+
|
| 36 |
+
# initialize and setup graph based on usecase
|
| 37 |
+
usecase = user_input.get("selected_usecase")
|
| 38 |
+
if not usecase:
|
| 39 |
+
st.error("Error: no usecase selected")
|
| 40 |
+
return
|
| 41 |
+
|
| 42 |
+
# Graph Builder
|
| 43 |
+
graph_builder = GraphBuilder(model)
|
| 44 |
+
|
| 45 |
+
try:
|
| 46 |
+
graph = graph_builder.setup_graph(usecase=usecase)
|
| 47 |
+
DisplayResultStremlit(
|
| 48 |
+
usecase, graph, user_message
|
| 49 |
+
).display_result_on_ui()
|
| 50 |
+
except Exception as e:
|
| 51 |
+
st.error(f"Error: Graph setup failed - {e}")
|
| 52 |
+
except Exception as e:
|
| 53 |
+
raise ValueError(f"Error occur with exception : {e}")
|
src/langgraphagenticai/nodes/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/nodes/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (192 Bytes). View file
|
|
|
src/langgraphagenticai/nodes/__pycache__/basic_chatbot_node.cpython-312.pyc
ADDED
|
Binary file (873 Bytes). View file
|
|
|
src/langgraphagenticai/nodes/basic_chatbot_node.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from src.langgraphagenticai.state.state import State
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class BasicChatbotNode:
|
| 5 |
+
def __init__(self, model):
|
| 6 |
+
self.llm = model
|
| 7 |
+
|
| 8 |
+
def process(self, state: State):
|
| 9 |
+
return {"messages": self.llm.invoke(state["messages"])}
|
src/langgraphagenticai/state/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/state/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (192 Bytes). View file
|
|
|
src/langgraphagenticai/state/__pycache__/state.cpython-312.pyc
ADDED
|
Binary file (767 Bytes). View file
|
|
|
src/langgraphagenticai/state/state.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Annotated, Literal, Optional
|
| 2 |
+
from typing_extensions import TypedDict
|
| 3 |
+
from langgraph.graph.message import add_messages
|
| 4 |
+
from typing import TypedDict, Annotated, List
|
| 5 |
+
from langchain_core.messages import HumanMessage, AIMessage
|
| 6 |
+
|
| 7 |
+
class State(TypedDict):
|
| 8 |
+
messages: Annotated[list, add_messages]
|
src/langgraphagenticai/tools/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/ui/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/ui/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (189 Bytes). View file
|
|
|
src/langgraphagenticai/ui/__pycache__/uiconfigfile.cpython-312.pyc
ADDED
|
Binary file (1.84 kB). View file
|
|
|
src/langgraphagenticai/ui/streamlitui/__init__.py
ADDED
|
File without changes
|
src/langgraphagenticai/ui/streamlitui/__pycache__/__init__.cpython-312.pyc
ADDED
|
Binary file (201 Bytes). View file
|
|
|
src/langgraphagenticai/ui/streamlitui/__pycache__/display_result.cpython-312.pyc
ADDED
|
Binary file (1.85 kB). View file
|
|
|
src/langgraphagenticai/ui/streamlitui/__pycache__/loadui.cpython-312.pyc
ADDED
|
Binary file (5.56 kB). View file
|
|
|
src/langgraphagenticai/ui/streamlitui/display_result.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from langchain_core.messages import HumanMessage, AIMessage
|
| 3 |
+
import json
|
| 4 |
+
|
| 5 |
+
class DisplayResultStremlit:
|
| 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("assisstant"):
|
| 23 |
+
st.write(value["messages"].content)
|
src/langgraphagenticai/ui/streamlitui/loadui.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import os
|
| 3 |
+
from datetime import date
|
| 4 |
+
|
| 5 |
+
from langchain_core.messages import AIMessage, HumanMessage
|
| 6 |
+
from src.langgraphagenticai.ui.uiconfigfile import Config
|
| 7 |
+
|
| 8 |
+
class LoadStreamlitUI:
|
| 9 |
+
def __init__(self):
|
| 10 |
+
self.config = Config()
|
| 11 |
+
self.user_controls = {}
|
| 12 |
+
|
| 13 |
+
def initialize_session(self):
|
| 14 |
+
return {
|
| 15 |
+
"current_step": "requirements",
|
| 16 |
+
"requirements": "",
|
| 17 |
+
"user_stories": "",
|
| 18 |
+
"po_feedback": "",
|
| 19 |
+
"generated_code": "",
|
| 20 |
+
"review_feedback": "",
|
| 21 |
+
"decision": None
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
def render_requirements(self):
|
| 25 |
+
st.markdown("## Requirements Submission")
|
| 26 |
+
st.session_state.state["requirements"] = st.text_area(
|
| 27 |
+
"Enter your requirements :",
|
| 28 |
+
height=200,
|
| 29 |
+
key="req_input"
|
| 30 |
+
)
|
| 31 |
+
if st.button("Submit Requirements", key="submit_req"):
|
| 32 |
+
st.session_state.state["current_step"] = "generate_user_stories"
|
| 33 |
+
st.session_state.IsSDLC = True
|
| 34 |
+
|
| 35 |
+
def load_streamlit_ui(self):
|
| 36 |
+
st.set_page_config(page_title= "๐ค " + self.config.get_page_title(), layout="wide")
|
| 37 |
+
st.header("๐ค " + self.config.get_page_title())
|
| 38 |
+
st.session_state.timeframe = ''
|
| 39 |
+
st.session_state.IsFetchButtonClicked = False
|
| 40 |
+
st.session_state.IsSDLC = False
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
with st.sidebar:
|
| 45 |
+
# Get options from config
|
| 46 |
+
llm_options = self.config.get_llm_options()
|
| 47 |
+
usecase_options = self.config.get_usecase_options()
|
| 48 |
+
|
| 49 |
+
# LLM selection
|
| 50 |
+
self.user_controls["selected_llm"] = st.selectbox("Select LLM", llm_options)
|
| 51 |
+
|
| 52 |
+
if self.user_controls["selected_llm"] == 'Groq':
|
| 53 |
+
# Model selection
|
| 54 |
+
model_options = self.config.get_groq_model_options()
|
| 55 |
+
self.user_controls["selected_groq_model"] = st.selectbox("Select Model", model_options)
|
| 56 |
+
# API key input
|
| 57 |
+
self.user_controls["GROQ_API_KEY"] = st.session_state["GROQ_API_KEY"] = st.text_input("API Key",
|
| 58 |
+
type="password")
|
| 59 |
+
# Validate API key
|
| 60 |
+
if not self.user_controls["GROQ_API_KEY"]:
|
| 61 |
+
st.warning("โ ๏ธ Please enter your GROQ API key to proceed. Don't have? refer : https://console.groq.com/keys ")
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
# Use case selection
|
| 65 |
+
self.user_controls["selected_usecase"] = st.selectbox("Select Usecases", usecase_options)
|
| 66 |
+
|
| 67 |
+
if self.user_controls["selected_usecase"] =="Chatbot with Tool" or self.user_controls["selected_usecase"] =="AI News" :
|
| 68 |
+
# API key input
|
| 69 |
+
os.environ["TAVILY_API_KEY"] = self.user_controls["TAVILY_API_KEY"] = st.session_state["TAVILY_API_KEY"] = st.text_input("TAVILY API KEY",
|
| 70 |
+
type="password")
|
| 71 |
+
# Validate API key
|
| 72 |
+
if not self.user_controls["TAVILY_API_KEY"]:
|
| 73 |
+
st.warning("โ ๏ธ Please enter your TAVILY_API_KEY key to proceed. Don't have? refer : https://app.tavily.com/home")
|
| 74 |
+
|
| 75 |
+
elif self.user_controls['selected_usecase']=="AI News":
|
| 76 |
+
st.subheader("๐ฐ AI News Explorer ")
|
| 77 |
+
|
| 78 |
+
with st.sidebar:
|
| 79 |
+
time_frame = st.selectbox(
|
| 80 |
+
"๐
Select Time Frame",
|
| 81 |
+
["Daily", "Weekly", "Monthly"],
|
| 82 |
+
index=0
|
| 83 |
+
)
|
| 84 |
+
|
| 85 |
+
if st.button("๐ Fetch Latest AI News", use_container_width=True):
|
| 86 |
+
st.session_state.IsFetchButtonClicked = True
|
| 87 |
+
st.session_state.timeframe = time_frame
|
| 88 |
+
else :
|
| 89 |
+
st.session_state.IsFetchButtonClicked = False
|
| 90 |
+
|
| 91 |
+
if "state" not in st.session_state:
|
| 92 |
+
st.session_state.state = self.initialize_session()
|
| 93 |
+
|
| 94 |
+
# self.render_requirements()
|
| 95 |
+
|
| 96 |
+
return self.user_controls
|
src/langgraphagenticai/ui/uiconfigfile.ini
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[DEFAULT]
|
| 2 |
+
PAGE_TITLE = Langgraph: Build Stateful Agentic AI graph
|
| 3 |
+
LLM_OPTIONS = Groq
|
| 4 |
+
USECASE_OPTIONS = Basic Chatbot, Chatbot with Tool, AI News
|
| 5 |
+
GROQ_MODEL_OPTIONS = openai/gpt-oss-120b, meta-llama/llama-guard-4-12b, llama-3.3-70b-versatile, openai/gpt-oss-20b
|
src/langgraphagenticai/ui/uiconfigfile.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from configparser import ConfigParser
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class Config:
|
| 5 |
+
def __init__(self, config_file="./src/langgraphagenticai/ui/uiconfigfile.ini"):
|
| 6 |
+
self.config=ConfigParser()
|
| 7 |
+
self.config.read(config_file)
|
| 8 |
+
|
| 9 |
+
def get_llm_options(self):
|
| 10 |
+
return self.config["DEFAULT"].get("LLM_OPTIONS").split(", ")
|
| 11 |
+
|
| 12 |
+
def get_usecase_options(self):
|
| 13 |
+
return self.config["DEFAULT"].get("USECASE_OPTIONS").split(", ")
|
| 14 |
+
|
| 15 |
+
def get_groq_model_options(self):
|
| 16 |
+
return self.config["DEFAULT"].get("GROQ_MODEL_OPTIONS").split(", ")
|
| 17 |
+
|
| 18 |
+
def get_page_title(self):
|
| 19 |
+
return self.config["DEFAULT"].get("PAGE_TITLE")
|
src/langgraphagenticai/vectorstore/__init__.py
ADDED
|
File without changes
|