mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(agent): support dynamic annotationId resolution across chat and comments (#375)
* feat(agent): improve timestamp precision and proxy selection for video screenshots * feat(agent): support dynamic annotationId resolution across chat and comments * fix(agent): scope annotation resolution to asset and format has_markup consistently
This commit is contained in:
@@ -330,5 +330,25 @@ describe('serializeContextToXml', () => {
|
||||
expect(serializeContextToXml(context2)).toContain('duration_seconds="14.00"')
|
||||
expect(serializeContextToXml(context2)).toContain('seconds="5.5000"')
|
||||
})
|
||||
|
||||
it('serializes annotation tag with id when context.id is provided', () => {
|
||||
const context: ShumaiMessageContext = {
|
||||
id: '01JABCDEF1234567890',
|
||||
annotation: true,
|
||||
}
|
||||
expect(serializeContextToXml(context)).toBe(
|
||||
'<context>\n <annotation id="01JABCDEF1234567890" />\n</context>',
|
||||
)
|
||||
})
|
||||
|
||||
it('escapes special XML characters in annotation id', () => {
|
||||
const context: ShumaiMessageContext = {
|
||||
id: 'test<id>&"123"',
|
||||
annotation: true,
|
||||
}
|
||||
expect(serializeContextToXml(context)).toBe(
|
||||
'<context>\n <annotation id="test<id>&"123"" />\n</context>',
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user