mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-04-26 06:03:21 +08:00
feat: 精简部分工具的搜索参数以节省token
This commit is contained in:
@@ -58,17 +58,13 @@ function getLockedPromptSection(
|
|||||||
: ''
|
: ''
|
||||||
|
|
||||||
const year = now.getFullYear()
|
const year = now.getFullYear()
|
||||||
const prevYear = year - 1
|
|
||||||
|
|
||||||
return `${agentT('ai.agent.currentDateIs', locale)} ${currentDate}。
|
return `${agentT('ai.agent.currentDateIs', locale)} ${currentDate}。
|
||||||
${ownerNote}
|
${ownerNote}
|
||||||
${mentionedMembersNote}
|
${mentionedMembersNote}
|
||||||
${memberNote}
|
${memberNote}
|
||||||
${agentT('ai.agent.timeParamsIntro', locale)}
|
${agentT('ai.agent.timeParamsIntro', locale)}
|
||||||
- ${agentT('ai.agent.timeParamExample1', locale, { year })}
|
${agentT('ai.agent.defaultYearNote', locale, { year })}
|
||||||
- ${agentT('ai.agent.timeParamExample2', locale, { year })}
|
|
||||||
- ${agentT('ai.agent.timeParamExample3', locale, { year })}
|
|
||||||
${agentT('ai.agent.defaultYearNote', locale, { year, prevYear })}
|
|
||||||
|
|
||||||
${agentT('ai.agent.responseInstruction', locale)}`
|
${agentT('ai.agent.responseInstruction', locale)}`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ import type { ToolContext } from '../types'
|
|||||||
import * as workerManager from '../../../worker/workerManager'
|
import * as workerManager from '../../../worker/workerManager'
|
||||||
import { parseExtendedTimeParams } from '../utils/time-params'
|
import { parseExtendedTimeParams } from '../utils/time-params'
|
||||||
import { formatTimeRange, isChineseLocale } from '../utils/format'
|
import { formatTimeRange, isChineseLocale } from '../utils/format'
|
||||||
import { timeParamPropertiesNoHour } from '../utils/schemas'
|
import { timeParamProperties } from '../utils/schemas'
|
||||||
|
|
||||||
const schema = Type.Object({
|
const schema = Type.Object({
|
||||||
keywords: Type.Optional(Type.Array(Type.String(), { description: 'ai.tools.get_session_summaries.params.keywords' })),
|
keywords: Type.Optional(Type.Array(Type.String(), { description: 'ai.tools.get_session_summaries.params.keywords' })),
|
||||||
limit: Type.Optional(Type.Number({ description: 'ai.tools.get_session_summaries.params.limit' })),
|
limit: Type.Optional(Type.Number({ description: 'ai.tools.get_session_summaries.params.limit' })),
|
||||||
...timeParamPropertiesNoHour,
|
...timeParamProperties,
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 获取会话摘要列表,快速了解群聊历史讨论的主题。适用场景:1. 了解群里最近在聊什么话题 2. 按关键词搜索讨论过的话题 3. 概览性问题如"群里有没有讨论过旅游"。返回的摘要是对每个会话的简短总结,可以帮助快速定位感兴趣的会话,然后用 get_session_messages 获取详情。 */
|
/** 获取会话摘要列表,快速了解群聊历史讨论的主题。适用场景:1. 了解群里最近在聊什么话题 2. 按关键词搜索讨论过的话题 3. 概览性问题如"群里有没有讨论过旅游"。返回的摘要是对每个会话的简短总结,可以帮助快速定位感兴趣的会话,然后用 get_session_messages 获取详情。 */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Type } from '@mariozechner/pi-ai'
|
import { Type } from '@mariozechner/pi-ai'
|
||||||
import type { AgentTool } from '@mariozechner/pi-agent-core'
|
import type { AgentTool } from '@mariozechner/pi-agent-core'
|
||||||
import type { ToolContext } from '../types'
|
import type { ToolContext } from '../types'
|
||||||
import { timeParamPropertiesNoHour } from '../utils/schemas'
|
import { timeParamProperties } from '../utils/schemas'
|
||||||
import * as workerManager from '../../../worker/workerManager'
|
import * as workerManager from '../../../worker/workerManager'
|
||||||
import { parseExtendedTimeParams } from '../utils/time-params'
|
import { parseExtendedTimeParams } from '../utils/time-params'
|
||||||
import { formatTimeRange, formatMessageCompact, isChineseLocale } from '../utils/format'
|
import { formatTimeRange, formatMessageCompact, isChineseLocale } from '../utils/format'
|
||||||
@@ -9,7 +9,7 @@ import { formatTimeRange, formatMessageCompact, isChineseLocale } from '../utils
|
|||||||
const schema = Type.Object({
|
const schema = Type.Object({
|
||||||
keywords: Type.Optional(Type.Array(Type.String(), { description: 'ai.tools.search_sessions.params.keywords' })),
|
keywords: Type.Optional(Type.Array(Type.String(), { description: 'ai.tools.search_sessions.params.keywords' })),
|
||||||
limit: Type.Optional(Type.Number({ description: 'ai.tools.search_sessions.params.limit' })),
|
limit: Type.Optional(Type.Number({ description: 'ai.tools.search_sessions.params.limit' })),
|
||||||
...timeParamPropertiesNoHour,
|
...timeParamProperties,
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 搜索聊天会话(对话段落)。会话是根据消息时间间隔自动切分的对话单元。适用于查找特定话题的讨论、了解某个时间段内发生了几次对话等场景。返回匹配的会话列表及每个会话的前5条消息预览。 */
|
/** 搜索聊天会话(对话段落)。会话是根据消息时间间隔自动切分的对话单元。适用于查找特定话题的讨论、了解某个时间段内发生了几次对话等场景。返回匹配的会话列表及每个会话的前5条消息预览。 */
|
||||||
|
|||||||
@@ -6,18 +6,6 @@
|
|||||||
import { Type } from '@mariozechner/pi-ai'
|
import { Type } from '@mariozechner/pi-ai'
|
||||||
|
|
||||||
export const timeParamProperties = {
|
export const timeParamProperties = {
|
||||||
year: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.year' })),
|
|
||||||
month: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.month' })),
|
|
||||||
day: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.day' })),
|
|
||||||
hour: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.hour' })),
|
|
||||||
start_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.start_time' })),
|
|
||||||
end_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.end_time' })),
|
|
||||||
}
|
|
||||||
|
|
||||||
export const timeParamPropertiesNoHour = {
|
|
||||||
year: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.year' })),
|
|
||||||
month: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.month' })),
|
|
||||||
day: Type.Optional(Type.Number({ description: 'ai.tools._shared.params.day' })),
|
|
||||||
start_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.start_time' })),
|
start_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.start_time' })),
|
||||||
end_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.end_time' })),
|
end_time: Type.Optional(Type.String({ description: 'ai.tools._shared.params.end_time' })),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export interface ExtendedTimeParams {
|
export interface ExtendedTimeParams {
|
||||||
year?: number
|
|
||||||
month?: number
|
|
||||||
day?: number
|
|
||||||
hour?: number
|
|
||||||
start_time?: string // 格式: "YYYY-MM-DD HH:mm"
|
start_time?: string // 格式: "YYYY-MM-DD HH:mm"
|
||||||
end_time?: string // 格式: "YYYY-MM-DD HH:mm"
|
end_time?: string // 格式: "YYYY-MM-DD HH:mm"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 解析扩展的时间参数,返回时间过滤器
|
* 解析时间参数,返回时间过滤器
|
||||||
* 优先级: start_time/end_time > year/month/day/hour 组合 > context.timeFilter
|
* 优先级: start_time/end_time > context.timeFilter
|
||||||
*/
|
*/
|
||||||
export function parseExtendedTimeParams(
|
export function parseExtendedTimeParams(
|
||||||
params: ExtendedTimeParams,
|
params: ExtendedTimeParams,
|
||||||
@@ -45,34 +41,5 @@ export function parseExtendedTimeParams(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params.year) {
|
|
||||||
const year = params.year
|
|
||||||
const month = params.month
|
|
||||||
const day = params.day
|
|
||||||
const hour = params.hour
|
|
||||||
|
|
||||||
let startDate: Date
|
|
||||||
let endDate: Date
|
|
||||||
|
|
||||||
if (month && day && hour !== undefined) {
|
|
||||||
startDate = new Date(year, month - 1, day, hour, 0, 0)
|
|
||||||
endDate = new Date(year, month - 1, day, hour, 59, 59)
|
|
||||||
} else if (month && day) {
|
|
||||||
startDate = new Date(year, month - 1, day, 0, 0, 0)
|
|
||||||
endDate = new Date(year, month - 1, day, 23, 59, 59)
|
|
||||||
} else if (month) {
|
|
||||||
startDate = new Date(year, month - 1, 1)
|
|
||||||
endDate = new Date(year, month, 0, 23, 59, 59)
|
|
||||||
} else {
|
|
||||||
startDate = new Date(year, 0, 1)
|
|
||||||
endDate = new Date(year, 11, 31, 23, 59, 59)
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
startTs: Math.floor(startDate.getTime() / 1000),
|
|
||||||
endTs: Math.floor(endDate.getTime() / 1000),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return contextTimeFilter
|
return contextTimeFilter
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,10 +139,6 @@ export default {
|
|||||||
member_id_1: 'Database ID of the first member',
|
member_id_1: 'Database ID of the first member',
|
||||||
member_id_2: 'Database ID of the second member',
|
member_id_2: 'Database ID of the second member',
|
||||||
limit: 'Message count limit, default 100',
|
limit: 'Message count limit, default 100',
|
||||||
year: 'Filter messages by year',
|
|
||||||
month: 'Filter messages by month (1-12), use with year',
|
|
||||||
day: 'Filter messages by day (1-31), use with year and month',
|
|
||||||
hour: 'Filter messages by hour (0-23), use with year, month, and day',
|
|
||||||
start_time:
|
start_time:
|
||||||
'Start time, format "YYYY-MM-DD HH:mm", e.g. "2024-03-15 14:00". Overrides year/month/day/hour when specified',
|
'Start time, format "YYYY-MM-DD HH:mm", e.g. "2024-03-15 14:00". Overrides year/month/day/hour when specified',
|
||||||
end_time:
|
end_time:
|
||||||
@@ -336,12 +332,8 @@ Returned summaries are brief descriptions of each session, helping quickly locat
|
|||||||
`,
|
`,
|
||||||
mentionedMembersNote:
|
mentionedMembersNote:
|
||||||
'Members explicitly @-selected by the user in this round (member_id can be used directly without another search):',
|
'Members explicitly @-selected by the user in this round (member_id can be used directly without another search):',
|
||||||
timeParamsIntro: 'Time parameters: combine year/month/day/hour based on user mention',
|
timeParamsIntro: 'Time parameters: use start_time/end_time to specify the range, format "YYYY-MM-DD HH:mm"',
|
||||||
timeParamExample1: '"October" → year: {{year}}, month: 10',
|
defaultYearNote: 'When no time range is specified, queries default to all data. Current year is {{year}}.',
|
||||||
timeParamExample2: '"October 1st" → year: {{year}}, month: 10, day: 1',
|
|
||||||
timeParamExample3: '"October 1st 3 PM" → year: {{year}}, month: 10, day: 1, hour: 15',
|
|
||||||
defaultYearNote:
|
|
||||||
'If year is not specified, defaults to {{year}}. If the month has not yet occurred, {{prevYear}} is used.',
|
|
||||||
currentTask: 'Current Task',
|
currentTask: 'Current Task',
|
||||||
skillPriorityNote:
|
skillPriorityNote:
|
||||||
'Note: When executing this task, prioritize the output format requirements below. This can override your usual response style.',
|
'Note: When executing this task, prioritize the output format requirements below. This can override your usual response style.',
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ export default {
|
|||||||
deep_search_messages: {
|
deep_search_messages: {
|
||||||
desc: '完全部分文字列マッチでチャット履歴を検索する。速度は遅いが、キーワードを含むメッセージを漏らさない。通常の検索(search_messages)の結果が不十分な場合や、部分的な単語・単一文字を検索する場合に使用する。',
|
desc: '完全部分文字列マッチでチャット履歴を検索する。速度は遅いが、キーワードを含むメッセージを漏らさない。通常の検索(search_messages)の結果が不十分な場合や、部分的な単語・単一文字を検索する場合に使用する。',
|
||||||
params: {
|
params: {
|
||||||
keywords: '検索キーワードリスト。部分文字列マッチ(LIKE)を使用し、いずれかのキーワードにマッチしたメッセージを返す',
|
keywords:
|
||||||
|
'検索キーワードリスト。部分文字列マッチ(LIKE)を使用し、いずれかのキーワードにマッチしたメッセージを返す',
|
||||||
sender_id: '送信者のメンバー ID。特定メンバーの送信メッセージをフィルタリングする',
|
sender_id: '送信者のメンバー ID。特定メンバーの送信メッセージをフィルタリングする',
|
||||||
limit: '返却メッセージ数の上限。デフォルト 1000、最大 50000',
|
limit: '返却メッセージ数の上限。デフォルト 1000、最大 50000',
|
||||||
year: '指定年のメッセージをフィルタリング(例:2024)',
|
year: '指定年のメッセージをフィルタリング(例:2024)',
|
||||||
@@ -140,10 +141,6 @@ export default {
|
|||||||
member_id_1: '1人目のメンバーのデータベース ID',
|
member_id_1: '1人目のメンバーのデータベース ID',
|
||||||
member_id_2: '2人目のメンバーのデータベース ID',
|
member_id_2: '2人目のメンバーのデータベース ID',
|
||||||
limit: '返却メッセージ数の上限。デフォルト 100',
|
limit: '返却メッセージ数の上限。デフォルト 100',
|
||||||
year: '指定年のメッセージをフィルタリング',
|
|
||||||
month: '指定月のメッセージをフィルタリング(1-12)。year と併用する必要がある',
|
|
||||||
day: '指定日のメッセージをフィルタリング(1-31)。year と month と併用する必要がある',
|
|
||||||
hour: '指定時間のメッセージをフィルタリング(0-23)。year、month、day と併用する必要がある',
|
|
||||||
start_time:
|
start_time:
|
||||||
'開始時刻。形式 "YYYY-MM-DD HH:mm"(例:"2024-03-15 14:00")。指定すると year/month/day/hour パラメータを上書きする',
|
'開始時刻。形式 "YYYY-MM-DD HH:mm"(例:"2024-03-15 14:00")。指定すると year/month/day/hour パラメータを上書きする',
|
||||||
end_time:
|
end_time:
|
||||||
@@ -337,12 +334,8 @@ export default {
|
|||||||
`,
|
`,
|
||||||
mentionedMembersNote:
|
mentionedMembersNote:
|
||||||
'このラウンドでユーザーが明示的に @ 選択したメンバー(member_id を再検索なしで直接使えます):',
|
'このラウンドでユーザーが明示的に @ 選択したメンバー(member_id を再検索なしで直接使えます):',
|
||||||
timeParamsIntro: '時間パラメータ:ユーザーが言及した精度に応じて year/month/day/hour を組み合わせる',
|
timeParamsIntro: '時間パラメータ:start_time/end_time で範囲を指定。形式は "YYYY-MM-DD HH:mm"',
|
||||||
timeParamExample1: '"10月" → year: {{year}}, month: 10',
|
defaultYearNote: '時間範囲を指定しない場合は全期間が対象。現在の年は{{year}}年',
|
||||||
timeParamExample2: '"10月1日" → year: {{year}}, month: 10, day: 1',
|
|
||||||
timeParamExample3: '"10月1日午後3時" → year: {{year}}, month: 10, day: 1, hour: 15',
|
|
||||||
defaultYearNote:
|
|
||||||
'年が指定されていない場合はデフォルトで{{year}}年。該当月がまだ来ていない場合は{{prevYear}}年を使用する',
|
|
||||||
responseInstruction: 'ユーザーの質問に応じて適切なツールを選択してデータを取得し、データに基づいて回答する。',
|
responseInstruction: 'ユーザーの質問に応じて適切なツールを選択してデータを取得し、データに基づいて回答する。',
|
||||||
fallbackRoleDefinition: {
|
fallbackRoleDefinition: {
|
||||||
group: `あなたはプロフェッショナルだがカジュアルなスタイルのグループチャット履歴分析アシスタントです。
|
group: `あなたはプロフェッショナルだがカジュアルなスタイルのグループチャット履歴分析アシスタントです。
|
||||||
|
|||||||
@@ -61,12 +61,8 @@ export default {
|
|||||||
keywords: '搜索关键词列表,会用 OR 逻辑匹配包含任一关键词的消息。如果只需要按发送者筛选,可以传空数组 []',
|
keywords: '搜索关键词列表,会用 OR 逻辑匹配包含任一关键词的消息。如果只需要按发送者筛选,可以传空数组 []',
|
||||||
sender_id: '发送者的成员 ID,用于筛选特定成员发送的消息。可以通过 get_members 工具获取成员 ID',
|
sender_id: '发送者的成员 ID,用于筛选特定成员发送的消息。可以通过 get_members 工具获取成员 ID',
|
||||||
limit: '返回消息数量限制,默认 1000,最大 50000',
|
limit: '返回消息数量限制,默认 1000,最大 50000',
|
||||||
year: '筛选指定年份的消息,如 2024',
|
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
||||||
month: '筛选指定月份的消息(1-12),需要配合 year 使用',
|
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
||||||
day: '筛选指定日期的消息(1-31),需要配合 year 和 month 使用',
|
|
||||||
hour: '筛选指定小时的消息(0-23),需要配合 year、month 和 day 使用',
|
|
||||||
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
deep_search_messages: {
|
deep_search_messages: {
|
||||||
@@ -75,24 +71,16 @@ export default {
|
|||||||
keywords: '搜索关键词列表,使用子串匹配(LIKE),任一关键词匹配即返回',
|
keywords: '搜索关键词列表,使用子串匹配(LIKE),任一关键词匹配即返回',
|
||||||
sender_id: '发送者的成员 ID,用于筛选特定成员发送的消息',
|
sender_id: '发送者的成员 ID,用于筛选特定成员发送的消息',
|
||||||
limit: '返回消息数量限制,默认 1000,最大 50000',
|
limit: '返回消息数量限制,默认 1000,最大 50000',
|
||||||
year: '筛选指定年份的消息,如 2024',
|
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
||||||
month: '筛选指定月份的消息(1-12),需要配合 year 使用',
|
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
||||||
day: '筛选指定日期的消息(1-31),需要配合 year 和 month 使用',
|
|
||||||
hour: '筛选指定小时的消息(0-23),需要配合 year、month 和 day 使用',
|
|
||||||
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
get_recent_messages: {
|
get_recent_messages: {
|
||||||
desc: '获取指定时间段内的群聊消息。适用于回答"最近大家聊了什么"、"X月群里聊了什么"等概览性问题。支持精确到分钟级别的时间查询。',
|
desc: '获取指定时间段内的群聊消息。适用于回答"最近大家聊了什么"、"X月群里聊了什么"等概览性问题。支持精确到分钟级别的时间查询。',
|
||||||
params: {
|
params: {
|
||||||
limit: '返回消息数量限制,默认 100(节省 token,可根据需要增加)',
|
limit: '返回消息数量限制,默认 100(节省 token,可根据需要增加)',
|
||||||
year: '筛选指定年份的消息,如 2024',
|
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
||||||
month: '筛选指定月份的消息(1-12),需要配合 year 使用',
|
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
||||||
day: '筛选指定日期的消息(1-31),需要配合 year 和 month 使用',
|
|
||||||
hour: '筛选指定小时的消息(0-23),需要配合 year、month 和 day 使用',
|
|
||||||
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
get_chat_overview: {
|
get_chat_overview: {
|
||||||
@@ -132,12 +120,8 @@ export default {
|
|||||||
member_id_1: '第一个成员的数据库 ID',
|
member_id_1: '第一个成员的数据库 ID',
|
||||||
member_id_2: '第二个成员的数据库 ID',
|
member_id_2: '第二个成员的数据库 ID',
|
||||||
limit: '返回消息数量限制,默认 100',
|
limit: '返回消息数量限制,默认 100',
|
||||||
year: '筛选指定年份的消息',
|
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
||||||
month: '筛选指定月份的消息(1-12),需要配合 year 使用',
|
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
||||||
day: '筛选指定日期的消息(1-31),需要配合 year 和 month 使用',
|
|
||||||
hour: '筛选指定小时的消息(0-23),需要配合 year、month 和 day 使用',
|
|
||||||
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"。指定后会覆盖 year/month/day/hour 参数',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
get_message_context: {
|
get_message_context: {
|
||||||
@@ -153,9 +137,6 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
keywords: '可选的搜索关键词列表,只返回包含这些关键词的会话(OR 逻辑匹配)',
|
keywords: '可选的搜索关键词列表,只返回包含这些关键词的会话(OR 逻辑匹配)',
|
||||||
limit: '返回会话数量限制,默认 20',
|
limit: '返回会话数量限制,默认 20',
|
||||||
year: '筛选指定年份的会话,如 2024',
|
|
||||||
month: '筛选指定月份的会话(1-12),需要配合 year 使用',
|
|
||||||
day: '筛选指定日期的会话(1-31),需要配合 year 和 month 使用',
|
|
||||||
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
||||||
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
||||||
},
|
},
|
||||||
@@ -179,11 +160,8 @@ export default {
|
|||||||
params: {
|
params: {
|
||||||
keywords: '在摘要中搜索的关键词列表(OR 逻辑匹配)',
|
keywords: '在摘要中搜索的关键词列表(OR 逻辑匹配)',
|
||||||
limit: '返回会话数量限制,默认 20',
|
limit: '返回会话数量限制,默认 20',
|
||||||
year: '筛选指定年份的会话',
|
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"',
|
||||||
month: '筛选指定月份的会话(1-12)',
|
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"',
|
||||||
day: '筛选指定日期的会话(1-31)',
|
|
||||||
start_time: '开始时间,格式 "YYYY-MM-DD HH:mm"',
|
|
||||||
end_time: '结束时间,格式 "YYYY-MM-DD HH:mm"',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// ===== SQL 分析工具 =====
|
// ===== SQL 分析工具 =====
|
||||||
@@ -326,11 +304,8 @@ export default {
|
|||||||
- 找到成员后,使用其 id 字段作为 search_messages 的 sender_id 参数来获取该成员的发言
|
- 找到成员后,使用其 id 字段作为 search_messages 的 sender_id 参数来获取该成员的发言
|
||||||
`,
|
`,
|
||||||
mentionedMembersNote: '本轮用户显式 @ 的成员(可直接使用 member_id,无需再次搜索):',
|
mentionedMembersNote: '本轮用户显式 @ 的成员(可直接使用 member_id,无需再次搜索):',
|
||||||
timeParamsIntro: '时间参数:按用户提到的精度组合 year/month/day/hour',
|
timeParamsIntro: '时间参数:使用 start_time/end_time 指定时间范围,格式 "YYYY-MM-DD HH:mm"',
|
||||||
timeParamExample1: '"10月" → year: {{year}}, month: 10',
|
defaultYearNote: '未指定时间范围时默认查询全部。当前年份为{{year}}年',
|
||||||
timeParamExample2: '"10月1号" → year: {{year}}, month: 10, day: 1',
|
|
||||||
timeParamExample3: '"10月1号下午3点" → year: {{year}}, month: 10, day: 1, hour: 15',
|
|
||||||
defaultYearNote: '未指定年份默认{{year}}年,若该月份未到则用{{prevYear}}年',
|
|
||||||
currentTask: '当前任务',
|
currentTask: '当前任务',
|
||||||
skillPriorityNote: '注意:在执行此任务时,请优先遵循以下任务的输出格式要求,这可以覆盖你的常规回复习惯。',
|
skillPriorityNote: '注意:在执行此任务时,请优先遵循以下任务的输出格式要求,这可以覆盖你的常规回复习惯。',
|
||||||
responseInstruction: '根据用户的问题,选择合适的工具获取数据,然后基于数据给出回答。',
|
responseInstruction: '根据用户的问题,选择合适的工具获取数据,然后基于数据给出回答。',
|
||||||
|
|||||||
@@ -132,10 +132,6 @@ export default {
|
|||||||
member_id_1: '第一個成員的資料庫 ID',
|
member_id_1: '第一個成員的資料庫 ID',
|
||||||
member_id_2: '第二個成員的資料庫 ID',
|
member_id_2: '第二個成員的資料庫 ID',
|
||||||
limit: '回傳訊息數量限制,預設 100',
|
limit: '回傳訊息數量限制,預設 100',
|
||||||
year: '篩選指定年份的訊息',
|
|
||||||
month: '篩選指定月份的訊息(1-12),需要配合 year 使用',
|
|
||||||
day: '篩選指定日期的訊息(1-31),需要配合 year 和 month 使用',
|
|
||||||
hour: '篩選指定小時的訊息(0-23),需要配合 year、month 和 day 使用',
|
|
||||||
start_time: '開始時間,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"。指定後會覆蓋 year/month/day/hour 參數',
|
start_time: '開始時間,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 14:00"。指定後會覆蓋 year/month/day/hour 參數',
|
||||||
end_time: '結束時間,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"。指定後會覆蓋 year/month/day/hour 參數',
|
end_time: '結束時間,格式 "YYYY-MM-DD HH:mm",如 "2024-03-15 18:30"。指定後會覆蓋 year/month/day/hour 參數',
|
||||||
},
|
},
|
||||||
@@ -326,11 +322,8 @@ export default {
|
|||||||
- 找到成員後,使用其 id 欄位作為 search_messages 的 sender_id 參數來取得該成員的發言
|
- 找到成員後,使用其 id 欄位作為 search_messages 的 sender_id 參數來取得該成員的發言
|
||||||
`,
|
`,
|
||||||
mentionedMembersNote: '本輪使用者顯式 @ 的成員(可直接使用 member_id,無需再次搜尋):',
|
mentionedMembersNote: '本輪使用者顯式 @ 的成員(可直接使用 member_id,無需再次搜尋):',
|
||||||
timeParamsIntro: '時間參數:按使用者提到的精度組合 year/month/day/hour',
|
timeParamsIntro: '時間參數:使用 start_time/end_time 指定時間範圍,格式 "YYYY-MM-DD HH:mm"',
|
||||||
timeParamExample1: '「10月」→ year: {{year}}, month: 10',
|
defaultYearNote: '未指定時間範圍時預設查詢全部。當前年份為{{year}}年',
|
||||||
timeParamExample2: '「10月1號」→ year: {{year}}, month: 10, day: 1',
|
|
||||||
timeParamExample3: '「10月1號下午3點」→ year: {{year}}, month: 10, day: 1, hour: 15',
|
|
||||||
defaultYearNote: '未指定年份預設{{year}}年,若該月份未到則用{{prevYear}}年',
|
|
||||||
responseInstruction: '根據使用者的問題,選擇合適的工具取得資料,然後基於資料給出回答。',
|
responseInstruction: '根據使用者的問題,選擇合適的工具取得資料,然後基於資料給出回答。',
|
||||||
fallbackRoleDefinition: {
|
fallbackRoleDefinition: {
|
||||||
group: `你是一個專業但風格輕鬆的群聊紀錄分析助手。
|
group: `你是一個專業但風格輕鬆的群聊紀錄分析助手。
|
||||||
|
|||||||
Reference in New Issue
Block a user