Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
25757d6
Bugfix: 修复LLM返回工具参数非法JSON导致Agent丢弃此工具调用的问题
weimch Jul 29, 2026
86b5f7d
Bugfix: 修复hy3模型调用不带思考内容导致思维链断裂的问题
weimch Jul 29, 2026
7cd049a
feat: add tool script safety guard
xyxhhhhh Jul 2, 2026
8bd6399
feat: strengthen tool safety guard validation
xyxhhhhh Jul 6, 2026
729e782
test: cover safety policy and env exfiltration branches
xyxhhhhh Jul 6, 2026
002b40a
docs: add tool safety guard design flow
xyxhhhhh Jul 8, 2026
79d7f93
docs: add safety report response example
xyxhhhhh Jul 8, 2026
4065345
docs: show all safety decision responses
xyxhhhhh Jul 8, 2026
273cf2d
docs: align safety response examples with report schema
xyxhhhhh Jul 8, 2026
2478d9c
Add real agent tool safety demo
xyxhhhhh Jul 22, 2026
fa1428f
fix: address raychen911 review comments on tool safety guard
xyxhhhhh Jul 23, 2026
cbc5e76
style: fix yapf formatting in _rules.py
xyxhhhhh Jul 23, 2026
678efaa
docs: add tool safety policy examples
xyxhhhhh Jul 29, 2026
93d7c1c
docs: address tool safety review feedback
xyxhhhhh Jul 30, 2026
134a01d
test: address tool safety review feedback
xyxhhhhh Jul 30, 2026
334ddb5
docs: align tool safety custom rule example
xyxhhhhh Jul 30, 2026
94405ed
fix: preserve dynamic library paths for tool safety mcp
xyxhhhhh Jul 31, 2026
1153e7f
fix: use current interpreter in code review demo
xyxhhhhh Jul 31, 2026
b4ea8cc
code-review-skill
Eternally72 Jul 12, 2026
7357217
add PostgreSQL
Eternally72 Jul 13, 2026
04bb98c
Bugfix: 修复模型调用失败/重试无trace的问题
weimch Jul 31, 2026
913cb1d
fix(safety): scan all script-like filter arguments
FireCollector Jul 31, 2026
b7285cd
fix(safety): scan mixed-language tool arguments
FireCollector Jul 31, 2026
7115fd1
fix(safety): scan mixed-language fields separately
FireCollector Jul 31, 2026
ea673c9
style: format mixed-language safety fix
FireCollector Jul 31, 2026
3498266
refactor(safety): aggregate segmented scans in scanner
FireCollector Jul 31, 2026
fcde0d7
fix(safety): deduplicate segmented scan findings
FireCollector Jul 31, 2026
a54f8ae
fix(safety): preserve default code language
FireCollector Jul 31, 2026
34b9409
safety: suppress Python parse errors for unknown segments
FireCollector Aug 1, 2026
db88da7
version: 发布1.1.15版本
raychen911 Aug 3, 2026
c29aede
optimize: 优化 code review 输出,避免阻塞
CongkeChen Jul 30, 2026
12388ad
fix: 全量流水线优化
CongkeChen Aug 3, 2026
6d0b499
feat: 新增评测优化闭环准备阶段
guocfu Jul 15, 2026
d3705f7
feat(evaluation): 实现确定性评测优化闭环第二阶段
guocfu Jul 15, 2026
ac78dd6
feat(evaluation): 完成评测标准化、失败归因与案例差异分析
guocfu Jul 15, 2026
b0eee66
feat(evaluation): 实现独立 Gate 与预算决策
guocfu Jul 16, 2026
cbe1561
feat(evaluation): 接入真实优化器与安全写回
guocfu Jul 18, 2026
f13118c
test(evaluation): 增加真实双模型集成入口
guocfu Jul 18, 2026
54ba3e7
feat(evaluation): 增加优化报告模型与渲染
guocfu Jul 18, 2026
317832a
fix(evaluation): 修正报告遥测与错误脱敏
guocfu Jul 18, 2026
cb9bf6a
fix(evaluation): 收紧报告脱敏与遥测完整性
guocfu Jul 19, 2026
7920c5c
feat(evaluation): 原子发布报告与审计索引
guocfu Jul 19, 2026
6a948fc
fix(evaluation): 加固报告发布与配置快照
guocfu Jul 19, 2026
1a52d00
fix(evaluation): 禁止非原子报告发布回退
guocfu Jul 19, 2026
7869a32
fix(evaluation): 阻止扩展配置泄露凭据
guocfu Jul 19, 2026
bf3ae59
feat(evaluation): 完成第五阶段报告与审计闭环
guocfu Jul 19, 2026
9e82694
feat(evaluation): 完成离线模型与 Trace 回放验收链路
guocfu Jul 21, 2026
b6d9e63
fix(evaluation): 补齐异常脱敏与 Trace 错误上下文
guocfu Jul 21, 2026
c205bfe
fix(evaluation): 统一审计口径并补强提示词恢复
guocfu Jul 21, 2026
c1f6080
fix(evaluation): 修复 CI 子进程模块导入
guocfu Jul 22, 2026
0b5503a
重构:整理评测优化闭环示例
guocfu Aug 4, 2026
cc376d4
修复:兼容真实模式结果打印
guocfu Aug 4, 2026
e7a4962
修复:完善评测优化示例的发布与配置校验
guocfu Aug 4, 2026
95d00b0
Bugfix: 修复llm调用抛出GeneratorExit时无trace上报的问题
weimch Aug 4, 2026
859ac4e
Feature: LlmAgent支持配置最大轮数/LLM次数/工具调用次数
weimch Aug 5, 2026
b210a2a
Feature: 支持OpenAI Responses API与GraphAgent HITL及恢复加固
pcerypeng Aug 6, 2026
9f87d1b
tools: enforce BashTool whitelist across compound commands
FireCollector Jul 31, 2026
4040feb
tools: preserve heredoc data during whitelist validation
FireCollector Aug 1, 2026
cc1e569
tools: reject shell line continuations during validation
FireCollector Aug 1, 2026
6d6bb3f
code_executors: defer docker and magic imports to avoid hang on Windo…
Fromsko Jul 24, 2026
423bbf6
tests: skip magic test on Windows; keep HAS_MAGIC for backward compat
Fromsko Jul 24, 2026
19a0441
code_executors: fix HAS_MAGIC dead code and test mock (address review)
Fromsko Jul 24, 2026
aee5a6b
address review: TYPE_CHECKING guard, import short-circuit, yapf format
Fromsko Jul 24, 2026
737ee63
fix: flake8 F821 + missing logger import for CI lint
Fromsko Jul 24, 2026
d1b3468
tests: fix container_cli mock compatibility with lazy docker import
Fromsko Jul 24, 2026
7f17de5
address final review: restore HAS_MAGIC, add threading lock, cleanup
Fromsko Jul 24, 2026
ad52639
refactor: use explicit module-level placeholders instead of globals()…
Fromsko Jul 24, 2026
88b8da5
fix: widen magic import exception handling and restore HAS_MAGIC in t…
Fromsko Jul 24, 2026
0214b4c
fix: guard docker=None before except block to prevent AttributeError
Fromsko Jul 24, 2026
d9b5a81
fix: make docker=None guard reachable and restore HAS_MAGIC import-ti…
Fromsko Jul 24, 2026
e93ef34
fix: move _import_docker to fixture, add magic thread lock
Fromsko Jul 24, 2026
b1d7e21
refactor: use TYPE_CHECKING + private _docker_* names, no public shad…
Fromsko Jul 24, 2026
a2057a2
fix: fully lazy magic import, remove dead code, widen docker except
Fromsko Jul 24, 2026
67db5ba
polish: add logger.debug for docker import failure, fix import ordering
Fromsko Jul 24, 2026
3806832
version: 发布1.1.16版本
raychen911 Aug 11, 2026
1bf8510
feat(langfuse): 支持用户自定义attribute上报
weimch Aug 13, 2026
b7d16bb
fix: 修复 agent 执行中断场景下 span 状态与输出丢失的 4 类问题
weimch Aug 17, 2026
d1515ab
Bugfix: 修复AgentNode返回error Event时AGUI连接被过早断开的问题
weimch Aug 11, 2026
3297bd6
feature: 优化安装速度
raychen911 Aug 7, 2026
a53165a
version: 发布1.1.17版本
raychen911 Aug 19, 2026
35bfb48
fix: 修复LLM流式输出中途失败时span误报成功且已输出文本丢失的问题
weimch Aug 20, 2026
fa1c016
test: 增加扩展包的安装用于测试全量例子
raychen911 Aug 21, 2026
06facc9
version: 发布1.1.18版本
weimch Aug 21, 2026
f2bc080
version: 发布1.1.19版本
weimch Aug 21, 2026
7f45fdd
test: 测试当前 CLA 是否会 failed
rookierook1e Aug 24, 2026
9ca0bf6
feature: 引入 advanced_memory 组件
CongkeChen Aug 11, 2026
4dc8ff8
refactor: 优化Advanced Memory 代码内容与模块结构
CongkeChen Aug 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 120
ignore = E402, W503
ignore = E402, W503, W504
30 changes: 18 additions & 12 deletions .github/code_review/prompts/findings.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
你现在的任务不是重新做代码审查,而是将已经生成的 `review.md` 提取为结构化结果,供后续脚本用于行内评论、阻断判断和其他自动化处理。
最高优先级输出协议:
1. 整个回复只能包含一个 JSON 对象,除此之外不能出现任何字符。
2. 回复的第一个字符必须是 `{`,最后一个字符必须是 `}`。
3. 读取文件、分析问题、确认行号和核对结果的过程必须静默完成,不得输出进度、思考过程、问题清单、总结或完成提示。
4. 禁止输出“我已确认”“现在生成”“基于 review.md”“共发现”“让我分析”“已经完成”等过程性文字。
5. 即使定位失败或信息不足,也必须直接按下述格式输出 JSON;通过保守字段值和 `inline_candidate=false` 表达,不得在 JSON 外解释原因。

