应用平台 APPSTAGE-ModelRouter:接口调用

时间:2024-09-05 17:26:51

接口调用

  • chat
    • 接口调用:ModelRouter.chat.completion.create
    • 参数说明
      表3 参数说明

      参数名

      参数类型

      是否必选

      参数描述

      messages

      List[str]

      True

      包含到目前为止的对话的消息列表

      model

      str

      True

      模型id

      stream

      bool

      False

      是否流式返回

      kwargs

      -

      False

      其他openai chat completion参数

    • 返回值
      表4 返回值

      值类型

      描述

      id

      str

      唯一标识

      choices

      list

      文本生成选项列表。如果n大于1,则可以是多个

      created

      int

      Unix时间戳(以秒为单位)

      model

      str

      使用的模型

      usage

      str

      请求token用量

      object

      str

      当前为chat.completion

support.huaweicloud.com/sdkreference-appstage/appstage_08_0095.html