Skip to content

Commit

Permalink
RFC how much detail is too much? (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeDott29 authored Nov 19, 2023
1 parent f9864d0 commit c3330a7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tutorials/1.introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Lastly you can also define functions that run on the data."
"Lastly you can also define functions that run on the data. In this case we use the [@field_validator](https://docs.pydantic.dev/latest/concepts/validators/#field-validators) decorator."
]
},
{
Expand Down Expand Up @@ -284,6 +284,18 @@
"Person(name=\"Sam\", age=10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"'...' is used as a placeholder for a required value in Pydantic's [Field](https://docs.pydantic.dev/latest/concepts/fields/) function.\n",
"\n",
"```age: int = Field(..., gt=0)```\n",
"defines a field age of type int in the Person model. The ... indicates that this field is required and must be provided when creating an instance of the Person model. The gt=0 is a validation that ensures the age must be greater than 0.\n",
"\n",
"If you try to create a Person without providing an age, Pydantic will raise a validation error because of the ... placeholder."
]
},
{
"cell_type": "code",
"execution_count": 31,
Expand Down Expand Up @@ -397,7 +409,7 @@
"source": [
"## Introduction to Function Calling \n",
"\n",
"The json could be anything! We could add more and more into a prompt and hope it works, or we can use something called function calling to directly specify the schema we want. \n",
"The json could be anything! We could add more and more into a prompt and hope it works, or we can use something called [function calling](https://platform.openai.com/docs/guides/function-calling) to directly specify the schema we want. \n",
"\n",
"\n",
"**Function Calling**\n",
Expand Down

0 comments on commit c3330a7

Please sign in to comment.