From 52f27fc476be4f37aea071f3e0281ae9a2930bc4 Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 22 Feb 2026 17:37:34 +0000 Subject: [PATCH] feat(llama): return Result from Generate/Chat Delegates to HTTPBackend which already returns Result. Co-Authored-By: Virgil --- backend_llama.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend_llama.go b/backend_llama.go index d5acf7f..ca59920 100644 --- a/backend_llama.go +++ b/backend_llama.go @@ -113,17 +113,17 @@ func (b *LlamaBackend) Stop() error { } // Generate sends a prompt to the managed llama-server. -func (b *LlamaBackend) Generate(ctx context.Context, prompt string, opts GenOpts) (string, error) { +func (b *LlamaBackend) Generate(ctx context.Context, prompt string, opts GenOpts) (Result, error) { if !b.Available() { - return "", log.E("ml.LlamaBackend.Generate", "llama-server not available", nil) + return Result{}, log.E("ml.LlamaBackend.Generate", "llama-server not available", nil) } return b.http.Generate(ctx, prompt, opts) } // Chat sends a conversation to the managed llama-server. -func (b *LlamaBackend) Chat(ctx context.Context, messages []Message, opts GenOpts) (string, error) { +func (b *LlamaBackend) Chat(ctx context.Context, messages []Message, opts GenOpts) (Result, error) { if !b.Available() { - return "", log.E("ml.LlamaBackend.Chat", "llama-server not available", nil) + return Result{}, log.E("ml.LlamaBackend.Chat", "llama-server not available", nil) } return b.http.Chat(ctx, messages, opts) }