Fix misc errors in tutorials 1 and 3 #549
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Applying Structured Output to RAG applications
While following the tutorial, named Applying Structured Output to RAG applications, I noticed some cells are not rendered correctly.
Some of the fixes involve the following (not exhaustive):
One block of code has the
response_model
to bes
, wheres
is undefined, inferring from earlier content, I tentatively replaceds
to beIterable[Extraction]
.The
helpers
script/module is not defined, I did a search, which lead me to https://github.com/wandb/edu/blob/main/llm-structured-extraction/helpers.py and added the missing function(s).Small linguistic fix:
Working with structured outputs
While going through the first tutorial, I noticed many cells will render error (by design) to show readers how validations work. It might be cleaner to use
try-except
withtraceback
here so in future, if we ever useexecute=True
or something, the notebook will render and not halt. An example below: