Skip to content

Commit

Permalink
单测修复
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiichi-Origami committed Dec 18, 2024
1 parent 3db1f96 commit 2473ce3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/qianfan/chat_completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func (c *ChatCompletion) Do(ctx context.Context, request *ChatCompletionRequest)
return nil, runErr
}

if resp.ModelAPIError.ErrorMsg != "" {
if resp != nil && resp.ModelAPIError.ErrorMsg != "" {
return nil, fmt.Errorf(
"code: %d, message: %s",
resp.ModelAPIError.ErrorCode,
Expand Down
2 changes: 1 addition & 1 deletion go/qianfan/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (c *Completion) Do(ctx context.Context, request *CompletionRequest) (*Model
return nil, runErr
}

if resp.ModelAPIError.ErrorMsg != "" {
if resp != nil && resp.ModelAPIError.ErrorMsg != "" {
return nil, fmt.Errorf(
"code: %d, message: %s",
resp.ModelAPIError.ErrorCode,
Expand Down

0 comments on commit 2473ce3

Please sign in to comment.