(output: NotebookCellSourceOutput)
| 132 | } |
| 133 | |
| 134 | function cellOutputToToolResult(output: NotebookCellSourceOutput) { |
| 135 | const outputs: (TextBlockParam | ImageBlockParam)[] = [] |
| 136 | if (output.text) { |
| 137 | outputs.push({ |
| 138 | text: `\n${output.text}`, |
| 139 | type: 'text', |
| 140 | }) |
| 141 | } |
| 142 | if (output.image) { |
| 143 | outputs.push({ |
| 144 | type: 'image', |
| 145 | source: { |
| 146 | data: output.image.image_data, |
| 147 | media_type: output.image.media_type, |
| 148 | type: 'base64', |
| 149 | }, |
| 150 | }) |
| 151 | } |
| 152 | return outputs |
| 153 | } |
| 154 | |
| 155 | function getToolResultFromCell(cell: NotebookCellSource) { |
| 156 | const contentResult = cellContentToToolResult(cell) |
nothing calls this directly
no outgoing calls
no test coverage detected