此页面由 AI 自动翻译。查看英文原版
最后更新

本页目录

  • 函数
  • instrument_cyclopts
Claude CodeCodexCursor
Luxonis 智能体工具包为你常用的编程智能体加载 Luxonis 上下文与技能,更快地基于 OAK 开发应用。
安装工具包
最后更新
Python API: luxonis_ml.telemetry.cli.cyclopts

函数

instrument_cyclopts

Python
1def instrument_cyclopts(app: cyclopts.App, telemetry: Telemetry, *, allowlist: set[str] | None = None, include_system_metadata: bool | None = None, exclude_commands: set[str] | None = None):
包装 Cyclopts 命令以发出遥测事件。包装器递归遍历应用程序,因此它也检测每个子应用程序的命令。别名共享一个应用程序对象,因此包装器会检测每个子应用程序一次。参数
  • app (cyclopts.App): 要检测的 Cyclopts 应用程序。
  • telemetry (Telemetry): 捕获事件的遥测客户端。
  • allowlist (set[str] | None): 允许在事件中使用的命令参数名称。一个允许列表涵盖每个检测到的命令。如果省略,则不发送任何参数值。包装器始终删除 self、ctx 和 context,并删除任何 Click 或 Typer 上下文对象。
  • include_system_metadata (bool | None): 是否将系统元数据附加到事件。如果省略,则由遥测配置决定。
  • exclude_commands (set[str] | None): 要保留未检测的完整命令名称,例如 {"data parse"}。嵌套名称在各部分之间使用空格。