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