(cell: NotebookCellSource)
| 117 | } |
| 118 | |
| 119 | function cellContentToToolResult(cell: NotebookCellSource): TextBlockParam { |
| 120 | const metadata = [] |
| 121 | if (cell.cellType !== 'code') { |
| 122 | metadata.push(`<cell_type>${cell.cellType}</cell_type>`) |
| 123 | } |
| 124 | if (cell.language !== 'python' && cell.cellType === 'code') { |
| 125 | metadata.push(`<language>${cell.language}</language>`) |
| 126 | } |
| 127 | const cellContent = `<cell id="${cell.cell_id}">${metadata.join('')}${cell.source}</cell id="${cell.cell_id}">` |
| 128 | return { |
| 129 | text: cellContent, |
| 130 | type: 'text', |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | function cellOutputToToolResult(output: NotebookCellSourceOutput) { |
| 135 | const outputs: (TextBlockParam | ImageBlockParam)[] = [] |
no test coverage detected