2
0

🐛 (ai) Fix vision on URL that contains whitespaces

This commit is contained in:
Baptiste Arnaud
2024-07-30 17:08:01 +02:00
parent a9f2b49251
commit 5a0a133429

View File

@ -9,7 +9,7 @@ export const splitUserTextMessageIntoBlocks = async ({
input, input,
shouldDownloadImages, shouldDownloadImages,
}: Props): Promise<UserContent> => { }: Props): Promise<UserContent> => {
const urlRegex = /(^|\n\n)(https?:\/\/[^\s]+)(\n\n|$)/g const urlRegex = /(^|\n\n)(https?:\/\/.+)(\n\n|$)/g
const match = input.match(urlRegex) const match = input.match(urlRegex)
if (!match) return input if (!match) return input
let parts: (TextPart | ImagePart)[] = [] let parts: (TextPart | ImagePart)[] = []