GetOnlineEvalTask - 获取一个链路评估任务的详细信息。

获取指定链路评估任务的详细信息,包括名称、评估模型配置,起止时间等信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用前面加 * 表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
paillmtrace:GetOnlineEvalTaskget
*OnlineEvaluation
acs:paillmtrace:{#regionId}:{#accountId}:onlineevaluation/{#OnlineEvaluationId}

请求语法

GET /api/v1/PAILLMTrace/onlineevaltasks/{TaskId} HTTP/1.1

请求参数

名称类型必填描述示例值
TaskIdstring

任务 ID。

e111d41dd22ca6cf4bc1e3fcad7a142af93

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

POP request id

6F352A02-9C0D-54A7-B57C-663CF71D5714
Codestring

内部错误码。只在响应出错时被设置。

InvalidInputParams
Messagestring

响应错误信息。只在响应出错时被设置。

task id is empty
Taskobject

任务信息

Idstring

任务 id

0839a02d-aa24-4174-90bb-7a773885934d
Namestring

任务名称。

my-eval-task-1
AliyunUidstring

任务创建者的阿里云账号(主账号)。

1195531608511111
UserIdstring

任务创建者的阿里云子账号。

222222222222222222
AppNamestring

该任务针对的用户应用的名称。

my-llm-app
Filtersarray<object>

评估任务要搜索一定量的用户应用产生的链路数据,作为评估操作的输入数据。这是定义搜索筛选条件的列表。

filtersobject

过滤条件对象。

Keystring

过滤条件的 key。

ServiceId ServiceName Input Output Status TraceType SpanType TraceName SpanName
Operatorstring

过滤条件匹配操作符。

= StartsWith Contains
Valuestring

过滤条件的值。

foo
GmtCreateTimestring

任务 UTC 创建时间。

2024-07-31 08:30:00
GmtStartTimestring

链路数据的 UTC 开始时间。

2024-08-02
GmtEndTimestring

链路数据的 UTC 结束时间。

2024-08-10 13:20:00
GmtLastSamplingWindowStartTimestring

最后一次采样窗口的 UTC 开始时间。

2024-08-10 13:11:00
GmtLastSamplingWindowEndTimestring

最后一次采样窗口的 UTC 结束时间

2024-08-10 13:14:00
SamplingFrequencyMinutesinteger

评估任务要搜索一定量的用户应用产生的链路数据,作为评估操作的输入数据。这是定义任务每次搜索输入数据的时间窗口的宽度。

3
SamplingRatiointeger

评估任务在一个时间窗口里搜索到的数据,真正作为评估输入数据的百分比。比如 100 表示搜索到的所有数据都作为评估输入。又比如 20 表示从搜索到的数据里随机取 20%作为评估输入。

70
Descriptionstring

任务描述信息

这个任务做了这些事。
Statusstring

任务状态

CREATED RUNNING FINISHED USER_CANCELED
RecordCountinteger

评估记录数量

999
EvalResultsstring

从该任务所有的评估结果,通过聚合计算得到的聚合评估结果。

[{"task_id": "11111", "result_type": "HasValidEvalResult", "record_count": 8, "faithfulness": 0.5, "correctness": 0.5, "ndcg": null, "mrr": null, "hit_rate": null, "precision": null}, {"task_id": "11111", "result_type": "FailedToExtractQCA", "record_count": 3, "faithfulness": 0.0, "correctness": 0.0, "ndcg": null, "mrr": null, "hit_rate": null, "precision": null}]
EvaluationConfigEvaluationConfig

从 json 格式的链路数据里要一些提取特定路径上的值,作为评估操作的输入。在这个 EvaluationConfig 结构体里定义这些 json 路径。

ModelConfigModelConfig

评估任务内部使用的大模型的访问配置结构体。

示例

正常返回示例

JSON格式

{
  "RequestId": "6F352A02-9C0D-54A7-B57C-663CF71D5714",
  "Code": "InvalidInputParams",
  "Message": "task id is empty",
  "Task": {
    "Id": "0839a02d-aa24-4174-90bb-7a773885934d",
    "Name": "my-eval-task-1",
    "AliyunUid": 1195531608511111,
    "UserId": 222222222222222200,
    "AppName": "my-llm-app",
    "Filters": [
      {
        "Key": "ServiceId\nServiceName\nInput\nOutput\nStatus\nTraceType\nSpanType\nTraceName\nSpanName",
        "Operator": "=\nStartsWith\nContains",
        "Value": "foo"
      }
    ],
    "GmtCreateTime": "2024-07-31 08:30:00",
    "GmtStartTime": "2024-08-02",
    "GmtEndTime": "2024-08-10 13:20:00",
    "GmtLastSamplingWindowStartTime": "2024-08-10 13:11:00",
    "GmtLastSamplingWindowEndTime": "2024-08-10 13:14:00",
    "SamplingFrequencyMinutes": 3,
    "SamplingRatio": 70,
    "Description": "这个任务做了这些事。",
    "Status": "CREATED\nRUNNING\nFINISHED\nUSER_CANCELED",
    "RecordCount": 999,
    "EvalResults": [
      {
        "task_id": 11111,
        "result_type": "HasValidEvalResult",
        "record_count": 8,
        "faithfulness": 0.5,
        "correctness": 0.5,
        "ndcg": null,
        "mrr": null,
        "hit_rate": null,
        "precision": null
      },
      {
        "task_id": 11111,
        "result_type": "FailedToExtractQCA",
        "record_count": 3,
        "faithfulness": 0,
        "correctness": 0,
        "ndcg": null,
        "mrr": null,
        "hit_rate": null,
        "precision": null
      }
    ],
    "EvaluationConfig": {
      "Context": {
        "JsonPathInSpan": "attributes.retrieval.documents[*].document.content",
        "SpanName": "retrieve",
        "JsonPathInSpanValue": "message/value"
      },
      "Answer": {
        "JsonPathInSpan": "attributes.output.value",
        "SpanName": "query",
        "JsonPathInSpanValue": "message/value"
      },
      "Query": {
        "JsonPathInSpan": "attributes.input.value",
        "SpanName": "query",
        "JsonPathInSpanValue": "message/value"
      }
    },
    "ModelConfig": {
      "Temperature": 0.1,
      "ApiKey": "lRQ6ny2BP1g73fsgf9O+Hr4DEedezQ",
      "Endpoint": "https://aiservice.cn-hangzhou.aliyuncs.com/v1",
      "UseFunctionCall": true,
      "TopP": 0.9,
      "Name": "pai-judge\nthemis\nqwen\ngpt",
      "IsSelfHost": true
    }
  }
}

错误码

访问错误中心查看更多错误码。