应用平台 APPSTAGE-返回结果:响应消息体
响应消息体
响应消息体通常以结构化格式返回,与响应消息头中Content-type对应,传递除响应消息头之外的内容。
对于文本对话接口,返回如下消息体。为篇幅起见,这里只展示部分内容。
{ "created": 1718772336, "usage": { "completion_tokens": 23, "prompt_tokens": 45, "total_tokens": 68 }, "model": "chatglm3-6b", "id": "chatcmpl-xxx", "choices": [{ "finish_reason": "stop", "index": 0, "message": { "role": "assistant", "content": "你好,有什么我可以帮助你的吗?" }, "logprobs": null }], "object": "chat.completion" }
当接口调用出错时,会返回错误码及错误信息说明,错误响应的Body体格式如下所示。
{ "error_code": "AIAE.31001702", "error_msg": "Model not exists, please check and try again later!" }
其中,error_code表示错误码,error_msg表示错误描述信息。