mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 16:03:26 +00:00
test(native-chat): cover marker boundary spacing
This commit is contained in:
@@ -44,8 +44,10 @@ describe('normalizeImageTranscriptMessages', () => {
|
||||
it.each([
|
||||
['[Image #1] describe this', 'describe this'],
|
||||
['[Image #1]\t describe this', 'describe this'],
|
||||
[' \t[Image #1] describe this', 'describe this'],
|
||||
['describe this [Image #1]', 'describe this'],
|
||||
['describe this \t[Image #1]', 'describe this'],
|
||||
['describe this [Image #1]\t ', 'describe this'],
|
||||
['describe [Image #1] this', 'describe this'],
|
||||
['describe [Image #1]\t this', 'describe \t this'],
|
||||
['describe[Image #1]\t this', 'describe\t this'],
|
||||
|
||||
@@ -3,8 +3,8 @@ import { isTextBlock, type NativeChatBlock, type NativeChatMessage } from './nat
|
||||
const IMAGE_SOURCE_MARKER = /^\[Image:\s*source:\s*(.+?)\]\s*$/
|
||||
const IMAGE_PROMPT_MARKER = /\[Image #\d+\]/
|
||||
const IMAGE_PROMPT_MARKERS = /\[Image #\d+\]/g
|
||||
const IMAGE_PROMPT_MARKER_AT_START = /^\[Image #\d+\]/
|
||||
const IMAGE_PROMPT_MARKER_AT_END = /\[Image #\d+\]$/
|
||||
const IMAGE_PROMPT_MARKER_AT_START = /^[^\S\r\n]*\[Image #\d+\]/
|
||||
const IMAGE_PROMPT_MARKER_AT_END = /\[Image #\d+\][^\S\r\n]*$/
|
||||
const HORIZONTAL_WHITESPACE_START = /^[^\S\r\n]+/
|
||||
const HORIZONTAL_WHITESPACE_END = /[^\S\r\n]+$/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user