Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 31 additions & 29 deletions i18n/zh-CN/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "The title of the fallback page when the page crashed"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "回到顶部",
"message": "返回顶部",
"description": "The ARIA label for the back to top button"
},
"theme.blog.archive.title": {
Expand Down Expand Up @@ -32,31 +32,32 @@
"description": "The ARIA label for the blog posts pagination"
},
"theme.blog.post.paginator.newerPost": {
"message": "较新一篇",
"message": "下一篇",
"description": "The blog post button label to navigate to the newer/previous post"
},
"theme.blog.post.paginator.olderPost": {
"message": "较旧一篇",
"message": "上一篇",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.tags.tagsPageLink": {
"message": "查看所有标签",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel.mode.system": {
"message": "system mode",
"description": "The name for the system color mode"
},
"theme.colorToggle.ariaLabel.mode.system": {
"message": "跟随系统",
"description": "The name for the system color mode"
}
,
"theme.colorToggle.ariaLabel.mode.light": {
"message": "浅色模式",
"description": "The name for the light color mode"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "暗黑模式",
"message": "深色模式",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel": {
"message": "切换浅色/暗黑模式(当前为{mode})",
"message": "切换浅色/深色模式(当前为{mode})",
"description": "The ARIA label for the color mode toggle"
},
"theme.docs.DocCard.categoryDescription.plurals": {
Expand All @@ -68,7 +69,7 @@
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.paginator.navAriaLabel": {
"message": "文件选项卡",
"message": "文档导航",
"description": "The ARIA label for the docs pagination"
},
"theme.docs.paginator.previous": {
Expand All @@ -80,23 +81,23 @@
"description": "The label used to navigate to the next doc"
},
"theme.docs.tagDocListPageTitle.nDocsTagged": {
"message": "{count} 篇文档带有标签",
"message": "{count} 篇文档",
"description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.docs.tagDocListPageTitle": {
"message": "{nDocsTagged}「{tagName}」",
"message": "标签「{tagName}」 - {nDocsTagged}",
"description": "The title of the page for a docs tag"
},
"theme.docs.versions.unreleasedVersionLabel": {
"message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。",
"message": "这是 {siteTitle} {versionLabel} 版本的未发布文档。",
"description": "The label used to tell the user that he's browsing an unreleased doc version"
},
"theme.docs.versions.unmaintainedVersionLabel": {
"message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。",
"message": "这是 {siteTitle} {versionLabel} 版本的文档,已不再维护。",
"description": "The label used to tell the user that he's browsing an unmaintained doc version"
},
"theme.docs.versions.latestVersionSuggestionLabel": {
"message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。",
"message": "请查看最新文档 {latestVersionLink} ({versionLabel})。",
"description": "The label used to tell the user to check the latest version"
},
"theme.docs.versions.latestVersionLinkLabel": {
Expand All @@ -111,7 +112,7 @@
"description": "The link label to edit the current page"
},
"theme.common.headingLinkTitle": {
"message": "{heading}的直接链接",
"message": "{heading}的链接",
"description": "Title for link to heading"
},
"theme.lastUpdated.atDate": {
Expand Down Expand Up @@ -147,7 +148,7 @@
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.admonition.danger": {
"message": "危险",
"message": "风险",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
Expand Down Expand Up @@ -179,7 +180,7 @@
"description": "The ARIA label to collapse the sidebar category"
},
"theme.NavBar.navAriaLabel": {
"message": "主导航",
"message": "网站地图",
"description": "The ARIA label for the main navigation"
},
"theme.NotFound.p1": {
Expand All @@ -191,7 +192,7 @@
"description": "The 2nd paragraph of the 404 page"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "本页总览",
"message": "目录",
"description": "The label used by the button on the collapsible TOC component"
},
"theme.navbar.mobileLanguageDropdown.label": {
Expand Down Expand Up @@ -239,15 +240,15 @@
"description": "The ARIA label for the sidebar navigation"
},
"theme.docs.breadcrumbs.home": {
"message": "主页面",
"message": "主页",
"description": "The ARIA label for the home page in the breadcrumbs"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "关闭导航栏",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"message": "← 回到主菜单",
"message": "← 返回主菜单",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
Expand All @@ -263,19 +264,19 @@
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.navbar.mobileDropdown.collapseButton.expandAriaLabel": {
"message": "Expand the dropdown",
"message": "展开下拉菜单",
"description": "The ARIA label of the button to expand the mobile dropdown navbar item"
},
"theme.navbar.mobileDropdown.collapseButton.collapseAriaLabel": {
"message": "Collapse the dropdown",
"message": "折叠下拉菜单",
"description": "The ARIA label of the button to collapse the mobile dropdown navbar item"
},
"theme.SearchPage.existingResultsTitle": {
"message": "“{query}”的搜索结果",
"description": "The search page title for non-empty query"
},
"theme.SearchPage.emptyResultsTitle": {
"message": "搜索文档",
"message": "查找文档",
"description": "The search page title for empty query"
},
"theme.SearchPage.searchContext.everywhere": {
Expand All @@ -286,11 +287,11 @@
"description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.SearchPage.noResultsText": {
"message": "没有找到任何文档",
"message": "未找到任何文档",
"description": "The paragraph for empty search result"
},
"theme.SearchBar.noResultsText": {
"message": "没有找到任何文档"
"message": "未找到任何文档"
},
"theme.SearchBar.seeAllOutsideContext": {
"message": "查看“{context}”以外的全部结果"
Expand Down Expand Up @@ -330,11 +331,11 @@
"description": "The text for authors with 0 blog post"
},
"theme.contentVisibility.unlistedBanner.title": {
"message": "未列出页",
"message": "未公开页面",
"description": "The unlisted content banner title"
},
"theme.contentVisibility.unlistedBanner.message": {
"message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。",
"message": "此页面未公开。搜索引擎无法索引它,只有通过直接链接的用户才能访问。",
"description": "The unlisted content banner message"
},
"theme.contentVisibility.draftBanner.title": {
Expand All @@ -350,11 +351,12 @@
"description": "The label of the button to try again rendering when the React error boundary captures an error"
},
"theme.common.skipToMainContent": {
"message": "跳到主要内容",
"message": "跳转到主要内容",
"description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"
},
"theme.tags.tagsPageTitle": {
"message": "标签",
"description": "The title of the tag list page"
}
}

31 changes: 16 additions & 15 deletions i18n/zh-CN/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
{
"version.label": {
"message": "Next",
"message": "下一个",
"description": "The label for version current"
},
"sidebar.tutorialSidebar.category.Getting Started": {
"message": "Getting Started",
"message": "入门",
"description": "The label for category Getting Started in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Using Kilo Code": {
"message": "Using Kilo Code",
"message": "使用 Kilo Code",
"description": "The label for category Using Kilo Code in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Basic Features": {
"message": "Basic Features",
"message": "基本功能",
"description": "The label for category Basic Features in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Core Concepts": {
"message": "Core Concepts",
"message": "核心概念",
"description": "The label for category Core Concepts in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Advanced Usage": {
"message": "Advanced Usage",
"message": "高级用法",
"description": "The label for category Advanced Usage in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Customizing Kilo Code": {
"message": "Customizing Kilo Code",
"message": "自定义 Kilo Code",
"description": "The label for category Customizing Kilo Code in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Advanced Context Features": {
"message": "Advanced Context Features",
"message": "高级上下文功能",
"description": "The label for category Advanced Context Features in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Advanced AI Features": {
"message": "Advanced AI Features",
"message": "高级 AI 功能",
"description": "The label for category Advanced AI Features in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Customization": {
"message": "Customization",
"message": "自定义",
"description": "The label for category Customization in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Extending Kilo Code": {
"message": "Extending Kilo Code",
"message": "扩展 Kilo Code",
"description": "The label for category Extending Kilo Code in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Model Providers": {
"message": "Model Providers",
"message": "模型供应商",
"description": "The label for category Model Providers in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Model Context Protocol (MCP)": {
"message": "Model Context Protocol (MCP)",
"message": "模型上下文协议 (MCP)",
"description": "The label for category Model Context Protocol (MCP) in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.category.Tools Reference": {
"message": "Tools Reference",
"message": "工具参考",
"description": "The label for category Tools Reference in sidebar tutorialSidebar"
},
"sidebar.tutorialSidebar.doc.Setup": {
"message": "Setup",
"message": "设置",
"description": "The label for the doc item Setup in sidebar tutorialSidebar, linking to the doc getting-started/setting-up"
}
}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# codebase_search

:::warning 实验性功能
`codebase_search` 工具是实验性功能 [代码库索引](/features/codebase-indexing) 的一部分。该功能正在积极开发中,可能在未来的版本中有重大变化。它需要额外的设置,包括嵌入提供程序和向量数据库。
`codebase_search` 工具需要额外的设置,包括嵌入提供程序和向量数据库。
:::

`codebase_search` 工具使用 AI 嵌入在整个代码库中执行语义搜索。与传统的基于文本的搜索不同,它能理解查询的含义,即使没有完全匹配的关键字,也能找到相关的代码。
Expand Down Expand Up @@ -60,28 +60,33 @@
当调用 `codebase_search` 工具时,它会遵循以下过程:

1. **可用性验证**:

- 验证 CodeIndexManager 是否可用并已初始化
- 确认设置中已启用代码库索引
- 检查索引是否正确配置(API 密钥、Qdrant URL)
- 验证当前索引状态是否允许搜索

2. **查询处理**:

- 获取你的自然语言查询并生成嵌入向量
- 使用为索引配置的相同嵌入提供程序(OpenAI 或 Ollama)
- 将查询的语义转换为数学表示

3. **向量搜索执行**:

- 在 Qdrant 向量数据库中搜索相似的代码嵌入
- 使用余弦相似度查找最相关的代码块
- 应用最小相似度阈值(0.4)以过滤结果
- 将结果限制为 50 个匹配项以优化性能

4. **路径过滤**(如果指定):

- 过滤结果,仅包括指定目录路径中的文件
- 使用标准化路径比较以进行准确过滤
- 在过滤范围内保持相关性排序

5. **结果处理和格式化**:

- 将绝对文件路径转换为工作区相对路径
- 使用文件路径、行范围、相似度分数和代码内容构建结果
- 格式化为 AI 使用和 UI 显示,并带有语法高亮
Expand Down Expand Up @@ -184,10 +189,10 @@

## 使用示例

当 Kilo Code 实现新功能时,搜索 "身份验证中间件" 以在编写新代码之前了解现有模式。
当调试问题时,Kilo Code 搜索 "API 调用中的错误处理" 以查找代码库中相关的错误模式。
当重构代码时,Kilo Code 搜索 "数据库事务模式" 以确保所有数据库操作的一致性。
当加入新代码库时,Kilo Code 搜索 "配置加载" 以了解应用程序如何引导。
- 当 Kilo Code 实现新功能时,搜索 "身份验证中间件" 以在编写新代码之前了解现有模式。
- 当调试问题时,Kilo Code 搜索 "API 调用中的错误处理" 以查找代码库中相关的错误模式。
- 当重构代码时,Kilo Code 搜索 "数据库事务模式" 以确保所有数据库操作的一致性。
- 当加入新代码库时,Kilo Code 搜索 "配置加载" 以了解应用程序如何引导。

## 使用示例

Expand Down Expand Up @@ -232,4 +237,4 @@
<codebase_search>
<query>环境变量和应用程序配置</query>
</codebase_search>
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
- [自定义模式](/features/custom-modes)
- [自定义规则](/advanced-usage/custom-rules)
- [设置管理](/features/settings-management)
- [自动批准设置](/features/auto-approving-actions)
- [自动批准设置](/features/auto-approving-actions)
Loading