Documentation
¶
Index ¶
Constants ¶
View Source
const (
CompletionDataPrefix = "data: "
)
Variables ¶
View Source
var (
ErrorNon200Response = errors.New("Non-200 response from llama.cpp")
)
Functions ¶
This section is empty.
Types ¶
type LlamaCppClient ¶
type LlamaCppClient struct { HttpClient *http.Client LlamaCppConfiguration *LlamaCppConfiguration }
func (*LlamaCppClient) GenerateCompletion ¶
func (self *LlamaCppClient) GenerateCompletion( ctx context.Context, responseChannel chan LlamaCppCompletionToken, llamaCppCompletionRequest LlamaCppCompletionRequest, )
func (*LlamaCppClient) GetHealth ¶
func (self *LlamaCppClient) GetHealth( ctx context.Context, responseChannel chan<- LlamaCppHealthStatus, )
type LlamaCppCompletionToken ¶
type LlamaCppConfiguration ¶
type LlamaCppConfiguration struct {
HttpAddress *netcfg.HttpAddressConfiguration
}
func (*LlamaCppConfiguration) String ¶
func (self *LlamaCppConfiguration) String() string
type LlamaCppHealthStatus ¶
type LlamaCppHealthStatus struct { Error error `json:"-"` ErrorMessage string `json:"error_message,omitempty"` Status LlamaCppHealthStatusCode `json:"status"` SlotsIdle uint `json:"slots_idle"` SlotsProcessing uint `json:"slots_processing"` }
func (*LlamaCppHealthStatus) IsOk ¶ added in v0.1.0
func (self *LlamaCppHealthStatus) IsOk() bool
type LlamaCppHealthStatusCode ¶
type LlamaCppHealthStatusCode string
const ( Error LlamaCppHealthStatusCode = "error" LoadingModel LlamaCppHealthStatusCode = "loading model" NoSlotAvailable LlamaCppHealthStatusCode = "no slot available" Ok LlamaCppHealthStatusCode = "ok" )
Click to show internal directories.
Click to hide internal directories.