small fixes to tutorials (#205)

This commit is contained in:
Francisco Ingham
2023-11-20 11:10:02 -08:00
committed by GitHub
parent 4e4cc52083
commit 5964df3689
3 changed files with 15 additions and 22 deletions
+6 -5
View File
@@ -15,9 +15,9 @@
"source": [
"Instead of framing \"self-critique\" or \"self-reflection\" in AI as new concepts, we can view them as validation errors with clear error messages that the systen can use to self correct.\n",
"\n",
"Pydantic offers an customizable and expressive validation framework for Python. Instructor leverages Pydantic's validation framework to provide a uniform developer experience for both code-based and LLM-based validation, as well as a reasking mechanism for correcting LLM outputs based on validation errors. To learn more check out the Pydantic docs on validators.\n",
"Pydantic offers an customizable and expressive validation framework for Python. Instructor leverages Pydantic's validation framework to provide a uniform developer experience for both code-based and LLM-based validation, as well as a reasking mechanism for correcting LLM outputs based on validation errors. To learn more check out the Pydantic [docs](https://docs.pydantic.dev/latest/) on validators.\n",
"\n",
"Note: For the majourity of this notebook we won't be calling openai, just using validators to see how we can control the validation of the objects."
"Note: For the majority of this notebook we won't be calling openai, just using validators to see how we can control the validation of the objects."
]
},
{
@@ -686,7 +686,7 @@
"source": [
"Integrating these validation examples with the OpenAI API is streamlined using `instructor`. After patching the OpenAI client with `instructor`, you simply need to specify a `response_model` for your requests. This setup ensures that all the validation processes occur automatically.\n",
"\n",
"Additionally, you can set a maximum number of retries. When calling the OpenAI client, the system can re-attempt to generate a correct answer. It does this by resending the original query along with feedback on why the previous response was rejected, guiding the LLM towards a more accurate answer in subsequent attempts."
"To enable reasking you can set a maximum number of retries. When calling the OpenAI client, the system can re-attempt to generate a correct answer. It does this by resending the original query along with feedback on why the previous response was rejected, guiding the LLM towards a more accurate answer in subsequent attempts."
]
},
{
@@ -736,6 +736,7 @@
{
"cell_type": "code",
"execution_count": 80,
"id": "0328bbc5",
"metadata": {},
"outputs": [
{
@@ -808,7 +809,7 @@
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@@ -822,7 +823,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.10.12"
}
},
"nbformat": 4,