feat(search): add semantic search with embeddings and search mode toggle

This commit is contained in:
yiling
2026-05-28 20:14:11 +08:00
parent a39f793050
commit 2eb6ff6c0e
18 changed files with 384 additions and 44 deletions
+9 -1
View File
@@ -185,7 +185,15 @@ export class TeamService {
where: { id: teamId },
})
if (!team) throw new Error('team not found')
return team.settings || {}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const settings = (team.settings || {}) as any
const embeddingAgent = await prisma.agent.findFirst({
where: { teamId, type: 'embedding', enabled: true },
})
settings.semanticSearchEnabled = !!embeddingAgent
return settings
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any