Skip to content

Commit

Permalink
Cron nb (#425)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zsimjee authored Nov 3, 2023
1 parent 6fe2d00 commit 24285ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/examples_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ 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

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
python-version: 3.11.x

- name: Install dependencies
run: |
pip install jupyter nbconvert
make full; pip install jupyter nbconvert; pip install .
- name: Execute notebooks and check for errors
run: |
Expand Down
5 changes: 4 additions & 1 deletion docs/examples/provenance.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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=\"<Cohere_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",
Expand Down

0 comments on commit 24285ab

Please sign in to comment.