目录
Execute the Indexing Engine执行索引引擎
LLM call constantly exceeds TPM, RPM or time limitsLLM 通话不断超出 TPM、RPM 或时间限制
Development Guide 开发指南
Requirements 要求
Name 姓名 | Installation 安装 | Purpose 目的 |
---|---|---|
Python 3.10-3.12 | Download 下载 | The library is Python-based. 该库基于 Python。 |
Poetry 诗 | Instructions 指示 | Poetry is used for package management and virtualenv management in Python codebases Poetry 用于 Python 代码库中的包管理和虚拟环境管理 |
Getting Started 入门
Install Dependencies 安装依赖项
# Install Python dependencies.
poetry install
Execute the Indexing Engine
执行索引引擎
poetry run poe index <...args>
Executing Queries 执行查询
poetry run poe query <...args>
Azurite 蓝铜矿
Some unit and smoke tests use Azurite to emulate Azure resources. This can be started by running:
一些单元测试和冒烟测试使用 Azurite 来模拟 Azure 资源。可以通过运行以下命令来启动:
./scripts/start-azurite.sh
or by simply running azurite
in the terminal if already installed globally. See the Azurite documentation for more information about how to install and use Azurite.
或者,如果已全局安装,只需在终端中运行 azurite
即可。有关如何安装和使用 Azurite 的更多信息,请参阅 Azurite 文档 。
Lifecycle Scripts 生命周期脚本
Our Python package utilizes Poetry to manage dependencies and poethepoet to manage build scripts.
我们的 Python 包利用 Poetry 来管理依赖项,利用 poethepoet 来管理构建脚本。
Available scripts are: 可用的脚本有:
poetry run poe index
- Run the Indexing CLI
poetry run poe index
- 运行索引 CLIpoetry run poe query
- Run the Query CLI
poetry run poe query
- 运行查询 CLIpoetry build
- This invokespoetry build
, which will build a wheel file and other distributable artifacts.
poetry build
——这将调用poetry build
,它将构建一个轮子文件和其他可分发的工件。poetry run poe test
- This will execute all tests.
poetry run poe test
- 这将执行所有测试。poetry run poe test_unit
- This will execute unit tests.
poetry run poe test_unit
- 这将执行单元测试。poetry run poe test_integration
- This will execute integration tests.
poetry run poe test_integration
- 这将执行集成测试。poetry run poe test_smoke
- This will execute smoke tests.
poetry run poe test_smoke
- 这将执行烟雾测试。poetry run poe test_verbs
- This will execute tests of the basic workflows.
poetry run poe test_verbs
- 这将执行基本工作流程的测试。poetry run poe check
- This will perform a suite of static checks across the package, including:
poetry run poe check
- 这将在整个包中执行一系列静态检查,包括:- formatting 格式化
- documentation formatting
文档格式 - linting
- security patterns 安全模式
- type-checking 类型检查
poetry run poe fix
- This will apply any available auto-fixes to the package. Usually this is just formatting fixes.
poetry run poe fix
- 这会将任何可用的自动修复应用于包。通常只是格式修复。poetry run poe fix_unsafe
- This will apply any available auto-fixes to the package, including those that may be unsafe.
poetry run poe fix_unsafe
- 这将对包应用任何可用的自动修复,包括那些可能不安全的修复。poetry run poe format
- Explicitly run the formatter across the package.
poetry run poe format
- 在整个包中明确运行格式化程序。
Troubleshooting 故障排除
"RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config" when running poetry install
运行 poetry install 时出现“RuntimeError: llvm-config 执行失败,请将 LLVM_CONFIG 指向 llvm-config 的路径”
Make sure llvm-9 and llvm-9-dev are installed:
确保已安装 llvm-9 和 llvm-9-dev:
sudo apt-get install llvm-9 llvm-9-dev
and then in your bashrc, add
然后在你的 bashrc 中添加
export LLVM_CONFIG=/usr/bin/llvm-config-9
"numba/_pymodule.h:6:10: fatal error: Python.h: No such file or directory" when running poetry install
运行 poetry install 时出现“numba/_pymodule.h:6:10: 致命错误:Python.h: 没有此文件或目录”
Make sure you have python3.10-dev installed or more generally python<version>-dev
确保已安装 python3.10-dev 或更常见的 python<version>-dev
sudo apt-get install python3.10-dev
LLM call constantly exceeds TPM, RPM or time limits
LLM 通话不断超出 TPM、RPM 或时间限制
GRAPHRAG_LLM_THREAD_COUNT
and GRAPHRAG_EMBEDDING_THREAD_COUNT
are both set to 50 by default. You can modify these values to reduce concurrency. Please refer to the Configuration Documents
GRAPHRAG_LLM_THREAD_COUNT
和 GRAPHRAG_EMBEDDING_THREAD_COUNT
默认均设置为 50。您可以修改这些值以降低并发度。请参阅配置文档
引用原文: