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