不同服务注册不同组件模块

This commit is contained in:
Cold
2025-12-09 17:55:08 +08:00
committed by 张斌
parent 87b3ac9878
commit 43a8834c5a
7 changed files with 347 additions and 45 deletions

View File

@@ -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
}