From dc9a5dbd6d581c457b9892f787ca1270510319d7 Mon Sep 17 00:00:00 2001 From: Riddhimaan-Senapati Date: Mon, 16 Dec 2024 14:04:42 -0500 Subject: [PATCH 1/4] added links to the source code and github codespaces on both the LangChain_PromptTemplate page and LangChain_Quickstart page --- pages/3_Langchain_Quickstart.py | 2 ++ pages/4_Langchain_PromptTemplate.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/pages/3_Langchain_Quickstart.py b/pages/3_Langchain_Quickstart.py index 38c820f24..ec200626a 100644 --- a/pages/3_Langchain_Quickstart.py +++ b/pages/3_Langchain_Quickstart.py @@ -6,6 +6,8 @@ with st.sidebar: openai_api_key = st.text_input("OpenAI API Key", type="password") "[Get an OpenAI API key](https://platform.openai.com/account/api-keys)" + "[View the source code](https://github.com/streamlit/llm-examples/blob/main/pages/4_Langchain_Quickstart.py)" + "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/streamlit/llm-examples?quickstart=1)" def generate_response(input_text): diff --git a/pages/4_Langchain_PromptTemplate.py b/pages/4_Langchain_PromptTemplate.py index 3755419ea..d26331af4 100644 --- a/pages/4_Langchain_PromptTemplate.py +++ b/pages/4_Langchain_PromptTemplate.py @@ -4,6 +4,12 @@ st.title("🦜🔗 Langchain - Blog Outline Generator App") +with st.sidebar: + openai_api_key = st.text_input("OpenAI API Key", key="feedback_api_key", type="password") + "[Get an OpenAI API key](https://platform.openai.com/account/api-keys)" + "[View the source code](https://github.com/streamlit/llm-examples/blob/main/pages/4_Langchain_PromptTemplate.py)" + "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/streamlit/llm-examples?quickstart=1)" + openai_api_key = st.sidebar.text_input("OpenAI API Key", type="password") From a4720dfb7af937337eebabc94a6e0692773ddc92 Mon Sep 17 00:00:00 2001 From: Riddhimaan-Senapati Date: Mon, 16 Dec 2024 14:07:52 -0500 Subject: [PATCH 2/4] fixed the links so that they point to the correct pages --- pages/3_Langchain_Quickstart.py | 2 +- pages/4_Langchain_PromptTemplate.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/3_Langchain_Quickstart.py b/pages/3_Langchain_Quickstart.py index ec200626a..eacee135a 100644 --- a/pages/3_Langchain_Quickstart.py +++ b/pages/3_Langchain_Quickstart.py @@ -6,7 +6,7 @@ with st.sidebar: openai_api_key = st.text_input("OpenAI API Key", type="password") "[Get an OpenAI API key](https://platform.openai.com/account/api-keys)" - "[View the source code](https://github.com/streamlit/llm-examples/blob/main/pages/4_Langchain_Quickstart.py)" + "[View the source code](https://github.com/streamlit/llm-examples/blob/main/pages/3_Langchain_Quickstart.py)" "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/streamlit/llm-examples?quickstart=1)" diff --git a/pages/4_Langchain_PromptTemplate.py b/pages/4_Langchain_PromptTemplate.py index d26331af4..b203069ad 100644 --- a/pages/4_Langchain_PromptTemplate.py +++ b/pages/4_Langchain_PromptTemplate.py @@ -10,7 +10,6 @@ "[View the source code](https://github.com/streamlit/llm-examples/blob/main/pages/4_Langchain_PromptTemplate.py)" "[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/streamlit/llm-examples?quickstart=1)" -openai_api_key = st.sidebar.text_input("OpenAI API Key", type="password") def blog_outline(topic): From d430583b33d5bc10dac672af1e8078e0818b971d Mon Sep 17 00:00:00 2001 From: Riddhimaan-Senapati Date: Mon, 16 Dec 2024 15:40:29 -0500 Subject: [PATCH 3/4] updated the documentation to work with windows and mac based on the streamlit docs --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 03030f229..47c17248a 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,26 @@ OPENAI_API_KEY='xxxxxxxxxx' ## Run it locally +1. Open a terminal and navigate to your project folder. +2. Copy the following code in your terminal +### For Windows Powershell + +```sh +python -m venv .venv +.venv\Scripts\Activate.ps1 +pip install -r requirements.txt +streamlit run Chatbot.py +``` +### For Windows Command + +```sh +python -m venv .venv +.venv\Scripts\activate.bat +pip install -r requirements.txt +streamlit run Chatbot.py +``` +### For MacOS/Linux + ```sh virtualenv .venv source .venv/bin/activate From 986696568c04da832a591b0d01ecf6065dcb38fa Mon Sep 17 00:00:00 2001 From: Riddhimaan-Senapati Date: Mon, 16 Dec 2024 15:42:29 -0500 Subject: [PATCH 4/4] fixed some minor typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 47c17248a..d8dbec8c2 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ python -m venv .venv pip install -r requirements.txt streamlit run Chatbot.py ``` -### For Windows Command +### For Windows Command Prompt ```sh python -m venv .venv @@ -63,7 +63,7 @@ streamlit run Chatbot.py ### For MacOS/Linux ```sh -virtualenv .venv +python -m venv .venv source .venv/bin/activate pip install -r requirements.txt streamlit run Chatbot.py