mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 23:26:30 +08:00
feat(server): update tool descriptions and AI prompt (#13032)
update tools description & chat prompt <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Updated the AFFiNE AI copilot system prompt to reflect support for multiple AI providers and a more concise, structured format with clearer guidelines and modular tags. * **Enhancements** * Improved descriptions for document search and reading tools, providing clearer guidance on when and how to use keyword search, semantic search, and document reading features. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -39,7 +39,7 @@ export const createDocKeywordSearchTool = (
|
||||
) => {
|
||||
return tool({
|
||||
description:
|
||||
'Full-text search for relevant documents in the current workspace',
|
||||
'Search all workspace documents for the exact keyword or phrase supplied and return passages ranked by textual match. Use this tool by default whenever a straightforward term-based lookup is sufficient.',
|
||||
parameters: z.object({
|
||||
query: z.string().describe('The query to search for'),
|
||||
}),
|
||||
|
||||
@@ -72,7 +72,8 @@ export const createDocReadTool = (
|
||||
getDoc: (targetId?: string) => Promise<object | undefined>
|
||||
) => {
|
||||
return tool({
|
||||
description: 'Read the content of a doc in the current workspace',
|
||||
description:
|
||||
'Return the complete text and basic metadata of a single document identified by docId; use this when the user needs the full content of a specific file rather than a search result.',
|
||||
parameters: z.object({
|
||||
doc_id: z.string().describe('The target doc to read'),
|
||||
}),
|
||||
|
||||
@@ -56,7 +56,7 @@ export const createDocSemanticSearchTool = (
|
||||
) => {
|
||||
return tool({
|
||||
description:
|
||||
'Semantic search for relevant documents in the current workspace',
|
||||
'Retrieve conceptually related passages by performing vector-based semantic similarity search across embedded documents; call this tool only when exact keyword search fails or the user explicitly needs meaning-level matches (e.g., paraphrases, synonyms, broader concepts).',
|
||||
parameters: z.object({
|
||||
query: z
|
||||
.string()
|
||||
|
||||
Reference in New Issue
Block a user