你现在的任务不是重新做代码审查,而是将已经生成的 `review.md` 提取为结构化结果,供后续脚本用于行内评论和其他自动化处理。

输入文件:
1. 仓库根目录下的 `review.md`:这是主依据,包含第一阶段已经确认的问题。
Expand All @@ -17,8 +24,7 @@
- `Warning` -> `warning`
- `Suggestion` -> `suggestion`

输出 JSON 格式:
```json
输出 JSON 的结构必须是:
{
"findings": [
{
Expand All @@ -32,7 +38,6 @@
}
]
}
```

字段要求:
1. `severity`:必须是 `critical`、`warning`、`suggestion` 之一。
Expand All @@ -52,13 +57,14 @@
2. 如果一个问题已经在第一阶段被合并表述为一个综合问题(例如“命令注入 + 路径穿越”),不要在这里再次拆分成多个新问题,除非 `review.md` 本身已经明确拆开。
3. `body` 不要照抄整段 review 原文;应提炼成适合行内评论展示的短说明。
4. 不允许因为定位失败、信息缺失或不适合行内评论而省略第一阶段已经明确列出的问题;这类问题必须保留在 `findings` 中,并通过 `inline_candidate=false` 与保守字段值表达。
5. 如果 `review.md` 中没有任何问题,输出:
```json
{"findings":[]}
```
5. 如果 `review.md` 中没有任何问题,唯一输出为 `{"findings":[]}`。

