Skip to content

Commit 24285ab

Browse files
authored
Cron nb (#425)
* install deps + pkg for nb runs * lock nb runner to 3.11.x * use cohere api key from environ * ref env vars for cohere + openai
1 parent 6fe2d00 commit 24285ab

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/workflows/examples_check.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,23 @@ jobs:
99
execute_notebooks:
1010
runs-on: ubuntu-latest
1111

12+
env:
13+
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
14+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
15+
16+
1217
steps:
1318
- name: Checkout repository
1419
uses: actions/checkout@v2
1520

1621
- name: Set up Python
1722
uses: actions/setup-python@v2
1823
with:
19-
python-version: 3.x
24+
python-version: 3.11.x
2025

2126
- name: Install dependencies
2227
run: |
23-
pip install jupyter nbconvert
28+
make full; pip install jupyter nbconvert; pip install .
2429
2530
- name: Execute notebooks and check for errors
2631
run: |

docs/examples/provenance.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,12 @@
298298
"from guardrails import Guard\n",
299299
"from guardrails.validators import ProvenanceV0\n",
300300
"from typing import List, Union\n",
301+
"import os\n",
302+
"\n",
303+
"api_key = os.environ[\"COHERE_API_KEY\"]\n",
301304
"\n",
302305
"# Create a cohere client\n",
303-
"cohere_client = cohere.Client(api_key=\"<Cohere_API_KEY>\")\n",
306+
"cohere_client = cohere.Client(api_key=api_key)\n",
304307
"\n",
305308
"\n",
306309
"def embed_function(text: Union[str, List[str]]) -> np.ndarray:\n",

0 commit comments

Comments
 (0)