mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 15:14:10 +00:00
feat(agent): support 3D degree comments, markup annotations, and config3d in read_asset (#473)
* feat(agent): support AI embedding, autofill, and read_asset for 3D assets * feat(agent): support 3D degree comments, markup annotations, and config3d in read_asset * fix(agent): resolve 3D session annotations to turntable degree frame time
This commit is contained in:
@@ -47,7 +47,7 @@ export const shumaiAssetContextSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
type: z.string(),
|
||||
mediaType: z.enum(['image', 'video', 'pdf', 'audio', 'other']).optional(),
|
||||
mediaType: z.enum(['image', 'video', 'pdf', 'audio', '3d', 'other']).optional(),
|
||||
mimeType: z.string().optional(),
|
||||
parentId: z.string().optional(),
|
||||
path: z.string().optional(),
|
||||
@@ -64,7 +64,7 @@ export const shumaiAttachedFileContextSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
type: z.string(),
|
||||
mediaType: z.enum(['image', 'video', 'pdf', 'audio', 'other']).optional(),
|
||||
mediaType: z.enum(['image', 'video', 'pdf', 'audio', '3d', 'other']).optional(),
|
||||
mimeType: z.string().optional(),
|
||||
path: z.string().optional(),
|
||||
url: z.string().optional(),
|
||||
@@ -75,6 +75,7 @@ export type ShumaiAttachedFileContext = z.infer<typeof shumaiAttachedFileContext
|
||||
export const shumaiMediaPositionSchema = z.discriminatedUnion('type', [
|
||||
z.object({ type: z.literal('time'), seconds: z.number() }),
|
||||
z.object({ type: z.literal('page'), page: z.number() }),
|
||||
z.object({ type: z.literal('degree'), degree: z.number().int() }),
|
||||
])
|
||||
|
||||
export type ShumaiMediaPosition = z.infer<typeof shumaiMediaPositionSchema>
|
||||
|
||||
@@ -104,6 +104,8 @@ export function serializeContextToXml(context?: ShumaiMessageContext | null): st
|
||||
lines.push(` <position type="time" seconds="${context.position.seconds.toFixed(4)}" />`)
|
||||
} else if (context.position.type === 'page') {
|
||||
lines.push(` <position type="page" page="${Math.round(context.position.page)}" />`)
|
||||
} else if (context.position.type === 'degree') {
|
||||
lines.push(` <position type="degree" degree="${Math.round(context.position.degree)}" />`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user