校验要求:
1. 输出必须能被标准 JSON 解析器直接解析。
2. 所有字符串必须使用双引号。
3. 不要在 JSON 外再输出任何额外字符。
4. 不要输出 ```json 或 ```,也不要输出任何注释。
1. 输出必须能被标准 JSON 解析器直接解析,等价于 Python `json.loads` 可以一次解析成功。
2. 所有属性名和字符串必须使用双引号,不能使用单引号代替。
3. 字符串内部的双引号、反斜杠、换行符等特殊字符必须按照 JSON 规范转义。
4. 数组和对象的最后一个元素后不能有多余逗号。
5. 不要输出 Markdown 代码块、注释、前后缀、空行或任何解释文字。
6. 输出前在内部静默检查:内容只能有一个顶层对象,并且只能从 `{` 开始、到 `}` 结束。

现在开始静默处理。最终回复只能是 JSON,第一个字符必须是 `{`。
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.lock
*.log
examples/*.log
examples/tool_safety/real_agent_safety_audit.jsonl

trpc-agent-py.egg-info

Expand Down
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,92 @@
# Changelog

## [1.1.19](https://github.com/trpc-group/trpc-agent-python/releases/tag/v1.1.19) (2026-08-21)

Version bump to keep the `main` and `r0.1` branches in sync; carries forward the fixes already included in 1.1.18 (LLM streaming interruption span fixes and CI extension package installation).

## [1.1.18](https://github.com/trpc-group/trpc-agent-python/releases/tag/v1.1.18) (2026-08-21)

### Bug Fixes

* Telemetry: Fixed `agent_run` and runner spans misreporting success with empty output when LLM streaming output was interrupted mid-stream (network interruption, model business error, or a retry-swallowed failure on a later turn after a tool call).
* Error responses no longer clear the partial text already streamed; the span is now marked as failed and the accumulated output is preserved with an `[INTERRUPTED]` prefix.
* In multi-turn runs, the interrupted text is appended after already-collected turn content instead of being dropped.
* The `call_llm` span's `llm_response` attribute now also backfills the already-streamed content when the retry layer converts a raised exception into a terminal error response.

### Internal

* CI: Added extension package installation to `pipeline_test/run_all_examples.sh` so the full set of examples can be run in CI.

## [1.1.17](https://github.com/trpc-group/trpc-agent-python/releases/tag/v1.1.17) (2026-08-19)

### Features

* Telemetry: Langfuse export now preserves user-defined span attributes. Fields prefixed with `langfuse` are passed through as-is; other custom attributes are collected into metadata so teams can observe custom instrumentation alongside built-in trace data.

### Bug Fixes

* AG-UI: Fixed AGUI connections being closed too early when an `AgentNode` emitted an error `Event`. The server no longer sends `RunErrorEvent` immediately on the first error event; it waits until the final event carries an error after the agent run has finished. This allows agents such as `GraphAgent` to continue executing subsequent nodes instead of terminating the client connection prematurely.
* Telemetry: Fixed four classes of span status and output loss during agent interruption or failure:
* Runner initialization failures now report error status through `trace_runner()` even when `InvocationContext` is not yet available (`invocation_context` is optional), while still writing the remaining runner business attributes.
* LLM call failures converted by the retry layer into `LlmResponse(error_code=...)` are no longer recorded as successful spans; trace reporting now checks `llm_response.error_code`.
* External cancellation via `asyncio.CancelledError` now marks the root invocation span as failed and preserves accumulated partial streamed text instead of leaving the span successful with missing output.
* `GeneratorExit` during generator shutdown now backfills partial streamed text into `agent_action`, preventing already emitted content from being lost when the client disconnects or the stream is closed early.

### Internal

* Build: Optimized installation speed for faster dependency setup and project bootstrap.

## [1.1.16](https://github.com/trpc-group/trpc-agent-python/releases/tag/v1.1.16) (2026-08-11)

### Features

* Model: Added OpenAI Responses API support in `OpenAIModel`, including streaming, tool calls, and related adapter integration, so agents can use the Responses API alongside existing chat-completions flows.
* Graph: Strengthened `GraphAgent` human-in-the-loop support and resume behavior, including clearer HITL event handling, checkpoint recovery, and AG-UI integration updates for interrupted graph runs.
* Agent: Added configurable run limits for `LlmAgent` through `AgentRunLimits`, allowing callers to cap total turns, LLM calls, and tool calls and fail fast when a budget is exceeded.
* Eval/Optimization: Added an evaluation-and-optimization closed loop, covering pipeline config validation, standardized evaluation, failure attribution, case diff analysis, gate/budget decisions, real optimizer write-back, atomic report publishing, audit indexing, and offline model / trace replay validation.
* Examples: Added `examples/optimization/eval_optimize_loop` for the evaluation-optimization workflow and `examples/llmagent_with_limit` for demonstrating agent run limits.

### Bug Fixes

* Tools: Fixed `BashTool` whitelist validation so every executable segment in standalone commands, pipelines, and compound shell syntax (`;`, `&&`, `||`, newlines, background `&`) is checked. Heredoc bodies are treated as data, and unverifiable substitution syntax now fails closed.
* Code Execution: Deferred `docker` and `python-magic` imports to first use, preventing import-time hangs or crashes on Windows and other environments without Docker Desktop or libmagic installed.
* Telemetry: Fixed missing trace reporting when LLM calls are cancelled with `GeneratorExit` after a client disconnects during deployed service runs.
* Eval/Optimization: Hardened report publishing, credential redaction, telemetry completeness, and config snapshot handling so optimization artifacts do not leak secrets or publish partial state.

### Docs

* Docs: Added English and Chinese documentation for OpenAI Responses API usage, GraphAgent HITL/resume behavior, and `LlmAgent` run-limit configuration.

### Internal

* CI: Optimized code-review prompt output to reduce blocking review noise.
* CI: Improved full pipeline example execution coverage in `pipeline_test/run_all_examples.sh`.
* Code Execution: Follow-up lazy-import fixes for Docker CLI helpers and content-type detection, including thread-safe magic probing and test compatibility updates.

## [1.1.15](https://github.com/trpc-group/trpc-agent-python/releases/tag/v1.1.15) (2026-08-03)

### Features

* Tools: Added a Tool Script Safety Guard that scans Bash / Python scripts before execution and returns `allow` / `deny` / `needs_human_review`. It covers dangerous commands, sensitive path access, dependency installs, unknown network calls, and privilege escalation, and can be enabled on `BashTool`, local code executors, Skill, and MCP tool flows.
* Tools: Added configurable safety policies, custom rule registration, JSONL audit logs, and telemetry attributes so teams can tune what to block, what to review, and how to observe safety decisions.
* Testing: Added a Session / Memory / Summary multi-backend replay consistency framework. The same agent trajectories can be replayed on InMemory, SQLite, and optional Redis backends to compare events, state, memory, and summary results, with known SQLite summary drift reported instead of silently ignored.
* Examples: Added a Skill-based code review agent example, including sandbox execution, review report generation, and policy filters for reviewing diffs / repositories more safely.
* Examples: Added PostgreSQL storage support to the code review agent example, so review records can be persisted beyond the default SQLite backend.
* Examples: Added pytest configuration and failure fallback handling for evaluation examples, making evaluation runs more resilient when individual cases fail.

### Bug Fixes

* Tools: Fixed `ToolSafetyFilter` only scanning the first non-empty script-like argument. It now scans all recognized fields such as `script` / `code` / `command` / `cmd` / `python_code` / `bash_code` / `code_blocks`, including mixed-language requests, so a safe earlier field can no longer hide a later dangerous command.
* Tools: For unknown-language segments, keep running Bash rules but only merge Python findings when AST parsing succeeds. This avoids `PY_PARSE_ERROR_REVIEW` false positives that could block safe Bash scripts under strict review mode.
* Model: Fixed Hunyuan hy3 conversations breaking the thinking chain when later turns omitted thinking content. Thinking text is now preserved when the model requires it for follow-up calls.
* Model: Fixed tool calls being dropped when the model returned invalid JSON tool arguments. The SDK now tries `json_repair` first, and if repair fails it returns a parameter error to the agent instead of silently discarding the call.
* Telemetry: Fixed missing traces for model retries and model call failures. Retry attempts and failure details are now recorded on the corresponding spans.

### Docs

* Docs: Added Tool Script Safety Guard design notes, policy examples, response schema examples, and a real-agent demo covering Tool / Skill / MCP / CodeExecutor allow-review-deny scenarios.
* Docs: Expanded replay consistency README and implementation notes, including positive consistency checks and negative injection detection cases.

## [1.1.14](https://github.com/trpc-group/trpc-agent-python/releases/tag/v1.1.14) (2026-07-24)

### Features
Expand Down
66 changes: 48 additions & 18 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Install optional extensions:

```bash
# Choose as needed, multiple extensions can be combined with commas
pip install "trpc-agent-py[a2a,knowledge,agent-claude]"
pip install "trpc-agent-py[graph,a2a,knowledge,knowledge-hf,agent-claude]"
```

---
Expand All @@ -77,47 +77,73 @@ pip install "trpc-agent-py[a2a,knowledge,agent-claude]"
git clone https://github.com/trpc-group/trpc-agent-python.git
cd trpc-agent-python
# Create and activate a virtual environment
python3 -m venv .venv
./build.sh
source .venv/bin/activate # Linux / macOS
# .venv\Scripts\activate # Windows
# Install
pip install -e .
```

### uv Installation

[uv](https://docs.astral.sh/uv/) manages the Python toolchain, virtual environment and dependencies based on the repository's `pyproject.toml` for fast, reproducible installs. This project provides a script for one-shot setup on macOS:
[uv](https://docs.astral.sh/uv/) provides fast dependency installation.

#### Install in a user project (recommended)

```bash
# Install uv if it is not already available
python -m pip install uv

# Install the published package in a virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv pip install trpc-agent-py

# Install optional capabilities as needed
# uv pip install "trpc-agent-py[graph,a2a,knowledge,knowledge-hf,agent-claude]"
```

For a project managed by uv:

```bash
# Core package only
uv add trpc-agent-py
# Or: core + optional extras (one command is enough)
# uv add "trpc-agent-py[graph,a2a,knowledge,knowledge-hf,agent-claude]"
```

#### Develop this repository from source

After cloning the repository, use the same cross-platform build script:

```bash
git clone https://github.com/trpc-group/trpc-agent-python.git
cd trpc-agent-python

# Install uv on macOS (see https://docs.astral.sh/uv/getting-started/installation/)
curl -LsSf https://astral.sh/uv/install.sh | sh

# One-shot setup
bash build_mac_uv.sh
./build.sh uv

# add optional extras
EXTRAS="a2a knowledge" bash build_mac_uv.sh
# Or: core + optional extras (one command is enough; installer defaults to uv)
# ./build.sh "[dev,graph,a2a,knowledge,knowledge-hf]"
# ./build.sh uv "[dev,graph,a2a,knowledge,knowledge-hf]"
source .venv/bin/activate
```

Or run the steps manually:

```bash
uv venv --python-preference only-system # use the local Python
uv sync --extra dev # core + dev tooling
uv sync --extra a2a --extra knowledge # add optional extras
uv sync --extra graph --extra a2a --extra knowledge --extra knowledge-hf
uv sync # production install (core only)

# Run commands inside the environment without activating it for evaluation
# Run commands inside the environment without activating it
uv run python -c "from trpc_agent_sdk.version import __version__; print(__version__)"
```

To speed up downloads via a mirror, pass `--default-index`, e.g.:

```bash
uv sync --default-index https://mirrors.cloud.tencent.com/pypi/simple
# Or in a user project:
# uv pip install trpc-agent-py --index-url https://mirrors.cloud.tencent.com/pypi/simple
```

### Optional Dependencies Reference
Expand All @@ -127,7 +153,9 @@ uv sync --default-index https://mirrors.cloud.tencent.com/pypi/simple
| `a2a` | Google A2A protocol | `pip install "trpc-agent-py[a2a]"` |
| `ag-ui` | AG-UI protocol | `pip install "trpc-agent-py[ag-ui]"` |
| `agent-claude` | Claude Agent | `pip install "trpc-agent-py[agent-claude]"` |
| `graph` | LangGraphAgent and graph DSL (includes langchain) | `pip install "trpc-agent-py[graph]"` |
| `knowledge` | Knowledge base / RAG | `pip install "trpc-agent-py[knowledge]"` |
| `knowledge-hf` | Hugging Face embeddings | `pip install "trpc-agent-py[knowledge-hf]"` |
| `mem0` | Long-term memory (Mem0) | `pip install "trpc-agent-py[mem0]"` |
| `langchain_tool` | LangChain Tool integration | `pip install "trpc-agent-py[langchain_tool]"` |
| `langfuse` | Langfuse observability | `pip install "trpc-agent-py[langfuse]"` |
Expand Down Expand Up @@ -163,6 +191,7 @@ TRPC_AGENT_MODEL_NAME="your-model-name"
**Option 2**: Export directly to the shell environment

```bash
# Export environment variables
export TRPC_AGENT_API_KEY="your-api-key"
export TRPC_AGENT_BASE_URL="your-base-url"
export TRPC_AGENT_MODEL_NAME="your-model-name"
Expand Down Expand Up @@ -202,6 +231,7 @@ Expected output:
```
All core modules imported successfully.
```

### Run Unit Tests

```bash
Expand All @@ -220,10 +250,10 @@ pytest tests/ -v
**Solution**: Use a mirror to speed up downloads.

```bash
# Temporary usage Tencent Cloud mirror
# Temporary usage
pip install trpc-agent-py -i https://mirrors.cloud.tencent.com/pypi/simple

# Set global Tencent Cloud mirror
# Set global mirror
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
```

Expand All @@ -243,10 +273,10 @@ Other available mirrors:
ERROR: Package 'trpc-agent-py' requires a different Python: 3.9.x not in '>=3.10'
```

**Solution**: Upgrade to Python 3.12.
**Solution**: Upgrade to Python3.12.

```bash
# Solution 1: Using pyenv to install Python 3.12
# Solution 1: Using pyenv to install Python3.12
pyenv install 3.12
pyenv local 3.12

Expand Down
Loading
Loading