added functionality to read config file and a proper folder structure
Browse files- app.py +0 -0
- src/__init__.py +0 -0
- src/graph/__init__.py +0 -0
- src/llms/__init__.py +0 -0
- src/llms/groq.py +0 -0
- src/main.py +0 -0
- src/nodes/__init__.py +0 -0
- src/tools/__init__.py +0 -0
- src/ui/__init__.py +0 -0
- src/ui/config.ini +8 -0
- src/ui/config.py +43 -0
- src/ui/display_results.py +0 -0
- src/ui/load.py +11 -0
- src/vectorstore/__init__.py +0 -0
app.py
ADDED
|
File without changes
|
src/__init__.py
ADDED
|
File without changes
|
src/graph/__init__.py
ADDED
|
File without changes
|
src/llms/__init__.py
ADDED
|
File without changes
|
src/llms/groq.py
ADDED
|
File without changes
|
src/main.py
ADDED
|
File without changes
|
src/nodes/__init__.py
ADDED
|
File without changes
|
src/tools/__init__.py
ADDED
|
File without changes
|
src/ui/__init__.py
ADDED
|
File without changes
|
src/ui/config.ini
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[DEFAULT]
|
| 2 |
+
Title = Basic Chatbot
|
| 3 |
+
USE_CASE = Basic Chatbot, Chatbot with Web Search
|
| 4 |
+
LLM_options = Groq, OpenAI
|
| 5 |
+
|
| 6 |
+
GROQ_MODEL = meta-llama/llama-4-scout-17b-16e-instruct, gemma2-9b-it, meta-llama/llama-4-maverick-17b-128e-instruct
|
| 7 |
+
|
| 8 |
+
OPENAI_MODEL = gpt-4o, gpt-4o-mini
|
src/ui/config.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from configparser import ConfigParser
|
| 2 |
+
|
| 3 |
+
class LoadConfig:
|
| 4 |
+
def __init__(self, config_file='src/ui/config.ini'):
|
| 5 |
+
self.config = ConfigParser()
|
| 6 |
+
self.config.read(config_file)
|
| 7 |
+
|
| 8 |
+
def get_llm_options(self):
|
| 9 |
+
"""
|
| 10 |
+
Get the list of LLM options from the configuration file.
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
return self.config.get['DEFAULT'].get('LLM_options').split(', ')
|
| 14 |
+
|
| 15 |
+
def get_use_case(self):
|
| 16 |
+
"""
|
| 17 |
+
Get the use case from config file.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
return self.config.get['DEFAULT'].get('USE_CASE').split(', ')
|
| 21 |
+
|
| 22 |
+
def get_title(self):
|
| 23 |
+
"""
|
| 24 |
+
Get the title from config file.
|
| 25 |
+
"""
|
| 26 |
+
|
| 27 |
+
return self.config.get['DEFAULT'].get('Title')
|
| 28 |
+
|
| 29 |
+
def get_groq_models(self):
|
| 30 |
+
"""
|
| 31 |
+
Get groq models from the config file.
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
return self.config.get['DEFAULT'].get('GROQ_MODEL').split(', ')
|
| 35 |
+
|
| 36 |
+
def get_openai_models(self):
|
| 37 |
+
"""
|
| 38 |
+
Get OpenAI models from config file.
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
return self.config.get['DEFAULT'].get('OPENAI_MODEL').split(', ')
|
| 42 |
+
|
| 43 |
+
|
src/ui/display_results.py
ADDED
|
File without changes
|
src/ui/load.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import streamlit as st
|
| 3 |
+
from datetime import datetime
|
| 4 |
+
|
| 5 |
+
from langchain_core.messages import AIMessage, HumanMessage
|
| 6 |
+
from src.ui.config import LoadConfig
|
| 7 |
+
|
| 8 |
+
class LoadStreamlitUI:
|
| 9 |
+
def __init__(self):
|
| 10 |
+
self.config = LoadConfig()
|
| 11 |
+
|
src/vectorstore/__init__.py
ADDED
|
File without changes
|