DSPy: The framework for programming—not prompting—language models
Python
fix assertions notebook import
Arnav Singhvi7d65f2adb4f9
diff --git a/examples/longformqa/longformqa_assertions.ipynb b/examples/longformqa/longformqa_assertions.ipynbindex d179153ac..a307e5145 100644--- a/examples/longformqa/longformqa_assertions.ipynb+++ b/examples/longformqa/longformqa_assertions.ipynb@@ -35,17 +35,6 @@"Let's begin by setting things up."]},- {- "cell_type": "code",- "execution_count": null,- "metadata": {},- "outputs": [],- "source": [- "import os\n",- "import openai\n",- "openai.api_key = os.getenv('OPENAI_API_KEY')"- ]- },{"cell_type": "markdown","metadata": {},@@ -98,6 +87,17 @@"from utils import extract_text_by_citation, citations_check"]},+ {+ "cell_type": "code",+ "execution_count": null,+ "metadata": {},+ "outputs": [],+ "source": [+ "import os\n",+ "import openai\n",+ "openai.api_key = os.getenv('OPENAI_API_KEY')"+ ]+ },{"cell_type": "markdown","metadata": {},diff --git a/examples/quiz/quiz_assertions.ipynb b/examples/quiz/quiz_assertions.ipynbindex 93977702f..60eb5f290 100644--- a/examples/quiz/quiz_assertions.ipynb+++ b/examples/quiz/quiz_assertions.ipynb@@ -24,17 +24,6 @@"This notebook builds upon the foundational concepts of the **DSPy** framework. Prerequisites of following this notebook is having gone through the [DSPy tutorial](../../intro.ipynb), the [**DSPy Assertions documentation**](https://dspy-docs.vercel.app/docs/building-blocks/assertions) and the introductory DSPy Assertions [tutorial on LongFormQA](../longformqa/longformqa_assertions.ipynb).\n"]},- {- "cell_type": "code",- "execution_count": null,- "metadata": {},- "outputs": [],- "source": [- "import os\n",- "import openai\n",- "openai.api_key = os.getenv('OPENAI_API_KEY')"- ]- },{"cell_type": "code","execution_count": null,@@ -75,6 +64,17 @@"from dspy.primitives.assertions import assert_transform_module, backtrack_handler"]},+ {+ "cell_type": "code",+ "execution_count": null,+ "metadata": {},+ "outputs": [],+ "source": [+ "import os\n",+ "import openai\n",+ "openai.api_key = os.getenv('OPENAI_API_KEY')"+ ]+ },{"cell_type": "code","execution_count": null,diff --git a/examples/tweets/tweets_assertions.ipynb b/examples/tweets/tweets_assertions.ipynbindex 6cefadf98..76b64ec4d 100644--- a/examples/tweets/tweets_assertions.ipynb+++ b/examples/tweets/tweets_assertions.ipynb@@ -24,17 +24,6 @@"This notebook builds upon the foundational concepts of the **DSPy** framework. Prerequisites of following this notebook is having gone through the [DSPy tutorial](../../intro.ipynb), the [**DSPy Assertions documentation**](https://dspy-docs.vercel.app/docs/building-blocks/assertions) and the introductory DSPy Assertions [tutorial on LongFormQA](../longformqa/longformqa_assertions.ipynb).\n"]},- {- "cell_type": "code",- "execution_count": null,- "metadata": {},- "outputs": [],- "source": [- "import os\n",- "import openai\n",- "openai.api_key = os.getenv('OPENAI_API_KEY')"- ]- },{"cell_type": "code","execution_count": null,@@ -76,6 +65,17 @@"from dspy.primitives.assertions import assert_transform_module, backtrack_handler"]},+ {+ "cell_type": "code",+ "execution_count": null,+ "metadata": {},+ "outputs": [],+ "source": [+ "import os\n",+ "import openai\n",+ "openai.api_key = os.getenv('OPENAI_API_KEY')"+ ]+ },{"cell_type": "code","execution_count": null,