管理跟踪#

实验性功能

这是一个实验性功能,随时可能更改。了解更多

Prompt flow 在 promptflow-devkit 中提供了多个跟踪工具包。本页将介绍如何使用 CLI/SDK 删除本地存储中的跟踪。

本地跟踪管理#

删除#

Prompt flow 提供了删除本地存储中跟踪的功能,用户可以通过集合(一组跟踪,可通过 start_trace 指定)、时间范围或 Prompt flow 运行来删除跟踪,这两种方法都支持 CLI 和 SDK。

pf trace delete --collection <collection-name>  # delete specific collection
pf trace delete --collection <collection-name> --started-before '2024-03-01T16:00:00.123456'  # delete traces started before the time in specific collection
pf trace delete --run <run-name>  # delete traces originated from specific prompt flow run
from promptflow.client import PFClient

pf = PFClient()
pf.traces.delete(collection="<collection-name>")  # delete specific collection
pf.traces.delete(collection="<collection-name>", started_before="2024-03-01T16:00:00.123456")  # delete traces started before the time in specific collection
pf.traces.delete(run="<run-name>")  # delete traces originated from specific prompt flow run