不同服务注册不同组件模块
This commit is contained in:
@@ -65,8 +65,9 @@ type ChatCompletionReq struct {
|
||||
|
||||
// ChatCompletionRes 对话响应 (非流式)
|
||||
type ChatCompletionRes struct {
|
||||
Code int `json:"code"`
|
||||
Data struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"` // 错误信息
|
||||
Data struct {
|
||||
Answer string `json:"answer"`
|
||||
Reference interface{} `json:"reference"`
|
||||
AudioBinary interface{} `json:"audio_binary"`
|
||||
@@ -163,7 +164,7 @@ func (c *Client) ChatCompletion(ctx context.Context, chatId string, req *ChatCom
|
||||
return nil, err
|
||||
}
|
||||
if res.Code != 0 {
|
||||
return nil, gerror.Newf("chat completion failed: code=%d", res.Code)
|
||||
return nil, gerror.Newf("chat completion failed: code=%d, message=%s", res.Code, res.Message)
|
||||
}
|
||||
return &res, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user