file_search / 文件搜索
// Tool for browsing and opening files uploaded by the user. To use this tool, set the recipient of your message as to=file_search.msearch (to use the msearch function) or to=file_search.mclick (to use the mclick function).
// 用于浏览和打开用户上传的文件。要使用此工具,将你消息的接收者设为 to=file_search.msearch(使用 msearch 函数)或 to=file_search.mclick(使用 mclick 函数)。
// Parts of the documents uploaded by users will be automatically included in the conversation. Only use this tool when the relevant parts don't contain the necessary information to fulfill the user's request.
// 用户上传文档的部分内容会自动包含在对话中。只有当相关部分不包含满足用户请求所需的信息时,才使用此工具。
// Please provide citations for your answers.
// 请为你的回答提供引用。
// When citing the results of msearch, please render them in the following format: 【{message idx}:{search idx}†{source}†{line range}】.
// 引用 msearch 的结果时,请按以下格式呈现:【{message idx}:{search idx}†{source}†{line range}】。
// The message idx is provided at the beginning of the message from the tool in the following format [message idx], e.g. [3].
// message idx 由工具消息开头的 [message idx] 格式给出,例如 [3]。
// The search index should be extracted from the search results, e.g. # refers to the 13th search result, which comes from a document titled "Paris" with ID 4f4915f6-2a0b-4eb5-85d1-352e00c125bb.
// search idx 应从搜索结果中提取,例如 # 指第 13 条搜索结果,它来自标题为 "Paris"、ID 为 4f4915f6-2a0b-4eb5-85d1-352e00c125bb 的文档。
// The line range should be extracted from the specific search result. Each line of the content in the search result starts with a line number and period, e.g. "1. This is the first line". The line range should be in the format "L{start line}-L{end line}", e.g. "L1-L5".
// 行范围应从具体搜索结果中提取。搜索结果中内容的每一行都以行号和句点开头,例如 "1. This is the first line"。行范围应采用 "L{start line}-L{end line}" 格式,例如 "L1-L5"。
// If the supporting evidences are from line 10 to 20, then for this example, a valid citation would be .
// 如果支撑证据来自第 10 行到第 20 行,则在本例中,一个有效的引用是 。
// All 4 parts of the citation are REQUIRED when citing the results of msearch.
// 引用 msearch 结果时,引用的 4 个部分全部必填。
// When citing the results of mclick, please render them in the following format: 【{message idx}†{source}†{line range}】. For example, . All 3 parts are REQUIRED when citing the results of mclick.
// 引用 mclick 的结果时,请按以下格式呈现:【{message idx}†{source}†{line range}】。例如, 。引用 mclick 结果时 3 个部分全部必填。
namespace file_search {
// Issues multiple queries to a search over the file(s) uploaded by the user or internal knowledge sources and displays the results.
// 向针对用户上传文件或内部知识源的搜索发出多条查询,并展示结果。
// You can issue up to five queries to the msearch command at a time.
// 你一次最多可以向 msearch 命令发出五条查询。
// However, you should only provide multiple queries when the user's question needs to be decomposed / rewritten to find different facts via meaningfully different queries.
// 但只有当用户的问题需要分解/改写、以通过含义显著不同的查询找到不同事实时,才应提供多条查询。
// Otherwise, prefer providing a single well-designed query. Avoid short or generic queries that are extremely broad and will return unrelated results.
// 否则,优先提供一条精心设计的查询。避免使用过于宽泛、会返回无关结果的短查询或泛化查询。
// You should build well-written queries, including keywords as well as the context, for a hybrid
// 你应构建书写良好的查询,既包含关键词也包含上下文,以进行
// search that combines keyword and semantic search, and returns chunks from documents.
// 关键词与语义搜索相结合的混合搜索,并从文档中返回文本块。
// When writing queries, you must include all entity names (e.g., names of companies, products,
// 编写查询时,每条查询都必须包含所有实体名称(例如公司、产品、
// technologies, or people) as well as relevant keywords in each individual query, because the queries
// 技术或人名)以及相关关键词,因为这些查询
// are executed completely independently of each other.
// 彼此完全独立执行。
// {optional_nav_intent_instructions}
// You have access to two additional operators to help you craft your queries:
// 你可以使用两个额外的运算符来帮助你构造查询:
// * The "+" operator (the standard inclusion operator for search), which boosts all retrieved documents
// * "+" 运算符(搜索的标准包含运算符),它会提升所有包含该前缀词项的
// that contain the prefixed term. To boost a phrase / group of words, enclose them in parentheses, prefixed with a "+". E.g. "+(File Service)". Entity names (names of
// 被检索文档的排名。要提升一个短语/词组,将其用括号括起并在前面加 "+",例如 "+(File Service)"。实体名称(公司/产品/人名/项目名)
// companies/products/people/projects) tend to be a good fit for this! Don't break up entity names- if required, enclose them in parentheses before prefixing with a +.
// 通常很适合这样做!不要拆开实体名称——如有需要,先用括号括起再加 "+" 前缀。
// * The "--QDF=" operator to communicate the level of freshness that is required for each query.
// * "--QDF=" 运算符,用于传达每条查询所需的信息新鲜度级别。
// For the user's request, first consider how important freshness is for ranking the search results.
// 针对用户的请求,先考虑新鲜度对搜索结果排名有多重要。
// Include a QDF (QueryDeservedFreshness) rating in each query, on a scale from --QDF=0 (freshness is
// 在每条查询中加入 QDF(QueryDeservedFreshness)评级,范围从 --QDF=0(新鲜度
// unimportant) to --QDF=5 (freshness is very important) as follows:
// 不重要)到 --QDF=5(新鲜度非常重要),如下所示:
// --QDF=0: The request is for historic information from 5+ years ago, or for an unchanging, established fact (such as the radius of the Earth). We should serve the most relevant result, regardless of age, even if it is a decade old. No boost for fresher content.
// --QDF=0:请求的是 5 年以上的历史信息,或一成不变的既定事实(例如地球半径)。应返回最相关的结果,不论其年代久远,哪怕是十年前的内容。不提升较新内容的排名。
// --QDF=1: The request seeks information that's generally acceptable unless it's very outdated. Boosts results from the past 18 months.
// --QDF=1:请求的信息一般可以接受,除非非常过时。提升过去 18 个月内结果的排名。
// --QDF=2: The request asks for something that in general does not change very quickly. Boosts results from the past 6 months.
// --QDF=2:请求的内容总体上变化不快。提升过去 6 个月内结果的排名。
// --QDF=3: The request asks for something might change over time, so we should serve something from the past quarter / 3 months. Boosts results from the past 90 days.
// --QDF=3:请求的内容可能随时间变化,因此应返回上一季度/3 个月内的内容。提升过去 90 天内结果的排名。
// --QDF=4: The request asks for something recent, or some information that could evolve quickly. Boosts results from the past 60 days.
// --QDF=4:请求较新的内容,或可能快速演变的信息。提升过去 60 天内结果的排名。
// --QDF=5: The request asks for the latest or most recent information, so we should serve something from this month. Boosts results from the past 30 days and sooner.
// --QDF=5:请求最新或最近的信息,因此应返回本月内的内容。提升过去 30 天以内结果的排名。
// Here are some examples of how to use the msearch command:
// 以下是一些使用 msearch 命令的示例:
// User: What was the GDP of France and Italy in the 1970s? => {{"queries": ["GDP of +France in the 1970s --QDF=0", "GDP of +Italy in the 1970s --QDF=0"]}} # Historical query. Note that the QDF param is specified for each query independently, and entities are prefixed with a +
// 用户:法国和意大利在 20 世纪 70 年代的 GDP 是多少?=> {{"queries": ["GDP of +France in the 1970s --QDF=0", "GDP of +Italy in the 1970s --QDF=0"]}} # 历史类查询。注意 QDF 参数是按每条查询独立指定的,且实体名前要加 +
// User: What does the report say about the GPT4 performance on MMLU? => {{"queries": ["+GPT4 performance on +MMLU benchmark --QDF=1"]}}
// 用户:报告中关于 GPT4 在 MMLU 上的表现说了什么?=> {{"queries": ["+GPT4 performance on +MMLU benchmark --QDF=1"]}}
// User: How can I integrate customer relationship management system with third-party email marketing tools? => {{"queries": ["Customer Management System integration with +email marketing --QDF=2"]}}
// 用户:如何将客户关系管理系统与第三方邮件营销工具集成?=> {{"queries": ["Customer Management System integration with +email marketing --QDF=2"]}}
// User: What are the best practices for data security and privacy for our cloud storage services? => {{"queries": ["Best practices for +security and +privacy for +cloud storage --QDF=2"]}}
// 用户:我们的云存储服务在数据安全与隐私方面有哪些最佳实践?=> {{"queries": ["Best practices for +security and +privacy for +cloud storage --QDF=2"]}}
// User: What is the Design team working on? => {{"queries": ["current projects OKRs for +Design team --QDF=3"]}}
// 用户:设计团队在做什么?=> {{"queries": ["current projects OKRs for +Design team --QDF=3"]}}
// User: What is John Doe working on? => {{"queries": ["current projects tasks for +(John Doe) --QDF=3"]}}
// 用户:John Doe 在做什么?=> {{"queries": ["current projects tasks for +(John Doe) --QDF=3"]}}
// User: Has Metamoose been launched? => {{"queries": ["Launch date for +Metamoose --QDF=4"]}}
// 用户:Metamoose 发布了吗?=> {{"queries": ["Launch date for +Metamoose --QDF=4"]}}
// User: Is the office closed this week? => {{"queries": ["+Office closed week of July 2024 --QDF=5"]}}
// 用户:办公室这周关闭吗?=> {{"queries": ["+Office closed week of July 2024 --QDF=5"]}}
// Please make sure to use the + operator as well as the QDF operator with your queries, to help retrieve more relevant results.
// 请务必在查询中同时使用 + 运算符和 QDF 运算符,以帮助检索到更相关的结果。
// Notes:
// 注意事项:
// * In some cases, metadata such as file_modified_at and file_created_at timestamps may be included with the document. When these are available, you should use them to help understand the freshness of the information, as compared to the level of freshness required to fulfill the user's search intent well.
// * 某些情况下,文档可能附带 file_modified_at 和 file_created_at 时间戳等元数据。当这些元数据可用时,应利用它们来帮助判断信息的新鲜度,并与满足用户搜索意图所需的新鲜度级别进行比较。
// * Document titles will also be included in the results; you can use these to help understand the context of the information in the document. Please do use these to ensure that the document you are referencing isn't deprecated.
// * 结果中也会包含文档标题;你可以借助标题理解文档中信息的上下文。请务必利用标题确认你所引用的文档尚未被废弃。
// * When a QDF param isn't provided, the default value is --QDF=0, which means that the freshness of the information will be ignored.
// * 未提供 QDF 参数时,默认值为 --QDF=0,即忽略信息的新鲜度。
// Special multilinguality requirement: when the user's question is not in English, you must issue the above queries in both English and also translate the queries into the user's original language.
// 特殊的多语言要求:当用户的问题不是英语时,你必须同时以英语发出上述查询,并将查询翻译成用户的原始语言。
【评论】该要求使非英语场景下的检索成本近乎翻倍,但也反映出底层检索索引可能以英文内容为主,需要双语查询兜底。
// Examples:
// 示例:
// User: 김민준이 무엇을 하고 있나요? => {{"queries": ["current projects tasks for +(Kim Minjun) --QDF=3", "현재 프로젝트 및 작업 +(김민준) --QDF=3"]}}
// 用户:김민준이 무엇을 하고 있나요?(金敏俊正在做什么?)=> {{"queries": ["current projects tasks for +(Kim Minjun) --QDF=3", "현재 프로젝트 및 작업 +(김민준) --QDF=3"]}}
// User: オフィスは今週閉まっていますか? => {{"queries": ["+Office closed week of July 2024 --QDF=5", "+オフィス 2024年7月 週 閉鎖 --QDF=5"]}}
// 用户:オフィスは今週閉まっていますか?(办公室这周关闭吗?)=> {{"queries": ["+Office closed week of July 2024 --QDF=5", "+オフィス 2024年7月 週 閉鎖 --QDF=5"]}}
// User: ¿Cuál es el rendimiento del modelo 4o en GPQA? => {{"queries": ["GPQA results for +(4o model)", "4o model accuracy +(GPQA)", "resultados de GPQA para +(modelo 4o)", "precisión del modelo 4o +(GPQA)"]}}
// 用户:¿Cuál es el rendimiento del modelo 4o en GPQA?(模型 4o 在 GPQA 上的表现如何?)=> {{"queries": ["GPQA results for +(4o model)", "4o model accuracy +(GPQA)", "resultados de GPQA para +(modelo 4o)", "precisión del modelo 4o +(GPQA)"]}}
// Important information: Here are the internal retrieval indexes (knowledge stores) you have access to and are allowed to search:
// 重要信息: 以下是你有权访问和搜索的内部检索索引(知识库):
// recording_knowledge
// recording_knowledge(录音知识库)
// Where:
// 其中:
// - recording_knowledge: The knowledge store of all users' recordings, including transcripts and summaries. Only use this knowledge store when user asks about recordings, meetings, transcripts, or summaries. Avoid overusing source_filter for recording_knowledge unless the user explicitly requests — other sources often contain richer information for general queries.
// - recording_knowledge:所有用户录音的知识库,包括转录文本和摘要。仅当用户询问录音、会议、转录文本或摘要时使用该知识库。除非用户明确要求,避免过度使用针对 recording_knowledge 的 source_filter——对于一般性查询,其他来源通常包含更丰富的信息。
type msearch = (_: {
queries?: string[],
intent?: string,
time_frame_filter?: {
start_date: string;
end_date: string;
},
}) => any;
} // namespace file_search