-
-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create /autonotebook command for AI generated notebooks #90
Conversation
outline = generate_code(outline, llm=self.llm, verbose=True) | ||
outline = generate_title_and_summary(outline, llm=self.llm) | ||
notebook = create_notebook(outline) | ||
final_path = os.path.join(self.root_dir, outline['title'] + '.ipynb') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a separate variable for the filename, so that we can strip out unsuitable characters like /
or &
(on Windows), and so that we can replace spaces with -
or _
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, let's do this in a follow up PR.
This looks great! I think the strategy of having the backend decompose a complex task (in this case, generating a notebook) by defining multiple chains is a great idea; this will help less frequently correct models behave as expected. Two points I wanted to call out here:
|
* Initial autonotebook work. * Working autonotebook. * Adding first autogenerated notebook example. * Removing file. * Adding second autonotebook example. * Cleaning up code, renaming autonotebook to generate. * Minor fixes, adding new example notebook. * Renaming examples subdir.
* Initial autonotebook work. * Working autonotebook. * Adding first autogenerated notebook example. * Removing file. * Adding second autonotebook example. * Cleaning up code, renaming autonotebook to generate. * Minor fixes, adding new example notebook. * Renaming examples subdir.
This PR implements an
/autonotebook
command that enables a user to provide a description of a notebook. Jupyter AI will then create the notebook and save it to disk. This uses a combination of different LangChain chains that are wired together to create the notebook in steps (outline of sections, code for each section, title, summary, improve code, etc.).Here is an example of its output: