DSPy: The framework for programming—not prompting—language models
Python
SkyCamp
Omar Khattab62cf71be3632
diff --git a/skycamp2023.ipynb b/skycamp2023.ipynbindex a7f5fef26..e0bde4157 100644--- a/skycamp2023.ipynb+++ b/skycamp2023.ipynb@@ -411,7 +411,7 @@" self.retrieve = dspy.Retrieve(k=num_passages)\n"," self.generate_query = dspy.ChainOfThought(\"question -> search_query\")\n","\n",- " # TODO: Replace `None` with a dspy.ChainOfThought module that has the signature `context, question -> answer`.\n",+ " # TODO: Define a dspy.ChainOfThought module with the signature 'context, question -> search_query'.\n"," self.generate_query_from_context = None\n","\n"," self.generate_answer = dspy.ChainOfThought(\"context, question -> answer\")\n",@@ -424,6 +424,7 @@"\n"," # TODO: Replace `None` with a call to self.generate_query_from_context to generate a search query.\n"," # Note: In DSPy, always pass keyword arguments (e.g., context=..., question=...) to the modules to avoid ambiguity.\n",+ " # Note 2: Don't forget to access the field .search_query to extract that from the output of the module.\n"," search_query2 = None\n","\n"," # TODO: Replace `None` with a call to self.retrieve to retrieve passages. Append them to the list `passages`.\n",diff --git a/skycamp2023_completed.ipynb b/skycamp2023_completed.ipynbindex 243f5aacb..260e560c1 100644--- a/skycamp2023_completed.ipynb+++ b/skycamp2023_completed.ipynb@@ -1367,7 +1367,7 @@" self.retrieve = dspy.Retrieve(k=num_passages)\n"," self.generate_query = dspy.ChainOfThought(\"question -> search_query\")\n","\n",- " # TODO: Define a dspy.ChainOfThought module with the signature `context, question -> answer`.\n",+ " # TODO: Define a dspy.ChainOfThought module with the signature 'context, question -> search_query'.\n"," self.generate_query_from_context = dspy.ChainOfThought(\"context, question -> search_query\")\n","\n"," self.generate_answer = dspy.ChainOfThought(\"context, question -> answer\")\n",