mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-14 13:08:08 +00:00
feat: cancel stream generation if client disappears (#792)
This commit is contained in:
committed by
GitHub
parent
72e3e236de
commit
12fe0932c4
@ -1,6 +1,7 @@
|
||||
package openai
|
||||
|
||||
import (
|
||||
"context"
|
||||
config "github.com/go-skynet/LocalAI/api/config"
|
||||
|
||||
"github.com/go-skynet/LocalAI/pkg/grammar"
|
||||
@ -70,6 +71,9 @@ type OpenAIModel struct {
|
||||
type OpenAIRequest struct {
|
||||
config.PredictionOptions
|
||||
|
||||
Context context.Context
|
||||
Cancel context.CancelFunc
|
||||
|
||||
// whisper
|
||||
File string `json:"file" validate:"required"`
|
||||
//whisper/image
|
||||
|
Reference in New Issue
Block a user