mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
feat(search): add semantic search with embeddings and search mode toggle
This commit is contained in:
@@ -44,6 +44,9 @@ export type SearchOperator = z.infer<typeof searchOperatorSchema>
|
||||
export const searchAssetTypeSchema = z.enum(['file', 'folder'])
|
||||
export type SearchAssetType = z.infer<typeof searchAssetTypeSchema>
|
||||
|
||||
export const searchModeSchema = z.enum(['name', 'content', 'all']).optional().default('name')
|
||||
export type SearchMode = z.infer<typeof searchModeSchema>
|
||||
|
||||
export const searchFilterSchema = z.object({
|
||||
operator: searchOperatorSchema.optional().default('AND'),
|
||||
conditions: z.array(searchConditionSchema).optional().default([]),
|
||||
@@ -53,6 +56,7 @@ export const searchFilterSchema = z.object({
|
||||
showSymlink: z.boolean().optional(),
|
||||
recursively: z.boolean().optional().default(true),
|
||||
query: z.string().optional(),
|
||||
searchMode: searchModeSchema.default('name'),
|
||||
})
|
||||
export type SearchFilter = z.infer<typeof searchFilterSchema>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user