Documentation ¶
Index ¶
- Constants
- Variables
- type LlamaCppClient
- func (self *LlamaCppClient) GetHealth(ctx context.Context, responseChannel chan<- LlamaCppHealthStatus)
- func (self *LlamaCppClient) GetSlots(ctx context.Context, responseChannel chan<- LlamaCppSlotStatus)
- func (self *LlamaCppClient) GetSlotsAggregatedStatus(ctx context.Context, responseChannel chan<- LlamaCppSlotsAggregatedStatus)
- type LlamaCppCompletionRequest
- type LlamaCppConfiguration
- type LlamaCppHealthStatus
- type LlamaCppHealthStatusCode
- type LlamaCppSlotStatus
- type LlamaCppSlotsAggregatedStatus
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) GetHealth ¶
func (self *LlamaCppClient) GetHealth( ctx context.Context, responseChannel chan<- LlamaCppHealthStatus, )
func (*LlamaCppClient) GetSlots ¶ added in v0.7.0
func (self *LlamaCppClient) GetSlots( ctx context.Context, responseChannel chan<- LlamaCppSlotStatus, )
func (*LlamaCppClient) GetSlotsAggregatedStatus ¶ added in v0.7.0
func (self *LlamaCppClient) GetSlotsAggregatedStatus( ctx context.Context, responseChannel chan<- LlamaCppSlotsAggregatedStatus, )
type LlamaCppConfiguration ¶
type LlamaCppConfiguration struct { HttpAddress *netcfg.HttpAddressConfiguration `json:"http_address"` ApiKey string }
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"` }
type LlamaCppHealthStatusCode ¶
type LlamaCppHealthStatusCode string
const ( Error LlamaCppHealthStatusCode = "error" LoadingModel LlamaCppHealthStatusCode = "loading model" NoSlotAvailable LlamaCppHealthStatusCode = "no slot available" Ok LlamaCppHealthStatusCode = "ok" )
type LlamaCppSlotStatus ¶ added in v0.7.0
type LlamaCppSlotsAggregatedStatus ¶ added in v0.7.0
type LlamaCppSlotsAggregatedStatus struct { Error error `json:"-"` ErrorMessage string `json:"error_message,omitempty"` Status LlamaCppHealthStatusCode `json:"status"` SlotsIdle int `json:"slots_idle"` SlotsProcessing int `json:"slots_processing"` }
func (*LlamaCppSlotsAggregatedStatus) CopyFrom ¶ added in v0.7.1
func (self *LlamaCppSlotsAggregatedStatus) CopyFrom(other *LlamaCppSlotsAggregatedStatus)
Click to show internal directories.
Click to hide internal directories.