Skip to content

Commit

Permalink
preview: treat ipynb as text; dedupe object names
Browse files Browse the repository at this point in the history
  • Loading branch information
nl0 committed Aug 14, 2024
1 parent 6c1bbbe commit acf1da4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ const getDocumentPreview = (handle: S3ObjectLocation, format: Content.DocumentFo
return Content.text('Could not get object contents')
}
return Content.ToolResultContentBlock.Document({
name: normalizeDocumentName(handle.key),
name: normalizeDocumentName(
`${handle.bucket} ${handle.key} ${handle.version || ''}`,
),
format,
source: blob as $TSFixMe,
})
Expand Down Expand Up @@ -430,5 +432,8 @@ const detectFileType = (key: string): FileType => {
if (isText(key)) {
return FileType.Document({ format: 'txt' })
}
if (ext === '.ipynb') {
return FileType.Document({ format: 'txt' })
}
return FileType.Unidentified()
}

0 comments on commit acf1da4

Please sign in to comment.