Add backend capacity policy configuration
This commit is contained in:
@@ -303,6 +303,28 @@ func TestBackendOptionsAccumulateAndRegistrationsAreEngineLocal(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWithBackendCopiesQueueCapacity(t *testing.T) {
|
||||
queueCapacity := 4
|
||||
option := promptkit.WithBackend(promptkit.Backend{
|
||||
ID: "custom",
|
||||
Endpoint: "http://custom.example/v1",
|
||||
ConcurrencyLimit: 1,
|
||||
QueueCapacity: &queueCapacity,
|
||||
})
|
||||
queueCapacity = -1
|
||||
|
||||
_, err := promptkit.NewEngine(promptkit.Config{},
|
||||
promptkit.WithPromptFS(contractPromptFS("prompt", "profile", "message"), "."),
|
||||
option,
|
||||
promptkit.WithProfiles(promptkit.Profile{
|
||||
ID: "profile", BackendID: "custom", Model: "model",
|
||||
}),
|
||||
)
|
||||
if err != nil {
|
||||
t.Fatalf("construct engine after mutating queue pointer: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBackendRegistrationRejectsInvalidAndDuplicateDefinitions(t *testing.T) {
|
||||
cycle := map[string]any{}
|
||||
cycle["self"] = cycle
|
||||
|
||||
Reference in New Issue
Block a user