文档

Steps

更新时间:
一键部署

retrieve

from dashscope import Steps
step = Steps.retrieve('step_id',
                      thread_id='thread_id',
                      run_id='run_id')

输出json结果

{
    "assistant_id": "asst_1",
    "cancelled_at": null,
    "completed_at": 1709866473,
    "created_at": 1709866472,
    "expires_at": null,
    "failed_at": null,
    "id": "step_1",
    "last_error": null,
    "object": "thread.run.step",
    "run_id": "run_1",
    "status": "completed",
    "step_details": {
        "message_creation": {
            "message_id": "msg_1"
        },
        "type": "message_creation"
    },
    "thread_id": "thread_1",
    "type": "message_creation",
    "usage": {
        "completion_tokens": 25,
        "prompt_tokens": 809,
        "total_tokens": 834
    }
}

输入参数

参数

类型

默认值

说明

step_id

str

-

指定要查询的Step id

run_id

str

-

指定要查询的Step所属Run id

thread_id

str

-

指定要查询的Step所属Thread id

workspace

str

None

DashScope workspace id

api_key

str

None

DashScope API key,可以通过环境变量等方法设置。

输出Step参数

参数

类型

默认值

说明

id

str

-

Step id

assistant_id

str

-

Step所属Assiatant id

run_id

str

-

Step所属Run id

thread_id

str

-

Step所属Thread id

step_details

Dict

StepDetails信息

created_at

timestamp

创建时间

gmt_created

datatime

2024-03-22 17:12:31

gmt_modified

datatime

2024-03-22 17:12:31

code

str

表示请求失败,表示错误码,成功忽略。

python only

message

str

失败,表示失败详细信息,成功忽略。

python only

list

from dashscope import Steps
steps = Steps.list('run_id',
                   thread_id='thread_id',
                   limit='')

请求参数

参数

类型

默认值

说明

run_id

str

-

所属Run id

thread_id

str

-

所属Thread id.

limit

str

order

after

before

workspace

str

None

DashScope workspace id

api_key

str

None

DashScope api key,可以通过环境变量等方法设置。

返回参数

输出RunStepList对象字段说明

字段名

字段类型

字段描述

his_more

bool

last_id

str

first_id

str

data

list[Step]

Step对象列表

  • 本页导读 (1)
文档反馈