Skip to content

Commit

Permalink
fix: nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
kyriediculous committed Aug 1, 2024
1 parent 936b939 commit 03e0059
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/ai_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ func processLlmGenerate(ctx context.Context, params aiRequestParams, req worker.
return nil, err
}

if *req.Stream {
if req.Stream != nil && *req.Stream {
streamChan, ok := resp.(chan worker.LlmStreamChunk)
if !ok {
return nil, errors.New("unexpected response type for streaming request")
Expand Down Expand Up @@ -753,7 +753,7 @@ func submitLlmGenerate(ctx context.Context, params aiRequestParams, sess *AISess
return nil, fmt.Errorf("unexpected status code: %d, body: %s", resp.StatusCode, string(body))
}

if *req.Stream {
if req.Stream != nil && *req.Stream {
return handleSSEStream(ctx, resp.Body, sess, req, start)
}

Expand Down

0 comments on commit 03e0059

Please sign in to comment.