fabric/vendors/vendor.go
ALX99 21f4b5f774 refactor: accept context as parameter of Vendor.Send
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.
2024-08-26 19:38:18 +09:00

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