diff --git a/.gitignore b/.gitignore index 40415b49..bfe67830 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .amlignore +.env .zip .chroma/ .ipynb_checkpoints/ diff --git a/01-Load-Data-ACogSearch.ipynb b/01-Load-Data-ACogSearch.ipynb index 9c15c0b4..c1fe458a 100644 --- a/01-Load-Data-ACogSearch.ipynb +++ b/01-Load-Data-ACogSearch.ipynb @@ -64,7 +64,7 @@ "import json\n", "import requests\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "# Name of the container in your Blob Storage Datasource ( in credentials.env)\n", "BLOB_CONTAINER_NAME = \"arxivcs\"" @@ -85,7 +85,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -332,7 +332,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -477,9 +477,11 @@ "}\n", "\n", "r = requests.put(os.environ['AZURE_SEARCH_ENDPOINT'] + \"/skillsets/\" + skillset_name,\n", - " data=json.dumps(skillset_payload), headers=headers, params=params)\n", + " json=skillset_payload, headers=headers, params=params)\n", "print(r.status_code)\n", - "print(r.ok)" + "print(r.ok)\n", + "if not r.ok:\n", + " print(r.text)" ] }, { @@ -579,7 +581,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 8, "metadata": { "tags": [] }, @@ -589,8 +591,8 @@ "output_type": "stream", "text": [ "200\n", - "Status: success\n", - "Items Processed: 0\n", + "Status: transientFailure\n", + "Items Processed: 1169\n", "True\n" ] } @@ -646,9 +648,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.10 - SDK v2", + "display_name": "Python 3", "language": "python", - "name": "python310-sdkv2" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -660,12 +662,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" - }, - "vscode": { - "interpreter": { - "hash": "9ff083f0c83558f9261023d47a77b9b3eb892c62cdbe066d046abcad1a5edb5c" - } + "version": "3.12.1" } }, "nbformat": 4, diff --git a/02-LoadCSVOneToMany-ACogSearch.ipynb b/02-LoadCSVOneToMany-ACogSearch.ipynb index 34db4cb9..af975fd4 100644 --- a/02-LoadCSVOneToMany-ACogSearch.ipynb +++ b/02-LoadCSVOneToMany-ACogSearch.ipynb @@ -26,7 +26,7 @@ "import json\n", "import requests\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "# Name of the container in your Blob Storage Datasource ( in credentials.env)\n", "BLOB_CONTAINER_NAME = \"cord19\"" @@ -143,74 +143,81 @@ "No. of lines: 90000\n" ] }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Matplotlib is building the font cache; this may take a moment.\n" + ] + }, { "data": { "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
 cord_uidsource_xtitleabstractauthorsurlcord_uidsource_xtitleabstractauthorsurl
0ug7v899jPMCClinical features of culture-p...OBJECTIVE: This retrospective ...Madani, Tariq A; Al-Ghamdi, Ai...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC35282/0ug7v899jPMCClinical features of culture-p...OBJECTIVE: This retrospective ...Madani, Tariq A; Al-Ghamdi, Ai...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC35282/
102tnwd4mPMCNitric oxide: a pro-inflammato...Inflammatory diseases of the r...Vliet, Albert van der; Eiseric...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59543/102tnwd4mPMCNitric oxide: a pro-inflammato...Inflammatory diseases of the r...Vliet, Albert van der; Eiseric...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59543/
2ejv2xln0PMCSurfactant protein-D and pulmo...Surfactant protein-D (SP-D) pa...Crouch, Erika C...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59549/2ejv2xln0PMCSurfactant protein-D and pulmo...Surfactant protein-D (SP-D) pa...Crouch, Erika C...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59549/
32b73a28nPMCRole of endothelin-1 in lung d...Endothelin-1 (ET-1) is a 21 am...Fagan, Karen A; McMurtry, Ivan...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59574/32b73a28nPMCRole of endothelin-1 in lung d...Endothelin-1 (ET-1) is a 21 am...Fagan, Karen A; McMurtry, Ivan...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59574/
49785vg6dPMCGene expression in epithelial ...Respiratory syncytial virus (R...Domachowske, Joseph B; Bonvill...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59580/49785vg6dPMCGene expression in epithelial ...Respiratory syncytial virus (R...Domachowske, Joseph B; Bonvill...https://www.ncbi.nlm.nih.gov/pmc/articles/PMC59580/
\n" ], "text/plain": [ - "" + "" ] }, "execution_count": 6, @@ -253,7 +260,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "id": "74913764-9dfb-4646-aac8-d389cd4533e6", "metadata": {}, "outputs": [ @@ -354,7 +361,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "id": "b46cfa90-28b4-4602-b6ff-743a3407fd72", "metadata": {}, "outputs": [ @@ -472,7 +479,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "id": "b87b8ebd-8091-43b6-9124-cc17021cfb78", "metadata": {}, "outputs": [ @@ -521,7 +528,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 10, "id": "6132c041-7213-410e-a206-1a8c7385128e", "metadata": {}, "outputs": [ @@ -530,8 +537,8 @@ "output_type": "stream", "text": [ "200\n", - "Status: inProgress\n", - "Items Processed: 209\n", + "Status: success\n", + "Items Processed: 0\n", "True\n" ] } @@ -590,9 +597,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.10 - SDK v2", + "display_name": "Python 3", "language": "python", - "name": "python310-sdkv2" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -604,7 +611,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.12.1" } }, "nbformat": 4, diff --git a/03-Quering-AOpenAI.ipynb b/03-Quering-AOpenAI.ipynb index c3ef4e0e..03270e08 100644 --- a/03-Quering-AOpenAI.ipynb +++ b/03-Quering-AOpenAI.ipynb @@ -71,7 +71,7 @@ "from common.utils import get_search_results\n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")" + "load_dotenv(\".env\", verbose=True, override=True)" ] }, { diff --git a/04-Complex-Docs.ipynb b/04-Complex-Docs.ipynb index 70488f30..60c95204 100644 --- a/04-Complex-Docs.ipynb +++ b/04-Complex-Docs.ipynb @@ -58,7 +58,7 @@ "from IPython.display import Markdown, HTML, display \n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "def printmd(string):\n", " display(Markdown(string))\n", diff --git a/05-Adding_Memory.ipynb b/05-Adding_Memory.ipynb index 9664d614..e5d6976f 100644 --- a/05-Adding_Memory.ipynb +++ b/05-Adding_Memory.ipynb @@ -52,7 +52,7 @@ "from common.prompts import DOCSEARCH_PROMPT\n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "import logging\n", "\n", diff --git a/06-First-RAG.ipynb b/06-First-RAG.ipynb index c8461a45..d8c97cfc 100644 --- a/06-First-RAG.ipynb +++ b/06-First-RAG.ipynb @@ -70,7 +70,7 @@ " display(Markdown(string))\n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n" + "load_dotenv(\".env\", verbose=True, override=True)\n" ] }, { diff --git a/07-TabularDataQA.ipynb b/07-TabularDataQA.ipynb index 3d13a1e8..3ee6dd5e 100644 --- a/07-TabularDataQA.ipynb +++ b/07-TabularDataQA.ipynb @@ -40,7 +40,7 @@ "from IPython.display import Markdown, HTML, display \n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "def printmd(string):\n", " display(Markdown(string))" diff --git a/08-SQLDB_QA.ipynb b/08-SQLDB_QA.ipynb index f207ed87..28cf387d 100644 --- a/08-SQLDB_QA.ipynb +++ b/08-SQLDB_QA.ipynb @@ -45,7 +45,7 @@ "from IPython.display import Markdown, HTML, display \n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "def printmd(string):\n", " display(Markdown(string))" diff --git a/09-BingChatClone.ipynb b/09-BingChatClone.ipynb index 83d654c2..8298ce9c 100644 --- a/09-BingChatClone.ipynb +++ b/09-BingChatClone.ipynb @@ -67,7 +67,7 @@ " display(Markdown(string.replace(\"$\",\"USD \")))\n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n" + "load_dotenv(\".env\", verbose=True, override=True)\n" ] }, { diff --git a/10-API-Search.ipynb b/10-API-Search.ipynb index b2e98a18..f24dac77 100644 --- a/10-API-Search.ipynb +++ b/10-API-Search.ipynb @@ -56,7 +56,7 @@ "from IPython.display import Markdown, HTML, display \n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "def printmd(string):\n", " display(Markdown(string.replace(\"$\",\"USD \")))\n" diff --git a/11-Smart_Agent.ipynb b/11-Smart_Agent.ipynb index 98c71a7a..9d7608ab 100644 --- a/11-Smart_Agent.ipynb +++ b/11-Smart_Agent.ipynb @@ -91,7 +91,7 @@ "from common.prompts import CUSTOM_CHATBOT_PROMPT \n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "from IPython.display import Markdown, HTML, display \n", "\n", diff --git a/11.5-Smart_Agent-LangGraph.ipynb b/11.5-Smart_Agent-LangGraph.ipynb index c1366a93..95d3843e 100644 --- a/11.5-Smart_Agent-LangGraph.ipynb +++ b/11.5-Smart_Agent-LangGraph.ipynb @@ -61,7 +61,7 @@ "from common.prompts import CUSTOM_CHATBOT_PROMPT, CUSTOM_CHATBOT_PREFIX\n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "from IPython.display import Markdown, HTML, display \n", "\n", diff --git a/13-BotService-API.ipynb b/13-BotService-API.ipynb index 313a23e4..3a1452a7 100644 --- a/13-BotService-API.ipynb +++ b/13-BotService-API.ipynb @@ -39,7 +39,7 @@ "nest_asyncio.apply() # this is only needed for jupyter notebooks\n", "\n", "from dotenv import load_dotenv\n", - "load_dotenv(\"credentials.env\")\n", + "load_dotenv(\".env\", verbose=True, override=True)\n", "\n", "# Declare Bot Service variables\n", "\n", diff --git a/14-LangServe-API.ipynb b/14-LangServe-API.ipynb index 2b51b868..578d61a9 100644 --- a/14-LangServe-API.ipynb +++ b/14-LangServe-API.ipynb @@ -119,7 +119,7 @@ " # # Calculate the path three directories above the current script\n", " # library_path = Path(__file__).resolve().parents[4]\n", " # sys.path.append(str(library_path))\n", - " # load_dotenv(str(library_path) + \"/credentials.env\")\n", + " # load_dotenv(str(library_path) + \"/.env\")\n", " # os.environ[\"AZURE_OPENAI_MODEL_NAME\"] = os.environ[\"GPT35_DEPLOYMENT_NAME\"]\n", "\n", " ###################################\n", diff --git a/README.md b/README.md index 298bb132..6f87dea1 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ Note: (Pre-requisite) You need to have an Azure OpenAI service already created ``` You might get some pip dependancies errors, but that is ok, the libraries were installed correctly regardless of the error. -8. Edit the file `credentials.env` with your own values from the services created in step 4. +8. Copy the file `credentials.env` to a new `.env` file and update the latter with your own values from the services created in step 4. - For BLOB_SAS_TOKEN and BLOB_CONNECTION_STRING. Go to Storage Account>Security + networking>Shared access signature>Generate SAS 9. **Run the Notebooks in order**. They build up on top of each other. diff --git a/credentials.env b/credentials.env index 02ac3eaa..41687316 100644 --- a/credentials.env +++ b/credentials.env @@ -5,8 +5,6 @@ BING_SEARCH_URL="https://api.bing.microsoft.com/v7.0/search" BOT_DIRECT_CHANNEL_ENDPOINT="https://directline.botframework.com/v3/directline" # Demo Data (edit with your own if you want to use your own data) -BLOB_CONNECTION_STRING="BlobEndpoint=https://datasetsgptsmartsearch.blob.core.windows.net/;QueueEndpoint=https://datasetsgptsmartsearch.queue.core.windows.net/;FileEndpoint=https://datasetsgptsmartsearch.file.core.windows.net/;TableEndpoint=https://datasetsgptsmartsearch.table.core.windows.net/;SharedAccessSignature=sv=2022-11-02&ss=b&srt=sco&sp=rl&se=2026-01-03T02:11:44Z&st=2024-01-02T18:11:44Z&spr=https&sig=ngrEqvqBVaxyuSYqgPVeF%2B9c0fXLs94v3ASgwg7LDBs%3D" -BLOB_SAS_TOKEN="?sv=2022-11-02&ss=b&srt=sco&sp=rl&se=2026-01-03T02:11:44Z&st=2024-01-02T18:11:44Z&spr=https&sig=ngrEqvqBVaxyuSYqgPVeF%2B9c0fXLs94v3ASgwg7LDBs%3D" # Edit with your own azure services values