From 13f9b6db8576e327ee84ec6081a91bf1acd7b4d1 Mon Sep 17 00:00:00 2001 From: zsimjee Date: Fri, 3 Nov 2023 09:49:41 -0700 Subject: [PATCH 1/4] install deps + pkg for nb runs --- .github/workflows/examples_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples_check.yml b/.github/workflows/examples_check.yml index f01651382..1bbd5355f 100644 --- a/.github/workflows/examples_check.yml +++ b/.github/workflows/examples_check.yml @@ -20,7 +20,7 @@ jobs: - name: Install dependencies run: | - pip install jupyter nbconvert + make full; pip install jupyter nbconvert; pip install . - name: Execute notebooks and check for errors run: | From a5822aabfb416dd3f7c26807ef3102ff831f63a2 Mon Sep 17 00:00:00 2001 From: zsimjee Date: Fri, 3 Nov 2023 09:54:18 -0700 Subject: [PATCH 2/4] lock nb runner to 3.11.x --- .github/workflows/examples_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/examples_check.yml b/.github/workflows/examples_check.yml index 1bbd5355f..8315e1e85 100644 --- a/.github/workflows/examples_check.yml +++ b/.github/workflows/examples_check.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.x + python-version: 3.11.x - name: Install dependencies run: | From 2c2159962bf93e1afd366f1649a2039abe6f22ea Mon Sep 17 00:00:00 2001 From: zsimjee Date: Fri, 3 Nov 2023 09:57:28 -0700 Subject: [PATCH 3/4] use cohere api key from environ --- docs/examples/provenance.ipynb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/examples/provenance.ipynb b/docs/examples/provenance.ipynb index 92256efc6..460bf1a32 100644 --- a/docs/examples/provenance.ipynb +++ b/docs/examples/provenance.ipynb @@ -298,9 +298,12 @@ "from guardrails import Guard\n", "from guardrails.validators import ProvenanceV0\n", "from typing import List, Union\n", + "import os\n", + "\n", + "api_key = os.environ[\"COHERE_API_KEY\"]\n", "\n", "# Create a cohere client\n", - "cohere_client = cohere.Client(api_key=\"\")\n", + "cohere_client = cohere.Client(api_key=api_key)\n", "\n", "\n", "def embed_function(text: Union[str, List[str]]) -> np.ndarray:\n", From 9e1f8b54bead231cee04b2a121413022824849f3 Mon Sep 17 00:00:00 2001 From: zsimjee Date: Fri, 3 Nov 2023 10:00:32 -0700 Subject: [PATCH 4/4] ref env vars for cohere + openai --- .github/workflows/examples_check.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/examples_check.yml b/.github/workflows/examples_check.yml index 8315e1e85..de4c9a31c 100644 --- a/.github/workflows/examples_check.yml +++ b/.github/workflows/examples_check.yml @@ -9,6 +9,11 @@ jobs: execute_notebooks: runs-on: ubuntu-latest + env: + COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + + steps: - name: Checkout repository uses: actions/checkout@v2