uipath-cli
latest
false
重要 :
请注意,此内容已使用机器翻译进行了本地化。
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath CLI 用户指南
uip agent context管理智能体项目的上下文资源,即智能体在运行时查阅的 RAG(检索增强生成)索引绑定。每个上下文都是对索引的命名引用,以及检索模式和评分参数。该命令直接写入磁盘上的智能体项目(纯本地 — 无需登录)。
大纲
uip agent context add <name> --index <indexName>
[--retrieval-mode <mode>] [--threshold <n>] [--result-count <n>]
[--path <dir>]
uip agent context list [--path <dir>]
uip agent context remove <name> [--path <dir>]
uip agent context add <name> --index <indexName>
[--retrieval-mode <mode>] [--threshold <n>] [--result-count <n>]
[--path <dir>]
uip agent context list [--path <dir>]
uip agent context remove <name> [--path <dir>]
uip 智能体上下文添加
将 RAG 上下文资源添加到智能体。
参数
<name>(必填) — 上下文资源名称。用于稍后删除 (context remove <name>)。
选项
| 标记 | 默认 | 必填 | 用途 |
|---|---|---|---|
--index <indexName> | — | 是 | 要从中检索的索引名称。 |
--retrieval-mode <mode> | semantic | 检索模式。以下组织之一: semantic 、 structured 、 deeprag和batchtransform 。 | |
--threshold <n> | 0 | 检索分数阈值(数字)。低于此截止值的值将被丢弃。 | |
--result-count <n> | 3 | 每个查询要检索的结果数 (整数)。 | |
--path <path> | . | 智能体项目目录的路径。 |
如果向--threshold或--result-count输入无效的数字,则会失败,并出现验证错误。
示例
# Semantic RAG with defaults (threshold 0, 3 results)
uip agent context add KnowledgeBase --index docs-index --path ./my-agent
# Tighter recall: higher threshold, more results
uip agent context add KnowledgeBase \
--index docs-index \
--retrieval-mode semantic \
--threshold 0.7 \
--result-count 5
# Structured retrieval over a different index
uip agent context add Tickets \
--index ticket-index \
--retrieval-mode structured
# Semantic RAG with defaults (threshold 0, 3 results)
uip agent context add KnowledgeBase --index docs-index --path ./my-agent
# Tighter recall: higher threshold, more results
uip agent context add KnowledgeBase \
--index docs-index \
--retrieval-mode semantic \
--threshold 0.7 \
--result-count 5
# Structured retrieval over a different index
uip agent context add Tickets \
--index ticket-index \
--retrieval-mode structured
数据形状(--输出 json)
{
"Code": "AgentContextAdd",
"Data": {
"Status": "Context added",
"Name": "KnowledgeBase",
"Index": "docs-index",
"Mode": "semantic",
"Id": "a1b2c3d4-0000-0000-0000-000000000010"
}
}
{
"Code": "AgentContextAdd",
"Data": {
"Status": "Context added",
"Name": "KnowledgeBase",
"Index": "docs-index",
"Mode": "semantic",
"Id": "a1b2c3d4-0000-0000-0000-000000000010"
}
}
Id是标记到资源中的生成 UUID。使用Name或带有Id的context remove 。
uip 智能体上下文列表
枚举智能体上配置的上下文资源。
选项
| 标记 | 默认 | 用途 |
|---|---|---|
--path <path> | . | 智能体项目目录的路径。 |
示例
uip agent context list --path ./my-agent
uip agent context list --path ./my-agent
数据形状(--输出 json)
{
"Code": "AgentContextList",
"Data": [
{
"Name": "KnowledgeBase",
"Index": "docs-index",
"Mode": "semantic",
"Id": "a1b2c3d4-0000-0000-0000-000000000010"
}
]
}
{
"Code": "AgentContextList",
"Data": [
{
"Name": "KnowledgeBase",
"Index": "docs-index",
"Mode": "semantic",
"Id": "a1b2c3d4-0000-0000-0000-000000000010"
}
]
}
空项目会返回Data: { "Message": "No contexts configured" } 。
移除 UIP 智能体上下文
删除上下文资源。
参数
<name>(必填) — 上下文名称或ID。
选项
| 标记 | 默认 | 用途 |
|---|---|---|
--path <path> | . | 智能体项目目录的路径。 |
示例
uip agent context remove KnowledgeBase --path ./my-agent
uip agent context remove KnowledgeBase --path ./my-agent
数据形状(--输出 json)
{
"Code": "AgentContextRemove",
"Data": {
"Status": "Context removed",
"Name": "KnowledgeBase"
}
}
{
"Code": "AgentContextRemove",
"Data": {
"Status": "Context removed",
"Name": "KnowledgeBase"
}
}
缺少上下文将失败,显示Context "<name>" not found和退出代码1 。
相关内容
uip agent tool— 添加其他资源类型(IS 集成、流程等)。uip agent escalation— HITL/升级资源。uip agent validate— 进行批量编辑后重新运行,以确认资源完整性。