|
6 | 6 | from typing import Any, Dict, Literal, Optional, Tuple |
7 | 7 |
|
8 | 8 | import nbformat |
9 | | -from jupyter_ai.tools.models import Tool, Toolkit |
10 | 9 | from jupyter_ydoc import YNotebook |
11 | 10 | from pycrdt import Assoc, Text |
12 | 11 |
|
@@ -1006,15 +1005,13 @@ async def create_notebook(file_path: str) -> str: |
1006 | 1005 | return f"Error: Failed to create notebook: {str(e)}" |
1007 | 1006 |
|
1008 | 1007 |
|
1009 | | -toolkit = Toolkit( |
1010 | | - name="notebook_toolkit", |
1011 | | - description="Tools for reading and manipulating Jupyter notebooks.", |
1012 | | -) |
1013 | | -toolkit.add_tool(Tool(callable=read_notebook, read=True)) |
1014 | | -toolkit.add_tool(Tool(callable=read_cell, read=True)) |
1015 | | -toolkit.add_tool(Tool(callable=add_cell, read=True, write=True)) |
1016 | | -toolkit.add_tool(Tool(callable=insert_cell, read=True, write=True)) |
1017 | | -toolkit.add_tool(Tool(callable=delete_cell, delete=True)) |
1018 | | -toolkit.add_tool(Tool(callable=edit_cell, read=True, write=True)) |
1019 | | -toolkit.add_tool(Tool(callable=get_cell_id_from_index, read=True)) |
1020 | | -toolkit.add_tool(Tool(callable=create_notebook, write=True)) |
| 1008 | +toolkit = [ |
| 1009 | + read_notebook, |
| 1010 | + read_cell, |
| 1011 | + add_cell, |
| 1012 | + insert_cell, |
| 1013 | + delete_cell, |
| 1014 | + edit_cell, |
| 1015 | + get_cell_id_from_index, |
| 1016 | + create_notebook, |
| 1017 | +] |
0 commit comments