mirror of
https://github.com/danielmiessler/fabric
synced 2024-11-08 07:11:06 +00:00
21f4b5f774
In golang, contexts should be propagated downwards in order to be able to provide features such as cancellation. This commit refactors the Vendor interface to accept a context as a first parameter so that it can be propagated downwards.
20 lines
414 B
Go
20 lines
414 B
Go
package vendors
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
|
|
"github.com/danielmiessler/fabric/common"
|
|
)
|
|
|
|
type Vendor interface {
|
|
GetName() string
|
|
IsConfigured() bool
|
|
Configure() error
|
|
ListModels() ([]string, error)
|
|
SendStream([]*common.Message, *common.ChatOptions, chan string) error
|
|
Send(context.Context, []*common.Message, *common.ChatOptions) (string, error)
|
|
Setup() error
|
|
SetupFillEnvFileContent(*bytes.Buffer)
|
|
}
|