From cfa2292e0120294a8fa67e4fc61768f7b7363499 Mon Sep 17 00:00:00 2001 From: PrajjwalLyzr Date: Wed, 20 Mar 2024 18:34:23 +0530 Subject: [PATCH 1/5] Modified the application name -> Employee-HR-Bot[OABOt] --- .../.gitignore | 0 .../README.md | 0 .../app.py | 0 .../lyzr-logo-cut.png | Bin .../lyzr-logo.png | Bin .../requirements.txt | Bin .../utils/__init__.py | 0 .../utils/utils.py | 0 examples/Resume_QnA/.gitignore | 160 ------------------ examples/Resume_QnA/README.md | 39 ----- examples/Resume_QnA/app.py | 145 ---------------- examples/Resume_QnA/lyzr-logo-cut.png | Bin 2737 -> 0 bytes examples/Resume_QnA/lyzr-logo.png | Bin 5182 -> 0 bytes examples/Resume_QnA/requirements.txt | Bin 3988 -> 0 bytes 14 files changed, 344 deletions(-) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/.gitignore (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/README.md (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/app.py (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/lyzr-logo-cut.png (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/lyzr-logo.png (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/requirements.txt (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/utils/__init__.py (100%) rename examples/{Employee_HR_QnA => Employee-HR-Bot[QABot]}/utils/utils.py (100%) delete mode 100644 examples/Resume_QnA/.gitignore delete mode 100644 examples/Resume_QnA/README.md delete mode 100644 examples/Resume_QnA/app.py delete mode 100644 examples/Resume_QnA/lyzr-logo-cut.png delete mode 100644 examples/Resume_QnA/lyzr-logo.png delete mode 100644 examples/Resume_QnA/requirements.txt diff --git a/examples/Employee_HR_QnA/.gitignore b/examples/Employee-HR-Bot[QABot]/.gitignore similarity index 100% rename from examples/Employee_HR_QnA/.gitignore rename to examples/Employee-HR-Bot[QABot]/.gitignore diff --git a/examples/Employee_HR_QnA/README.md b/examples/Employee-HR-Bot[QABot]/README.md similarity index 100% rename from examples/Employee_HR_QnA/README.md rename to examples/Employee-HR-Bot[QABot]/README.md diff --git a/examples/Employee_HR_QnA/app.py b/examples/Employee-HR-Bot[QABot]/app.py similarity index 100% rename from examples/Employee_HR_QnA/app.py rename to examples/Employee-HR-Bot[QABot]/app.py diff --git a/examples/Employee_HR_QnA/lyzr-logo-cut.png b/examples/Employee-HR-Bot[QABot]/lyzr-logo-cut.png similarity index 100% rename from examples/Employee_HR_QnA/lyzr-logo-cut.png rename to examples/Employee-HR-Bot[QABot]/lyzr-logo-cut.png diff --git a/examples/Employee_HR_QnA/lyzr-logo.png b/examples/Employee-HR-Bot[QABot]/lyzr-logo.png similarity index 100% rename from examples/Employee_HR_QnA/lyzr-logo.png rename to examples/Employee-HR-Bot[QABot]/lyzr-logo.png diff --git a/examples/Employee_HR_QnA/requirements.txt b/examples/Employee-HR-Bot[QABot]/requirements.txt similarity index 100% rename from examples/Employee_HR_QnA/requirements.txt rename to examples/Employee-HR-Bot[QABot]/requirements.txt diff --git a/examples/Employee_HR_QnA/utils/__init__.py b/examples/Employee-HR-Bot[QABot]/utils/__init__.py similarity index 100% rename from examples/Employee_HR_QnA/utils/__init__.py rename to examples/Employee-HR-Bot[QABot]/utils/__init__.py diff --git a/examples/Employee_HR_QnA/utils/utils.py b/examples/Employee-HR-Bot[QABot]/utils/utils.py similarity index 100% rename from examples/Employee_HR_QnA/utils/utils.py rename to examples/Employee-HR-Bot[QABot]/utils/utils.py diff --git a/examples/Resume_QnA/.gitignore b/examples/Resume_QnA/.gitignore deleted file mode 100644 index 68bc17f..0000000 --- a/examples/Resume_QnA/.gitignore +++ /dev/null @@ -1,160 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -#pdm.lock -# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it -# in version control. -# https://pdm.fming.dev/#use-with-ide -.pdm.toml - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ diff --git a/examples/Resume_QnA/README.md b/examples/Resume_QnA/README.md deleted file mode 100644 index 409197b..0000000 --- a/examples/Resume_QnA/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Resume_QnA - -## Purpose - -This Streamlit app serves as a demonstration of a Question and Answer (QA) bot for resumes, implemented using the [Lyzr SDK](https://www.lyzr.ai/). The app allows users to upload a PDF resume, ask questions related to the resume, and receive automated responses generated by the Lyzr QA bot which uses the RAG functionality. - -## Features - -- **Resume Upload:** Users can upload a PDF file containing a resume. -- **Automated Responses:** The app automatically generates responses for a predefined prompt about the resume, displaying key information like personal details, technical skills, and areas of interest. -- **User Queries:** Users can ask specific questions about the resume, and the Lyzr QA bot provides responses based on the input. - -## Getting Started - -Follow these steps to run the Lyzr CV QA-Bot Streamlit App locally: - -1. **Install Dependencies:** - ```bash - pip install -r requirements.txt - -2. **Run the App:** - ```bash - streamlit run app.py - -3. **Provide API Key:** -Enter your OpenAI API key in the sidebar to enable Lyzr SDK functionality. - -4. **Upload Resume:** -Upload a PDF file containing a resume using the file upload widget. - -5. **Get Responses:** - -- **User Queries:** Enter specific questions about the resume, and click the "Get Answer" button to receive responses. - -## Resume QABot App -[Application](https://lyzr-resume-qna.streamlit.app/) - -## About Lyzr -Lyzr is the simplest agent framework to help customers build and launch Generative AI apps faster. It is a low-code agent framework that follows an **‘agentic’** way to build LLM apps, contrary to Langchain’s ‘functions and chains’ way and DSPy’s ‘programmatic’ way of building LLM apps. For more information, visit [Lyzr website](https://www.lyzr.ai/) . diff --git a/examples/Resume_QnA/app.py b/examples/Resume_QnA/app.py deleted file mode 100644 index 7f70886..0000000 --- a/examples/Resume_QnA/app.py +++ /dev/null @@ -1,145 +0,0 @@ -import os -import streamlit as st -import shutil -from PIL import Image -from lyzr import QABot - -st.set_page_config( - page_title="Lyzr QA Bot", - layout="centered", # or "wide" - initial_sidebar_state="auto", - page_icon="lyzr-logo-cut.png", -) - -# Load and display the logo -image = Image.open("lyzr-logo.png") -st.image(image, width=150) - -# App title and introduction -st.title("Lyzr CV QA-Bot Demo") -st.markdown("### Welcome to the Lyzr QA-Bot!") -st.markdown("Upload your Resume and Ask your queries.") - - -# Input for API key -# api_key = st.sidebar.text_input("API Key", type="password") -# if api_key: -# os.environ["OPENAI_API_KEY"] = api_key -# else: -# # Prompt for API key if not provided -# st.sidebar.warning("Please enter your API key to proceed.") - - -# vector_store_params = { -# "vector_store_type": "WeaviateVectorStore", -# "index_name": "IndexName" # first letter should be capital -# } - - -def remove_existing_files(directory): - for filename in os.listdir(directory): - file_path = os.path.join(directory, filename) - try: - if os.path.isfile(file_path) or os.path.islink(file_path): - os.unlink(file_path) - elif os.path.isdir(file_path): - shutil.rmtree(file_path) - except Exception as e: - st.error(f"Error while removing existing files: {e}") - - -# Set the local directory -data_directory = "data" - -# Create the data directory if it doesn't exist -os.makedirs(data_directory, exist_ok=True) - -# Remove existing files in the data directory -remove_existing_files(data_directory) - - -# File upload widget -uploaded_file = st.file_uploader("Choose PDF file", type=["pdf"]) - -if uploaded_file is not None: - # Save the uploaded PDF file to the data directory - file_path = os.path.join(data_directory, uploaded_file.name) - with open(file_path, "wb") as file: - file.write(uploaded_file.getvalue()) - - # Display the path of the stored file - st.success(f"File successfully saved") - - -def get_files_in_directory(directory="data"): - # This function help us to get the file path along with filename. - files_list = [] - - # Ensure the directory exists - if os.path.exists(directory) and os.path.isdir(directory): - # Iterate through all files in the directory - for filename in os.listdir(directory): - file_path = os.path.join(directory, filename) - - # Check if the path points to a file (not a directory) - if os.path.isfile(file_path): - files_list.append(file_path) - - return files_list - - -def rag_implementation(): - # This function will implement RAG Lyzr QA bot - path = get_files_in_directory() - path = path[0] - - rag = QABot.pdf_qa( - input_files=[str(path)], - llm_params={"model": "gpt-3.5-turbo"}, - # vector_store_params=vector_store_params - ) - - return rag - - - -def resume_response(): - rag = rag_implementation() - prompt = """ Give the descrition of the given resume in 3 bullet points""" - - response = rag.query(prompt) - return response.response - -if uploaded_file is not None: - automatice_response = resume_response() - st.markdown(f"""{automatice_response}""") - - - question = st.text_input("Ask a question about the resume:") - - if st.button("Get Answer"): - rag = rag_implementation() - response = rag.query(question) - st.markdown(f"""{response.response}""") - - -# Footer or any additional information -with st.expander("ℹ️ - About this App"): - st.markdown( - """ - This app uses Lyzr QABot agent to implement the RAG functionality, where users can upload their resumes and ask questions. For any inquiries or issues, please contact Lyzr. - - """ - ) - st.link_button("Lyzr", url="https://www.lyzr.ai/", use_container_width=True) - st.link_button( - "Book a Demo", url="https://www.lyzr.ai/book-demo/", use_container_width=True - ) - st.link_button( - "Discord", url="https://discord.gg/nm7zSyEFA2", use_container_width=True - ) - st.link_button( - "Slack", - url="https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw", - use_container_width=True, - ) diff --git a/examples/Resume_QnA/lyzr-logo-cut.png b/examples/Resume_QnA/lyzr-logo-cut.png deleted file mode 100644 index 5667dd742c95777b99040d6a893e175e9b725d76..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2737 zcmV;i3QqNjP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3PwppK~#8N?VXKz z6FCru;TniLh&zZoz#WhdAQf;O1S;SxrimT#@h?n?VBjYiM& zf~~CO9qqR>BWZX2`p=&~uTm+y-EQ&t__zXIZ#J7X_1o=s`RmuO%fm)iUcGtq<~#o{ z7K`0#wR(i*a=GRI!v+bI*@gA+@NkWQ;OXh<>R4^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D^ZG^^a?IZ0f z{si+`=Yr1SeoYV#L6nAtjZg4w5?=_l~pW}H+(`C^~Fjb z3yFrKEd)BmN{LbyQjKOpuj~*jB~WQeYhT7oVs1DQE9)TN(!5A*)YCMzAR$&ZVd5%} zSW$sk*@lU$9J+`K#L5s%T>9xMDiA9}F>&dokElSbjKM~W`iQwdpboLJ3wGsc{t$hL zLelY#MXc-!_a<6s%oFa=3Yk$4MXc-tJ4bw$cHT%29Kje5LJ=#6fT@3521=VD9vx7J zSUDslf_CXmS`bm{uKXMdv2qM>x8}j-gOJAnYivO|#L6+jFbp&=HVq`@M2)dRUL9iP zR4}w9&f7fLaNwEd5>u7e{F6%AY&L7yZnsN#e0*FzKR;g_|7^u8`xEkMu~_WZ>-A>2 rTy9sZ)gv7LJZnixSXQ)@SFipBmN~Lrt-Kf300000NkvXXu0mjfY%3#( diff --git a/examples/Resume_QnA/lyzr-logo.png b/examples/Resume_QnA/lyzr-logo.png deleted file mode 100644 index 090c292bfcda115dc6f5c02ac1593797a564912b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5182 zcmX|F2T)T@v`(lAT~Gw6p^6j*r1ua)kP@V5C?Zv)i4^HYLRUJ7f>cpJBvPb^l%OII zI?^EmhTeowW2C(Bzc+7Z?mcIBPWkS4ch8yGL{k%eW`-*a004m500A=t0D!&}{RN1Q z^44SbiKhq}Kd6BPh%&-J&Iy#ci3`f$fw3{*8bt>IXn_6#^6aE4KaJ)8v=~x8iZRHzh^QZ*GR!#Ho8}S}iI?}&r zMMJBKeCe4n?Yj(DTB&*^ua5S~udp!W29LkzgJFu^7whi|BA&nDVp2cW5Ddcl{dsS$ zD)LxBjzkrO4T^441_Y_D0owCU!>M+nQ{Kt^4I*z}Xx}i{Tf@er(Jv%700Dz2_6Fci zNkt~{FO#5cLSjCfS+XnOI-t$eQh}QEbSW{84O*K6P?q`*oCg27a0xKk90`GftQ@H3 ziwnEU_2gd-fg$O<)#~FO;xg_U#jjsr`5-a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W}fxEkA_- From ec660fee1771cbfe5328f200cf2edac4cf32a656 Mon Sep 17 00:00:00 2001 From: PrajjwalLyzr Date: Wed, 20 Mar 2024 18:51:00 +0530 Subject: [PATCH 2/5] Modified the application name -> Resume-Bot[OABOt] --- examples/Resume-Bot[QABot]/.gitignore | 160 +++++++++++++++++++ examples/Resume-Bot[QABot]/README.md | 39 +++++ examples/Resume-Bot[QABot]/app.py | 145 +++++++++++++++++ examples/Resume-Bot[QABot]/lyzr-logo-cut.png | Bin 0 -> 2737 bytes examples/Resume-Bot[QABot]/lyzr-logo.png | Bin 0 -> 5182 bytes examples/Resume-Bot[QABot]/requirements.txt | Bin 0 -> 3988 bytes 6 files changed, 344 insertions(+) create mode 100644 examples/Resume-Bot[QABot]/.gitignore create mode 100644 examples/Resume-Bot[QABot]/README.md create mode 100644 examples/Resume-Bot[QABot]/app.py create mode 100644 examples/Resume-Bot[QABot]/lyzr-logo-cut.png create mode 100644 examples/Resume-Bot[QABot]/lyzr-logo.png create mode 100644 examples/Resume-Bot[QABot]/requirements.txt diff --git a/examples/Resume-Bot[QABot]/.gitignore b/examples/Resume-Bot[QABot]/.gitignore new file mode 100644 index 0000000..68bc17f --- /dev/null +++ b/examples/Resume-Bot[QABot]/.gitignore @@ -0,0 +1,160 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/examples/Resume-Bot[QABot]/README.md b/examples/Resume-Bot[QABot]/README.md new file mode 100644 index 0000000..f92b38e --- /dev/null +++ b/examples/Resume-Bot[QABot]/README.md @@ -0,0 +1,39 @@ +# CV-QnA-LyzrBot + +## Purpose + +This Streamlit app serves as a demonstration of a Question and Answer (QA) bot for resumes, implemented using the [Lyzr SDK](https://www.lyzr.ai/). The app allows users to upload a PDF resume, ask questions related to the resume, and receive automated responses generated by the Lyzr QA bot which uses the RAG functionality. + +## Features + +- **Resume Upload:** Users can upload a PDF file containing a resume. +- **Automated Responses:** The app automatically generates responses for a predefined prompt about the resume, displaying key information like personal details, technical skills, and areas of interest. +- **User Queries:** Users can ask specific questions about the resume, and the Lyzr QA bot provides responses based on the input. + +## Getting Started + +Follow these steps to run the Lyzr CV QA-Bot Streamlit App locally: + +1. **Install Dependencies:** + ```bash + pip install -r requirements.txt + +2. **Run the App:** + ```bash + streamlit run QAbotapp.py + +3. **Provide API Key:** +Enter your OpenAI API key in the sidebar to enable Lyzr SDK functionality. + +4. **Upload Resume:** +Upload a PDF file containing a resume using the file upload widget. + +5. **Get Responses:** + +- **User Queries:** Enter specific questions about the resume, and click the "Get Answer" button to receive responses. + +## Resume QABot App +[Application](https://lyzr-resume-qna.streamlit.app/) + +## About Lyzr +Lyzr is the simplest agent framework to help customers build and launch Generative AI apps faster. It is a low-code agent framework that follows an **‘agentic’** way to build LLM apps, contrary to Langchain’s ‘functions and chains’ way and DSPy’s ‘programmatic’ way of building LLM apps. For more information, visit [Lyzr website](https://www.lyzr.ai/) . diff --git a/examples/Resume-Bot[QABot]/app.py b/examples/Resume-Bot[QABot]/app.py new file mode 100644 index 0000000..7f70886 --- /dev/null +++ b/examples/Resume-Bot[QABot]/app.py @@ -0,0 +1,145 @@ +import os +import streamlit as st +import shutil +from PIL import Image +from lyzr import QABot + +st.set_page_config( + page_title="Lyzr QA Bot", + layout="centered", # or "wide" + initial_sidebar_state="auto", + page_icon="lyzr-logo-cut.png", +) + +# Load and display the logo +image = Image.open("lyzr-logo.png") +st.image(image, width=150) + +# App title and introduction +st.title("Lyzr CV QA-Bot Demo") +st.markdown("### Welcome to the Lyzr QA-Bot!") +st.markdown("Upload your Resume and Ask your queries.") + + +# Input for API key +# api_key = st.sidebar.text_input("API Key", type="password") +# if api_key: +# os.environ["OPENAI_API_KEY"] = api_key +# else: +# # Prompt for API key if not provided +# st.sidebar.warning("Please enter your API key to proceed.") + + +# vector_store_params = { +# "vector_store_type": "WeaviateVectorStore", +# "index_name": "IndexName" # first letter should be capital +# } + + +def remove_existing_files(directory): + for filename in os.listdir(directory): + file_path = os.path.join(directory, filename) + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + elif os.path.isdir(file_path): + shutil.rmtree(file_path) + except Exception as e: + st.error(f"Error while removing existing files: {e}") + + +# Set the local directory +data_directory = "data" + +# Create the data directory if it doesn't exist +os.makedirs(data_directory, exist_ok=True) + +# Remove existing files in the data directory +remove_existing_files(data_directory) + + +# File upload widget +uploaded_file = st.file_uploader("Choose PDF file", type=["pdf"]) + +if uploaded_file is not None: + # Save the uploaded PDF file to the data directory + file_path = os.path.join(data_directory, uploaded_file.name) + with open(file_path, "wb") as file: + file.write(uploaded_file.getvalue()) + + # Display the path of the stored file + st.success(f"File successfully saved") + + +def get_files_in_directory(directory="data"): + # This function help us to get the file path along with filename. + files_list = [] + + # Ensure the directory exists + if os.path.exists(directory) and os.path.isdir(directory): + # Iterate through all files in the directory + for filename in os.listdir(directory): + file_path = os.path.join(directory, filename) + + # Check if the path points to a file (not a directory) + if os.path.isfile(file_path): + files_list.append(file_path) + + return files_list + + +def rag_implementation(): + # This function will implement RAG Lyzr QA bot + path = get_files_in_directory() + path = path[0] + + rag = QABot.pdf_qa( + input_files=[str(path)], + llm_params={"model": "gpt-3.5-turbo"}, + # vector_store_params=vector_store_params + ) + + return rag + + + +def resume_response(): + rag = rag_implementation() + prompt = """ Give the descrition of the given resume in 3 bullet points""" + + response = rag.query(prompt) + return response.response + +if uploaded_file is not None: + automatice_response = resume_response() + st.markdown(f"""{automatice_response}""") + + + question = st.text_input("Ask a question about the resume:") + + if st.button("Get Answer"): + rag = rag_implementation() + response = rag.query(question) + st.markdown(f"""{response.response}""") + + +# Footer or any additional information +with st.expander("ℹ️ - About this App"): + st.markdown( + """ + This app uses Lyzr QABot agent to implement the RAG functionality, where users can upload their resumes and ask questions. For any inquiries or issues, please contact Lyzr. + + """ + ) + st.link_button("Lyzr", url="https://www.lyzr.ai/", use_container_width=True) + st.link_button( + "Book a Demo", url="https://www.lyzr.ai/book-demo/", use_container_width=True + ) + st.link_button( + "Discord", url="https://discord.gg/nm7zSyEFA2", use_container_width=True + ) + st.link_button( + "Slack", + url="https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw", + use_container_width=True, + ) diff --git a/examples/Resume-Bot[QABot]/lyzr-logo-cut.png b/examples/Resume-Bot[QABot]/lyzr-logo-cut.png new file mode 100644 index 0000000000000000000000000000000000000000..5667dd742c95777b99040d6a893e175e9b725d76 GIT binary patch literal 2737 zcmV;i3QqNjP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3PwppK~#8N?VXKz z6FCru;TniLh&zZoz#WhdAQf;O1S;SxrimT#@h?n?VBjYiM& zf~~CO9qqR>BWZX2`p=&~uTm+y-EQ&t__zXIZ#J7X_1o=s`RmuO%fm)iUcGtq<~#o{ z7K`0#wR(i*a=GRI!v+bI*@gA+@NkWQ;OXh<>R4^1L%F!PcwVp98^^3dLs(Pu_3PK` zw{PD*@b$)cTwY#oKYaM`&(EJfm(p<<6R~m(Fz)vD_T&Dn+DV;YjLSZJZoYi^@?JVN zV<1)z34(g}?%kbatT8=!u_**5Rt~}M-@g~QVaYgSeh}EVZ{OC^u^R%hvM--MfBxG- zULFu4$H>9N%C4}3?5JdbkuEp^oPl&qyCPP0fsvkhsk~vNP6{I(-&n-TSS**)1G(3a zA3s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w$cHT%29Kje5LJ=#6fT@3521=VD9vx7J zSUDslf_CXmS`bm{uKXMdv2qM>x8}j-gOJAnYivO|#L6+jFbp&=HVq`@M2)dRUL9iP zR4}w9&f7fLaNwEd5>u7e{F6%AY&L7yZnsN#e0*FzKR;g_|7^u8`xEkMu~_WZ>-A>2 rTy9sZ)gv7LJZnixSXQ)@SFipBmN~Lrt-Kf300000NkvXXu0mjfY%3#( literal 0 HcmV?d00001 diff --git a/examples/Resume-Bot[QABot]/lyzr-logo.png b/examples/Resume-Bot[QABot]/lyzr-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..090c292bfcda115dc6f5c02ac1593797a564912b GIT binary patch literal 5182 zcmX|F2T)T@v`(lAT~Gw6p^6j*r1ua)kP@V5C?Zv)i4^HYLRUJ7f>cpJBvPb^l%OII zI?^EmhTeowW2C(Bzc+7Z?mcIBPWkS4ch8yGL{k%eW`-*a004m500A=t0D!&}{RN1Q z^44SbiKhq}Kd6BPh%&-J&Iy#ci3`f$fw3{*8bt>IXn_6#^6aE4KaJ)8v=~x8iZRHzh^QZ*GR!#Ho8}S}iI?}&r zMMJBKeCe4n?Yj(DTB&*^ua5S~udp!W29LkzgJFu^7whi|BA&nDVp2cW5Ddcl{dsS$ zD)LxBjzkrO4T^441_Y_D0owCU!>M+nQ{Kt^4I*z}Xx}i{Tf@er(Jv%700Dz2_6Fci zNkt~{FO#5cLSjCfS+XnOI-t$eQh}QEbSW{84O*K6P?q`*oCg27a0xKk90`GftQ@H3 ziwnEU_2gd-fg$O<)#~FO;xg_U#jjsr`5-a#8p<(p+Oh8Tc-!i!BGC4#?F7)=l zWZRurk8a%=K0v!5lGt{iK9&m8%B}J27K%{^(LcWGlB$Z9v;hT!SWp2h?&5qE1yUeL zbF9I!kFySFiqD9UD$WS)eq_%cX=}v>4FIx!3Gwt%V1)4P(tmZ;0+5=rFUZjV@wB%P zfgJ_U{ z^ktQBZ_ISD4r%OfeE!`ZI2550VwIT8_LGbCBqpuomAv-Nl;5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*QOKse z^avd{GiYM9Q3m+@9I?m%wwge^mroQl3kxa%+gH8CE^>R6)j?HEWR>$qE9eFW*5T_Q zq_(^aF0D&PJS*z9$I6QNwvrY?fo8FpiOZ8LPs;U9fA`9m==R3G%fR@XYz~UM)Gl_T zDZH)zTA4)p95I%9M-|BuUG5@ND<^$bMyMb;Zo{XU zrz(@sgfm@*7qmRojeDk|S_N8ayOTHL&v@9TFPNfpo5;-SV!dKoYj-PV+!d^udwcjj zR==xit!kG{8#8+FM4`IN4htFt2{w4L(r<-m67TKZaj1OGJ2Z!v%mO>tF)e=f`=^6W zyH%I2^=yLsRcK@>W$@lP;c2Sq>2ITKnV*T$ie~y80z(^&&dW{ABUG2_V~2Y@yXd`L zWZ~&?3~jjc=~pnAk3RzMoqSJw9Ch_hI6Prq&nmN>nm=fFs|dH@!Mp9fTI?eZ+V_;A z?q)S@PT^tM_qo-9H!I*hyHT$yrsYN+Kw|wn+us4KivMLrjLu3y=mgdGi=hqSxyv`Kf6|5lGrL!wpv^WIZ#B+H#@O;2Y;I?jA~ z|4C8c67JK+=+W|4ee%*V4Gu?gR?N|(rY-a2S#gNQw9eU?{o<+ft+VC?`l0VDMJ1lO zOs4D;Ond_&zOlobHE-rw=T?D5>O1Y2{Z`h4&@s<_v#1%6+k;lPH_$y)++FTdsN!MX zpOqCH!un3N9_j){Tp@h!WWnSe3EkV%9m{&gG3DCstRgp`SN8EJY{{Y-XP>LK*9s`O z?T|0)?Dr~Fzn`S*(F2hmX)J(Bf(Ry34qM&2sfGt)I= St)A;Iiovhc^y!IYPW}fxEkA_- literal 0 HcmV?d00001 From c41217a45484b4112ea0f363177479871b86e6ee Mon Sep 17 00:00:00 2001 From: PrajjwalLyzr Date: Tue, 26 Mar 2024 19:45:28 +0530 Subject: [PATCH 3/5] added assesment generator --- .../Assessment-Generator[QABot]/.gitignore | 161 ++++++++++++++++++ .../Assessment-Generator[QABot]/README.md | 32 ++++ examples/Assessment-Generator[QABot]/app.py | 98 +++++++++++ .../logo/lyzr-logo-cut.png | Bin 0 -> 2737 bytes .../logo/lyzr-logo.png | Bin 0 -> 5182 bytes .../requirements.txt | Bin 0 -> 3954 bytes .../utils/__init__.py | 0 .../utils/utils.py | 71 ++++++++ 8 files changed, 362 insertions(+) create mode 100644 examples/Assessment-Generator[QABot]/.gitignore create mode 100644 examples/Assessment-Generator[QABot]/README.md create mode 100644 examples/Assessment-Generator[QABot]/app.py create mode 100644 examples/Assessment-Generator[QABot]/logo/lyzr-logo-cut.png create mode 100644 examples/Assessment-Generator[QABot]/logo/lyzr-logo.png create mode 100644 examples/Assessment-Generator[QABot]/requirements.txt create mode 100644 examples/Assessment-Generator[QABot]/utils/__init__.py create mode 100644 examples/Assessment-Generator[QABot]/utils/utils.py diff --git a/examples/Assessment-Generator[QABot]/.gitignore b/examples/Assessment-Generator[QABot]/.gitignore new file mode 100644 index 0000000..4da54a8 --- /dev/null +++ b/examples/Assessment-Generator[QABot]/.gitignore @@ -0,0 +1,161 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +litellm_uuid.txt + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/examples/Assessment-Generator[QABot]/README.md b/examples/Assessment-Generator[QABot]/README.md new file mode 100644 index 0000000..d17cee9 --- /dev/null +++ b/examples/Assessment-Generator[QABot]/README.md @@ -0,0 +1,32 @@ +# Welcome to the Assessment Generator by Lyzr! + +![Lyzr Logo](./logo/lyzr-logo.png) + +In this Assessment Generator you can upload any textbook PDF, specify the subject and major topics, and instantly generate 10 insightful questions per topic using an AI-powered QA bot Agent from Lyzr SDK. + + +*Note: For this application to function properly in your local system, ensure that the required dependencies are installed and configured correctly, and make sure that you have your OpenAI API Key.* + +### Create Virtual Environment +- `python3 -m venv venv` - Ubuntu/MacOs +- `python -m venv venv` - Windows + +### Activate the environment +- `source venv/bin/activate` - Ubuntu/MaOS +- `venv/Script/acitvate` - Windows + +### Installing Dependencies +- `pip3 install -r requirements.txt`- Ubuntu/MacOs +- `pip install -r requirements.txt` - Windows + + +### Run the application on local server +`streamlit run app.py` + +# About Lyzr +Lyzr is a low-code agent framework that follows an **‘agentic’** way to build LLM apps, contrary to Langchain’s ‘functions and chains’ way and DSPy’s ‘programmatic’ way of building LLM apps. + +- [Lyzr](https://www.lyzr.ai/) +- [Book a Demo](https://www.lyzr.ai/book-demo/) +- [Discord](https://discord.gg/nm7zSyEFA2) +- [Slack](https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw) diff --git a/examples/Assessment-Generator[QABot]/app.py b/examples/Assessment-Generator[QABot]/app.py new file mode 100644 index 0000000..53d12e4 --- /dev/null +++ b/examples/Assessment-Generator[QABot]/app.py @@ -0,0 +1,98 @@ +import os +from PIL import Image +from utils import utils +import streamlit as st +from dotenv import load_dotenv; load_dotenv() +from lyzr import QABot + +# Setup your config +st.set_page_config( + page_title="Assesement Generator", + layout="centered", # or "wide" + initial_sidebar_state="auto", + page_icon="./logo/lyzr-logo-cut.png" +) + +# Load and display the logo +image = Image.open("./logo/lyzr-logo.png") +st.image(image, width=150) + +# App title and introduction +st.title("Assesement Generator by Lyzr") +st.markdown("### Welcome to the Assesement Generator!") +st.markdown("Assesement Generator by Lyzr will provide you 10 insightful questions on the textbook pdf you have uploaded") + +# Custom function to style the app +def style_app(): + # You can put your CSS styles here + st.markdown(""" + + """, unsafe_allow_html=True) + +# Assesement Generator Application + +# replace this with your openai api key or create an environment variable for storing the key. +os.environ["OPENAI_API_KEY"] = os.getenv('OPENAI_API_KEY') + + +# create directory if it doesn't exist +data = "data" +os.makedirs(data, exist_ok=True) + + + +def vector_store_configuration(bookname): + vector_store_params = { + "vector_store_type": "WeaviateVectorStore", + "url": os.getenv('VECTOR_STORE_URL'), # replce the url with your weaviate cluster url + "api_key": os.getenv('VECTOR_STORE_API'), # replace the api with your weaviate cluster api + "index_name": f"Book{bookname}IndexName" + } + + return vector_store_params + + +def smartstudy_bot(filepath, vector_params): + "This function will implement the Lyzr's QA agent to summarize the Youtube Video" + smartstudy = QABot.pdf_qa( + input_files=[str(filepath)], + vector_store_params=vector_params + ) + + return smartstudy + +if __name__ == "__main__": + style_app() + uploaded_file = st.file_uploader("Choose PDF file", type=["pdf"]) + if uploaded_file is not None: + filename = utils.save_uploaded_file(uploaded_file) + subject_name = st.text_input("Write the subject of your Book") + topics = st.text_input("Enter topics (by comma seperated)") + topics_list = [topic.strip() for topic in topics.split(",") if topic.strip()] + + if topics_list is not None: + if st.button("Generate"): + path = utils.get_files_in_directory(data) + filepath = path[0] + vector_params = vector_store_configuration(filename) + study_agent = smartstudy_bot(filepath=filepath, vector_params=vector_params) + if study_agent is not None: + topic_response = utils.user_subject_topics(agent=study_agent, subject=subject_name, topics_lst=topics_list) + utils.flashcard_viewer(response=topic_response) + else: + utils.remove_existing_files(data) + st.warning('Please Upload pdf file') + + with st.expander("ℹ️ - About this App"): + st.markdown(""" + This app uses Lyzr QABot agent to 10 qustions from TextBook pdf. The QABot agent is built on the powerful Retrieval-Augmented Generation (RAG) model, enhancing your ability to extract valuable insights. For any inquiries or issues, please contact Lyzr. + + """) + st.link_button("Lyzr", url='https://www.lyzr.ai/', use_container_width = True) + st.link_button("Book a Demo", url='https://www.lyzr.ai/book-demo/', use_container_width = True) + st.link_button("Discord", url='https://discord.gg/nm7zSyEFA2', use_container_width = True) + st.link_button("Slack", url='https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw', use_container_width = True) \ No newline at end of file diff --git a/examples/Assessment-Generator[QABot]/logo/lyzr-logo-cut.png b/examples/Assessment-Generator[QABot]/logo/lyzr-logo-cut.png new file mode 100644 index 0000000000000000000000000000000000000000..5667dd742c95777b99040d6a893e175e9b725d76 GIT binary patch literal 2737 zcmV;i3QqNjP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3PwppK~#8N?VXKz z6FCru;TniLh&zZoz#WhdAQf;O1S;SxrimT#@h?n?VBjYiM& zf~~CO9qqR>BWZX2`p=&~uTm+y-EQ&t__zXIZ#J7X_1o=s`RmuO%fm)iUcGtq<~#o{ z7K`0#wR(i*a=GRI!v+bI*@gA+@NkWQ;OXh<>R4^1L%F!PcwVp98^^3dLs(Pu_3PK` zw{PD*@b$)cTwY#oKYaM`&(EJfm(p<<6R~m(Fz)vD_T&Dn+DV;YjLSZJZoYi^@?JVN zV<1)z34(g}?%kbatT8=!u_**5Rt~}M-@g~QVaYgSeh}EVZ{OC^u^R%hvM--MfBxG- zULFu4$H>9N%C4}3?5JdbkuEp^oPl&qyCPP0fsvkhsk~vNP6{I(-&n-TSS**)1G(3a zA3s*oagIT(3ln^G_sEr!n0iX z&8Qnyxco`dN)@rPise;?L|eWkRyr&M8g;aVM6nVq1R8BLT@fKx0&!Go%rG1{9vqOQ zpBEKi-pUB2E|Gsx0p_iYQ0lza*&8r#WyB(Rt+O{kLMDCKFzUb&`8qm#16)BUeK;2| zlI16N2MY5ooGhu>#jSAFePeMq_dW-Ik@`$j7%Y7#7n&}sCB)A;*^A(t_AU2&FX`K= zO=kw?Zd}`JFwAk;Pm`#s#!DOL zLd;#gQ;I88RF0fa?rJzZ8I=3nRn-lLFon3fT+*BKT~C}8&JGm@L5#<8aM9XW9-@n= zAomfX^Ux=Qa(2N`x3tg(9Wk`+T}6e^rS@{dEljI12yw)QL&uQf>MAPGaP6BL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@-8(K(uq%I%Hz*L&&$8_Xy~$F>{b95`1Tav=4p3hE#LNq=n_kHNj`44m?5X3I32Lz!<_Gn=FOp;3|j|Lk*!-YPSn1 zCgvezEi6beIi@eA_F~|>b6P#{$zE8Fu@n3luhBR zh0SMjPRv6nLRbz2FxPq={R`ScUL8dV%Ym&J?u(-@E?<(qvoub^(ljCo1)Jwg@HIm} z96F=qGfm2ahJdrSq)1Q&`wyK!jv#GN3S%btrFk#60Dmz45EH!(G{XE=)4b7G34YFZ z55Z{9eBd#5D9)MiM+G-WH`Bnw4ny7VX%p&iB9VIyY#sb>e|&r zwV%(7_czo62eoQv6NE>p4F{ghx%*H`85~td)@L1{dGr$FZ9>8p+l1y{rG&xifak0O zG|y+@wL(UEu_HJV{HFY?lzA*ak3H)I(3}fk8;N+`2$8>a8NJai0^-D^ZG^^a?IZ0f z{si+`=Yr1SeoYV#L6nAtjZg4w5?=_l~pW}H+(`C^~Fjb z3yFrKEd)BmN{LbyQjKOpuj~*jB~WQeYhT7oVs1DQE9)TN(!5A*)YCMzAR$&ZVd5%} zSW$sk*@lU$9J+`K#L5s%T>9xMDiA9}F>&dokElSbjKM~W`iQwdpboLJ3wGsc{t$hL zLelY#MXc-!_a<6s%oFa=3Yk$4MXc-tJ4bw$cHT%29Kje5LJ=#6fT@3521=VD9vx7J zSUDslf_CXmS`bm{uKXMdv2qM>x8}j-gOJAnYivO|#L6+jFbp&=HVq`@M2)dRUL9iP zR4}w9&f7fLaNwEd5>u7e{F6%AY&L7yZnsN#e0*FzKR;g_|7^u8`xEkMu~_WZ>-A>2 rTy9sZ)gv7LJZnixSXQ)@SFipBmN~Lrt-Kf300000NkvXXu0mjfY%3#( literal 0 HcmV?d00001 diff --git a/examples/Assessment-Generator[QABot]/logo/lyzr-logo.png b/examples/Assessment-Generator[QABot]/logo/lyzr-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..090c292bfcda115dc6f5c02ac1593797a564912b GIT binary patch literal 5182 zcmX|F2T)T@v`(l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`L)zVROw%3YztzX*9noq}^1bKSK$bhznx4*xbh`QS{*$7>CETZt(Hr?$ z6V*(E!;wA)S|;UD^K_xypB0B_%;TJn*)Q(zZ=E$~%n$v&QdHuZ%Vf$v!Ngx6#5Z)ac#NPVXr)7`px5IQEd?+!Hsa(mDUHv_tdio45w&Qv^1^s};pLs;Lb)_q-o z$Q8opP8Q78fzbVWeq&irF{WJGokry56Ujavg)Lb$=ip=5Z zWqz1rvxj#q&;nWq7};7q*#VqWW8t+o=6|iyD7dIvID>PGvMEov)YcWMF+8&qOVEVWdHH@wU7qxIz6M3FQgFuMNd^59Z!RGUM zC=T|D)pi&_+20G(;CYHT#IWLPoR^LnZe7&D?2*ggx-)(&Ut`@W%~hs9-O6w7t~C?9 zPr{Em!D6lFwO;T;4&!bbV)c(Qbf;7mPJ)&6L>2QKfU$bZW>zi4LY*|ulKOZz9cm14 zFzR(3lae)xG<-OQ!J7>QK zrQL&Yr-$s~T;puBa=a4^Ru0jRip`C}oYjtNRpo_Pz$;q24rK0VzhPNPKBe+j=P68_ zdME8$-zwL)C$aU+POG35=KejW-W84A=K>X&iP5aVI8ctdT0JQS;R< literal 0 HcmV?d00001 diff --git a/examples/Assessment-Generator[QABot]/utils/__init__.py b/examples/Assessment-Generator[QABot]/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/Assessment-Generator[QABot]/utils/utils.py b/examples/Assessment-Generator[QABot]/utils/utils.py new file mode 100644 index 0000000..f63b6d5 --- /dev/null +++ b/examples/Assessment-Generator[QABot]/utils/utils.py @@ -0,0 +1,71 @@ +import os +import shutil +import streamlit as st +from pathlib import Path +import pandas as pd + +def remove_existing_files(directory): + for filename in os.listdir(directory): + file_path = os.path.join(directory, filename) + try: + if os.path.isfile(file_path) or os.path.islink(file_path): + os.unlink(file_path) + elif os.path.isdir(file_path): + shutil.rmtree(file_path) + except Exception as e: + st.error(f"Error while removing existing files: {e}") + + +def get_files_in_directory(directory): + # This function help us to get the file path along with filename. + files_list = [] + + if os.path.exists(directory) and os.path.isdir(directory): + for filename in os.listdir(directory): + file_path = os.path.join(directory, filename) + + if os.path.isfile(file_path): + files_list.append(file_path) + + return files_list + +def save_uploaded_file(uploaded_file): + # Function to save uploaded file + remove_existing_files('data') + + file_path = os.path.join('data', uploaded_file.name) + with open(file_path, "wb") as file: + file.write(uploaded_file.read()) + st.success("File uploaded successfully") + + rev = uploaded_file.name[::-1] + rev = rev[4:] + filename = rev[::-1] + + return filename[:3] + + +def user_subject_topics(agent, subject, topics_lst): + resposne_flash = {} + for topic in topics_lst: + prompt = f"""You are an expert of this {subject}, Can you write down 3-5 important questions on this {subject} and its topics: {topic} """ + response = agent.query(prompt) + if response is not None: + if response.response == 'Empty Response': + st.warning('Please provide valid pdf') + + elif response.response != 'Empty Response': + # st.subheader("These are the Important Questions, you should prepare") + # st.write(response.response) + resposne_flash[topic] = response.response.split('?') + + return resposne_flash + + +def flashcard_viewer(response:dict): + for topic, questions in response.items(): + st.subheader(topic) + for question in questions: + st.write(question) + st.markdown("---") + From 08fb964969fdb3b308989e5f6b39af5035869ae9 Mon Sep 17 00:00:00 2001 From: PrajjwalLyzr Date: Fri, 29 Mar 2024 15:54:00 +0530 Subject: [PATCH 4/5] added Event-Planning-Assistant --- .../.gitignore | 162 ++++++++++++++++++ .../Event-Planning-Assistant[QABot]/README.md | 32 ++++ .../Event-Planning-Assistant[QABot]/app.py | 83 +++++++++ .../data/Event Planner Assistnace.docx | Bin 0 -> 21258 bytes .../data/__init__.py | 0 .../logo/lyzr-logo-cut.png | Bin 0 -> 2737 bytes .../logo/lyzr-logo.png | Bin 0 -> 5182 bytes .../requirements.txt | Bin 0 -> 3984 bytes .../utils/utils.py | 15 ++ 9 files changed, 292 insertions(+) create mode 100644 examples/Event-Planning-Assistant[QABot]/.gitignore create mode 100644 examples/Event-Planning-Assistant[QABot]/README.md create mode 100644 examples/Event-Planning-Assistant[QABot]/app.py create mode 100644 examples/Event-Planning-Assistant[QABot]/data/Event Planner Assistnace.docx create mode 100644 examples/Event-Planning-Assistant[QABot]/data/__init__.py create mode 100644 examples/Event-Planning-Assistant[QABot]/logo/lyzr-logo-cut.png create mode 100644 examples/Event-Planning-Assistant[QABot]/logo/lyzr-logo.png create mode 100644 examples/Event-Planning-Assistant[QABot]/requirements.txt create mode 100644 examples/Event-Planning-Assistant[QABot]/utils/utils.py diff --git a/examples/Event-Planning-Assistant[QABot]/.gitignore b/examples/Event-Planning-Assistant[QABot]/.gitignore new file mode 100644 index 0000000..1e37816 --- /dev/null +++ b/examples/Event-Planning-Assistant[QABot]/.gitignore @@ -0,0 +1,162 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +litellm_uuid.txt \ No newline at end of file diff --git a/examples/Event-Planning-Assistant[QABot]/README.md b/examples/Event-Planning-Assistant[QABot]/README.md new file mode 100644 index 0000000..f5f34cb --- /dev/null +++ b/examples/Event-Planning-Assistant[QABot]/README.md @@ -0,0 +1,32 @@ +# Welcome to the Event Planning QnA by Lyzr! + +![Lyzr Logo](./logo/lyzr-logo.png) + +Event planners is build on a QABot Agent to answer attendee questions. Attendees could ask questions about schedules, locations, speakers, or logistics and the bot would answer using event information or connect them with organizers. + + +*Note: For this application to function properly in your local system, ensure that the required dependencies are installed and configured correctly, and make sure that you have your OpenAI API Key.* + +### Create Virtual Environment +- `python3 -m venv venv` - Ubuntu/MacOs +- `python -m venv venv` - Windows + +### Activate the environment +- `source venv/bin/activate` - Ubuntu/MaOS +- `venv/Script/acitvate` - Windows + +### Installing Dependencies +- `pip3 install -r requirements.txt`- Ubuntu/MacOs +- `pip install -r requirements.txt` - Windows + + +### Run the application on local server +`streamlit run app.py` + +# About Lyzr +Lyzr is a low-code agent framework that follows an **‘agentic’** way to build LLM apps, contrary to Langchain’s ‘functions and chains’ way and DSPy’s ‘programmatic’ way of building LLM apps. + +- [Lyzr](https://www.lyzr.ai/) +- [Book a Demo](https://www.lyzr.ai/book-demo/) +- [Discord](https://discord.gg/nm7zSyEFA2) +- [Slack](https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw) \ No newline at end of file diff --git a/examples/Event-Planning-Assistant[QABot]/app.py b/examples/Event-Planning-Assistant[QABot]/app.py new file mode 100644 index 0000000..bbe8cd9 --- /dev/null +++ b/examples/Event-Planning-Assistant[QABot]/app.py @@ -0,0 +1,83 @@ +import os +from PIL import Image +import streamlit as st +from pathlib import Path +from utils import utils +from dotenv import load_dotenv; load_dotenv() +from lyzr import QABot + +# Setup your config +st.set_page_config( + page_title="Event Planner", + layout="centered", # or "wide" + initial_sidebar_state="auto", + page_icon="./logo/lyzr-logo-cut.png" +) + +# Load and display the logo +image = Image.open("./logo/lyzr-logo.png") +st.image(image, width=150) + +# App title and introduction +st.title("Event Planner QnA by Lyzr") +st.markdown("### Welcome to the Event Planner QnA!") +st.markdown("Event planners is build on a QABot Agent to answer attendee questions. Attendees could ask questions about schedules, locations, speakers, or logistics") + +# Custom function to style the app +def style_app(): + # You can put your CSS styles here + st.markdown(""" + + """, unsafe_allow_html=True) + +# Event Planner QnA Application + +# replace this with your openai api key or create an environment variable for storing the key. +os.environ["OPENAI_API_KEY"] = os.getenv('OPENAI_API_KEY') + + +def event_planner_qa(): + path = utils.get_files_in_directory('data') + planner_qa = QABot.docx_qa( + input_files=[Path(str(path[1]))] + ) + + return planner_qa + +def file_checker(): + file = [] + for filename in os.listdir('data'): + file_path = os.path.join('data', filename) + file.append(file_path) + + return file + +if __name__ == "__main__": + style_app() + file = file_checker() + if file is not None: + st.subheader('Plan your dream event!') + question = st.text_input('Write you query') + if st.button('Submit'): + if question is not None: + event_agent = event_planner_qa() + response = event_agent.query(question) + st.markdown('---') + st.subheader('Response') + st.write(response.response) + else: + st.warning("Ask question, don't keep it blank") + + with st.expander("ℹ️ - About this App"): + st.markdown(""" + This app uses Lyzr QABot agent to give answer attendee questions. The QABot agent is built on the powerful Retrieval-Augmented Generation (RAG) model, enhancing your ability to extract valuable insights. For any inquiries or issues, please contact Lyzr. + + """) + st.link_button("Lyzr", url='https://www.lyzr.ai/', use_container_width = True) + st.link_button("Book a Demo", url='https://www.lyzr.ai/book-demo/', use_container_width = True) + st.link_button("Discord", url='https://discord.gg/nm7zSyEFA2', use_container_width = True) + st.link_button("Slack", url='https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw', use_container_width = True) \ No newline at end of file diff --git a/examples/Event-Planning-Assistant[QABot]/data/Event Planner Assistnace.docx b/examples/Event-Planning-Assistant[QABot]/data/Event Planner Assistnace.docx new file mode 100644 index 0000000000000000000000000000000000000000..dc97491b85306c5df796d8acb3bcfe355eb9d8c3 GIT binary patch literal 21258 zcmeFY1D7sMlP=uu-L`Gp)^6K2cH6dX+qP}nwrzWV{k(JDGc)VV_Y2OcdqvjDiYp_s zvNG$*4ROt z*44@qKOY2$JQo1y2mk+$|BFYUF>%6tfF54>CFna~u6b3WoxEspEI-B=%k&*EoLT1g zlVCyTclQB1LlH3p^Vl%{%%;c8FNT1*^>j-JgeDh~3pAc&zXTmKHmbFiLmD3=4AQ+s z`fY(RR$oiz&MpioRzP~9rh)h=MM&Aqg3JIEwO4>>%A^<-V$NXL8$Zb# z#MZ=;^#B-fI=QeQ@wJO|Z#H5C==#exv&seuQbBr+@ZV0|j_0xx-IC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h zKrt5Sa|IpLs~91Ie8hkbm4|zi%l86WQv^(>sw0Tzb zz?0c^)Gu2`b-3%ll}ez`(w%WupkOxW7!i@#tCxfHSMA;z$E&U^d?Sx zztwja27%f&cJO~N{&H60bbIdB64Lw!?u8PMmZ6zKd_dckq3~ zcut;klCjIL82#_||DS7c!klgXE-Y@n19LR}oE12`!`%w97ai*@2zxzX0R~0*L?@7ogBJ$B)1M1T9(tV*mgE literal 0 HcmV?d00001 diff --git a/examples/Event-Planning-Assistant[QABot]/data/__init__.py b/examples/Event-Planning-Assistant[QABot]/data/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/Event-Planning-Assistant[QABot]/logo/lyzr-logo-cut.png b/examples/Event-Planning-Assistant[QABot]/logo/lyzr-logo-cut.png new file mode 100644 index 0000000000000000000000000000000000000000..5667dd742c95777b99040d6a893e175e9b725d76 GIT binary patch literal 2737 zcmV;i3QqNjP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3PwppK~#8N?VXKz z6FCru;TniLh&zZoz#WhdAQf;O1S;SxrimT#@h?n?VBjYiM& zf~~CO9qqR>BWZX2`p=&~uTm+y-EQ&t__zXIZ#J7X_1o=s`RmuO%fm)iUcGtq<~#o{ z7K`0#wR(i*a=GRI!v+bI*@gA+@NkWQ;OXh<>R4^1L%F!PcwVp98^^3dLs(Pu_3PK` zw{PD*@b$)cTwY#oKYaM`&(EJfm(p<<6R~m(Fz)vD_T&Dn+DV;YjLSZJZoYi^@?JVN zV<1)z34(g}?%kbatT8=!u_**5Rt~}M-@g~QVaYgSeh}EVZ{OC^u^R%hvM--MfBxG- zULFu4$H>9N%C4}3?5JdbkuEp^oPl&qyCPP0fsvkhsk~vNP6{I(-&n-TSS**)1G(3a zA3s*oagIT(3ln^G_sEr!n0iX z&8Qnyxco`dN)@rPise;?L|eWkRyr&M8g;aVM6nVq1R8BLT@fKx0&!Go%rG1{9vqOQ zpBEKi-pUB2E|Gsx0p_iYQ0lza*&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e{F6%AY&L7yZnsN#e0*FzKR;g_|7^u8`xEkMu~_WZ>-A>2 rTy9sZ)gv7LJZnixSXQ)@SFipBmN~Lrt-Kf300000NkvXXu0mjfY%3#( literal 0 HcmV?d00001 diff --git a/examples/Event-Planning-Assistant[QABot]/logo/lyzr-logo.png b/examples/Event-Planning-Assistant[QABot]/logo/lyzr-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..090c292bfcda115dc6f5c02ac1593797a564912b GIT binary patch literal 5182 zcmX|F2T)T@v`(lAT~Gw6p^6j*r1ua)kP@V5C?Zv)i4^HYLRUJ7f>cpJBvPb^l%OII zI?^EmhTeowW2C(Bzc+7Z?mcIBPWkS4ch8yGL{k%eW`-*a004m500A=t0D!&}{RN1Q z^44SbiKhq}Kd6BPh%&-J&Iy#ci3`f$fw3{*8bt>IXn_6#^6aE4KaJ)8v=~x8iZRHzh^QZ*GR!#Ho8}S}iI?}&r zMMJBKeCe4n?Yj(DTB&*^ua5S~udp!W29LkzgJFu^7whi|BA&nDVp2cW5Ddcl{dsS$ zD)LxBjzkrO4T^441_Y_D0owCU!>M+nQ{Kt^4I*z}Xx}i{Tf@er(Jv%700Dz2_6Fci zNkt~{FO#5cLSjCfS+XnOI-t$eQh}QEbSW{84O*K6P?q`*oCg27a0xKk90`GftQ@H3 ziwnEU_2gd-fg$O<)#~FO;xg_U#jjsr`5-a#8p<(p+Oh8Tc-!i!BGC4#?F7)=l zWZRurk8a%=K0v!5lGt{iK9&m8%B}J27K%{^(LcWGlB$Z9v;hT!SWp2h?&5qE1yUeL zbF9I!kFySFiqD9UD$WS)eq_%cX=}v>4FIx!3Gwt%V1)4P(tmZ;0+5=rFUZjV@wB%P zfgJ_U{ z^ktQBZ_ISD4r%OfeE!`ZI2550VwIT8_LGbCBqpuomAv-Nl;5o{JL+3sTol&;uRRss z&(x_1b56nxTBI5i+DS;5qTB$#vb`0(mJ?CasVPn>NLPq@kLCoHCM=v#?;`iI;G*(w zzkk;67Z~gry@p53;_sqDk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yEk@?u%lt~kal;<0xsze^55$5X-KrH2EO-{8_05}TGP`R zkvU+#yuVQtxP<$(F?z>3Yu=h^a5z$;_1Zu?IcN64IO^*Aas8ONM@?pC&q$ZMbVVdPeI z$Vmm?bpEqyhzIwg?+lJ`miJ>=x^~03QNU70;T#1CH=%ylQ{nUhMow>PlSnHM@YA=r zmsOq3Ru$IPfvq`Ve4c^Dj8Byz5x>gcO1#5u+vA42O&@on_9O=v?7K>dJWruPAVf93 zvsr~;^T~ZB4)%)GUNC^NzZa&#^AhN32_Qxyt0H z`}mhzZOsJl^x&KTfe*y|#uDwDv!M9^Sms8M!IerA8YGr3wYn0IHqFJjK8$~@t}l|RMbXY~Wf zIeUC7bT^<0&rILS{5!^T96#<$Y^`}$lI~uuG))NFmPTz@=St!EHg1+6gm?>P0IXzZTzRA4Gbvj(F;IlSD2Uz8aZ_Cv0f zL3fa2on+@*3p}j4oGY4>a8IO~O;~c5^KTW;52B+qdL-+6QZ$rmM&2vgGt)I=t)A(x Oioq|`^hqvRum1prSwCw4 literal 0 HcmV?d00001 diff --git a/examples/Event-Planning-Assistant[QABot]/utils/utils.py b/examples/Event-Planning-Assistant[QABot]/utils/utils.py new file mode 100644 index 0000000..3886a1f --- /dev/null +++ b/examples/Event-Planning-Assistant[QABot]/utils/utils.py @@ -0,0 +1,15 @@ +import os + + +def get_files_in_directory(directory): + # This function help us to get the file path along with filename. + files_list = [] + + if os.path.exists(directory) and os.path.isdir(directory): + for filename in os.listdir(directory): + file_path = os.path.join(directory, filename) + + if os.path.isfile(file_path): + files_list.append(file_path) + + return files_list \ No newline at end of file From 7a05dee69c660cd2f800b7f6fc246ab85e8ae24c Mon Sep 17 00:00:00 2001 From: PrajjwalLyzr Date: Fri, 29 Mar 2024 15:54:37 +0530 Subject: [PATCH 5/5] added Interactive-Audiobook --- .../.gitignore | 160 ++++++++++++++++++ .../Interactive-Audiobook[VoiceBot]/README.md | 32 ++++ .../Interactive-Audiobook[VoiceBot]/app.py | 85 ++++++++++ .../logo/lyzr-logo-cut.png | Bin 0 -> 2737 bytes .../logo/lyzr-logo.png | Bin 0 -> 5182 bytes .../requirements.txt | Bin 0 -> 3910 bytes .../utils/__init__.py | 0 .../utils/utils.py | 42 +++++ 8 files changed, 319 insertions(+) create mode 100644 examples/Interactive-Audiobook[VoiceBot]/.gitignore create mode 100644 examples/Interactive-Audiobook[VoiceBot]/README.md create mode 100644 examples/Interactive-Audiobook[VoiceBot]/app.py create mode 100644 examples/Interactive-Audiobook[VoiceBot]/logo/lyzr-logo-cut.png create mode 100644 examples/Interactive-Audiobook[VoiceBot]/logo/lyzr-logo.png create mode 100644 examples/Interactive-Audiobook[VoiceBot]/requirements.txt create mode 100644 examples/Interactive-Audiobook[VoiceBot]/utils/__init__.py create mode 100644 examples/Interactive-Audiobook[VoiceBot]/utils/utils.py diff --git a/examples/Interactive-Audiobook[VoiceBot]/.gitignore b/examples/Interactive-Audiobook[VoiceBot]/.gitignore new file mode 100644 index 0000000..68bc17f --- /dev/null +++ b/examples/Interactive-Audiobook[VoiceBot]/.gitignore @@ -0,0 +1,160 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/examples/Interactive-Audiobook[VoiceBot]/README.md b/examples/Interactive-Audiobook[VoiceBot]/README.md new file mode 100644 index 0000000..0975e9b --- /dev/null +++ b/examples/Interactive-Audiobook[VoiceBot]/README.md @@ -0,0 +1,32 @@ +# Welcome to the Interactive Audiobook by Lyzr! + +![Lyzr Logo](./logo/lyzr-logo.png) + +This Interactive Audiobook uses Lyzr's Voice bot agent to convert children's stories into interactive audiobooks. VoiceBot's Text-to-Speech function can narrate the text. + + +*Note: For this application to function properly in your local system, ensure that the required dependencies are installed and configured correctly, and make sure that you have your OpenAI API Key.* + +### Create Virtual Environment +- `python3 -m venv venv` - Ubuntu/MacOs +- `python -m venv venv` - Windows + +### Activate the environment +- `source venv/bin/activate` - Ubuntu/MaOS +- `venv/Script/acitvate` - Windows + +### Installing Dependencies +- `pip3 install -r requirements.txt`- Ubuntu/MacOs +- `pip install -r requirements.txt` - Windows + + +### Run the application on local server +`streamlit run app.py` + +# About Lyzr +Lyzr is a low-code agent framework that follows an **‘agentic’** way to build LLM apps, contrary to Langchain’s ‘functions and chains’ way and DSPy’s ‘programmatic’ way of building LLM apps. + +- [Lyzr](https://www.lyzr.ai/) +- [Book a Demo](https://www.lyzr.ai/book-demo/) +- [Discord](https://discord.gg/nm7zSyEFA2) +- [Slack](https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw) diff --git a/examples/Interactive-Audiobook[VoiceBot]/app.py b/examples/Interactive-Audiobook[VoiceBot]/app.py new file mode 100644 index 0000000..9fb14bf --- /dev/null +++ b/examples/Interactive-Audiobook[VoiceBot]/app.py @@ -0,0 +1,85 @@ +import os +from PIL import Image +from utils import utils +from pathlib import Path +import streamlit as st +from dotenv import load_dotenv; load_dotenv() +from lyzr import VoiceBot + +# Setup your config +st.set_page_config( + page_title="Interactive Audiobook", + layout="centered", # or "wide" + initial_sidebar_state="auto", + page_icon="./logo/lyzr-logo-cut.png" +) + +# Load and display the logo +image = Image.open("./logo/lyzr-logo.png") +st.image(image, width=150) + +# App title and introduction +st.title("Interactive Audiobook by Lyzr") +st.markdown("### Welcome to the Interactive Audiobook!") +st.markdown("Interactive Audiobook by Lyzr will convert children's stories into interactive audiobook") + +# Custom function to style the app +def style_app(): + # You can put your CSS styles here + st.markdown(""" + + """, unsafe_allow_html=True) + +# Interactive Audiobook Application + +audio_directory = 'audio' +os.makedirs(audio_directory, exist_ok=True) +original_directory = os.getcwd() + +# replace this with your openai api key or create an environment variable for storing the key. +API_KEY = os.getenv('OPENAI_API_KEY') + + +def audiobook_agent(user_story:str): + vb = VoiceBot(api_key=API_KEY) + try: + os.chdir(audio_directory) + vb.text_to_speech(user_story) + finally: + os.chdir(original_directory) + + + +if __name__ == "__main__": + style_app() + topic = st.text_input('Write breif about the story') + if st.button('Create'): + if topic: + prompt = utils.prompt(user_input=topic) + story = utils.story_generator(prompt=prompt) + st.subheader('Glimpse of Story') + shorten_story = story[:450] + st.write(shorten_story) + st.markdown('---') + st.subheader('Story into audiobook') + audiobook_agent(user_story=story) + files = utils.get_files_in_directory(audio_directory) + audio_file = files[0] + st.audio(audio_file) + else: + st.warning("Provide the content for story, don't keep it blank") + + + with st.expander("ℹ️ - About this App"): + st.markdown(""" + This app uses Lyzr Voice Bot agent to convert books into interactive audiobooks. The QABot agent is built on the powerful Retrieval-Augmented Generation (RAG) model, enhancing your ability to extract valuable insights. For any inquiries or issues, please contact Lyzr. + + """) + st.link_button("Lyzr", url='https://www.lyzr.ai/', use_container_width = True) + st.link_button("Book a Demo", url='https://www.lyzr.ai/book-demo/', use_container_width = True) + st.link_button("Discord", url='https://discord.gg/nm7zSyEFA2', use_container_width = True) + st.link_button("Slack", url='https://join.slack.com/t/genaiforenterprise/shared_invite/zt-2a7fr38f7-_QDOY1W1WSlSiYNAEncLGw', use_container_width = True) \ No newline at end of file diff --git a/examples/Interactive-Audiobook[VoiceBot]/logo/lyzr-logo-cut.png b/examples/Interactive-Audiobook[VoiceBot]/logo/lyzr-logo-cut.png new file mode 100644 index 0000000000000000000000000000000000000000..5667dd742c95777b99040d6a893e175e9b725d76 GIT binary patch literal 2737 zcmV;i3QqNjP)Px#1ZP1_K>z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GN3S%btrFk#60Dmz45EH!(G{XE=)4b7G34YFZ z55Z{9eBd#5D9)MiM+G-WH`Bnw4ny7VX%p&iB9VIyY#sb>e|&r zwV%(7_czo62eoQv6NE>p4F{ghx%*H`85~td)@L1{dGr$FZ9>8p+l1y{rG&xifak0O zG|y+@wL(UEu_HJV{HFY?lzA*ak3H)I(3}fk8;N+`2$8>a8NJai0^-D^ZG^^a?IZ0f z{si+`=Yr1SeoYV#L6nAtjZg4w5?=_l~pW}H+(`C^~Fjb z3yFrKEd)BmN{LbyQjKOpuj~*jB~WQeYhT7oVs1DQE9)TN(!5A*)YCMzAR$&ZVd5%} zSW$sk*@lU$9J+`K#L5s%T>9xMDiA9}F>&dokElSbjKM~W`iQwdpboLJ3wGsc{t$hL zLelY#MXc-!_a<6s%oFa=3Yk$4MXc-tJ4bw$cHT%29Kje5LJ=#6fT@3521=VD9vx7J zSUDslf_CXmS`bm{uKXMdv2qM>x8}j-gOJAnYivO|#L6+jFbp&=HVq`@M2)dRUL9iP zR4}w9&f7fLaNwEd5>u7e{F6%AY&L7yZnsN#e0*FzKR;g_|7^u8`xEkMu~_WZ>-A>2 rTy9sZ)gv7LJZnixSXQ)@SFipBmN~Lrt-Kf300000NkvXXu0mjfY%3#( literal 0 HcmV?d00001 diff --git a/examples/Interactive-Audiobook[VoiceBot]/logo/lyzr-logo.png b/examples/Interactive-Audiobook[VoiceBot]/logo/lyzr-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..090c292bfcda115dc6f5c02ac1593797a564912b GIT binary patch literal 5182 zcmX|F2T)T@v`(lAT~Gw6p^6j*r1ua)kP@V5C?Zv)i4^HYLRUJ7f>cpJBvPb^l%OII zI?^EmhTeowW2C(Bzc+7Z?mcIBPWkS4ch8yGL{k%eW`-*a004m500A=t0D!&}{RN1Q z^44SbiKhq}Kd6BPh%&-J&Iy#ci3`f$fw3{*8bt>IXn_6#^6aE4KaJ)8v=~x8iZRHzh^QZ*GR!#Ho8}S}iI?}&r zMMJBKe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421X>VgdB zxi^bF))QQyAz#j1g<{gY#H7G3aS^_uG_Cf**9dG35VfUb-xDM%WSzpZ#bNDbO{d`9 zV3oD<^*A;&zAacpvWlDP8o1p?LFr@06`2m@F^#OZ&IR2hPx6?{rDvHb+LC=ftYqzpi@#kQkj6Z8F z*&MWQ9-h1xw%74EqDGc?Wfnd*V!M#%XZgbxIGAVjiAAOK1t!ROs@$~1PTZjNFaYTo8lD>JcLiW@fkd(8lTCJ{N_29dp^w4_2d<+WpI zzZt>bwWmutF`;~#VHxYyV zF2f7i+sT?4ra!ROWhv&3xDg|(t{-T-b828!}O6S7kNc@vdA;m z=k5)z5qE0XIwbB+QJ^K=LHt{NeBR-$_9VZ1jtzv|DcAILdZg2>m-jdFf|h8X7_+yp zvnHyQhKD_wEtB%7c{*3@C;7n}^Ejtt_KW-b>jljj^IhMU@`^uenM&CvocIPqY=gsE zKZ~q$Zvc_?oj9hu>*h)9nApBM)Ch>}Nh{n8=pHieF84W8`7qJXiV6);eWzUa>jFib zA#Co1V73m#?)~`<2+jz|U*u@7g-ZYG3tX#8zvI^98->=4a&)3+^wU^!9L;^@=_Bris`J)W1=@9BG^d8of4ErjsUpPVH`!ZBceHJL z+HfQ3^G?>D&hSE8XDONI$ubCrRE=+1u0pu^yuFeJd--ZF9AMesi_-9UiTLs13a)-$ zFUoL>A`e!NSpL=>@N4-q)?IbE$~33@_?NqAjRfoCuwzX?tn_$#yq|!h%X9KW)4Qda;R=6`WHn8!gh$YD(DWfuaj`TiJ-%(i@CBniT6bIHi6`R<~Iz_ l54?Nk*133+H!9VNysu=>Oy`WXdQQK}2k(_>lUOoe{{u1|G%5f9 literal 0 HcmV?d00001 diff --git a/examples/Interactive-Audiobook[VoiceBot]/utils/__init__.py b/examples/Interactive-Audiobook[VoiceBot]/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/examples/Interactive-Audiobook[VoiceBot]/utils/utils.py b/examples/Interactive-Audiobook[VoiceBot]/utils/utils.py new file mode 100644 index 0000000..a28058f --- /dev/null +++ b/examples/Interactive-Audiobook[VoiceBot]/utils/utils.py @@ -0,0 +1,42 @@ +import os +from dotenv import load_dotenv; load_dotenv() +from openai import OpenAI + + + +def get_files_in_directory(directory): + # This function help us to get the file path along with filename. + files_list = [] + + if os.path.exists(directory) and os.path.isdir(directory): + for filename in os.listdir(directory): + file_path = os.path.join(directory, filename) + + if os.path.isfile(file_path): + files_list.append(file_path) + + return files_list + + +def story_generator(prompt): + API_KEY = os.getenv('OPENAI_API_KEY') + ai = OpenAI(api_key=API_KEY) + + response = ai.completions.create( + model="gpt-3.5-turbo-instruct", + prompt=prompt, + temperature=0.1, + max_tokens=1000) + + story = response.choices[0].text.strip() + return story + +def prompt(user_input): + prompt = f"""You are an expert to create kid's stories, create a complete story on this {user_input}. + Make sure story obeys these points: + 1. Story should be short and precise. + 2. Story will cover from introduction to climax in 500-700 words. + 3. Story will proivde valuable learning's for children's. + """ + + return prompt