Implement common ParseCommand interface

This commit is contained in:
2025-10-25 18:41:46 +02:00
parent 0a7420c9f9
commit bd6436840e
8 changed files with 36 additions and 27 deletions

View File

@@ -385,7 +385,9 @@ func TestParseLlamaCommand(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
result, err := backends.ParseLlamaCommand(tt.command)
var opts backends.LlamaServerOptions
resultAny, err := opts.ParseCommand(tt.command)
result, _ := resultAny.(*backends.LlamaServerOptions)
if tt.expectErr {
if err == nil {
@@ -413,7 +415,9 @@ func TestParseLlamaCommand(t *testing.T) {
func TestParseLlamaCommandArrays(t *testing.T) {
command := "llama-server --model test.gguf --lora adapter1.bin --lora=adapter2.bin"
result, err := backends.ParseLlamaCommand(command)
var opts backends.LlamaServerOptions
resultAny, err := opts.ParseCommand(command)
result, _ := resultAny.(*backends.LlamaServerOptions)
if err != nil {
t.Fatalf("unexpected error: %v", err)
@@ -429,4 +433,4 @@ func TestParseLlamaCommandArrays(t *testing.T) {
t.Errorf("expected lora[%d]=%s got %s", i, v, result.Lora[i])
}
}
}
}