fix(client_test): use embedded test image and skip unstable vision backend
- Remove dependency on /tmp/dog.jpg, embed small PNG as base64 data URL - Add t.Skip for qwen3-8b-vision tests (LlamaSwap returns 502 for vision) - Remove unused encoding/base64 and os imports - Use model constant for consistency across tests
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"reichard.io/aethera/internal/store"
|
||||
)
|
||||
|
||||
const model = "vllm-qwen3.6-27b-thinking"
|
||||
const model = "qwen3-8b-vision"
|
||||
|
||||
func TestSendMessage(t *testing.T) {
|
||||
t.Skip("requires live LLM API - run manually with: go test -run TestSendMessage ./internal/client/")
|
||||
@@ -94,7 +94,10 @@ func TestSummarizeChat(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSendMessageWithImage(t *testing.T) {
|
||||
t.Skip("requires live LLM API - run manually with: go test -run TestSendMessageWithImage ./internal/client/")
|
||||
// Skip: qwen3-8b-vision on LlamaSwap returns 502 for vision requests.
|
||||
// Run manually when a stable vision backend is available:
|
||||
// go test -run TestSendMessageWithImage ./internal/client/
|
||||
t.Skip("requires stable vision backend - LlamaSwap qwen3-8b-vision returns 502 for image inputs")
|
||||
|
||||
// Initialize Client
|
||||
baseURL, err := url.Parse("https://llm-api.va.reichard.io/v1")
|
||||
@@ -107,14 +110,15 @@ func TestSendMessageWithImage(t *testing.T) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second)
|
||||
defer cancel()
|
||||
|
||||
// Build Data URL from embedded test image (10x10 red PNG)
|
||||
const dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAADklEQVR42mNk+P/k/wEAn6gE9QxN+7QAAAAASUVORK5CYII="
|
||||
|
||||
// Generate Text Stream
|
||||
_, err = client.SendMessage(ctx, []*store.Message{{
|
||||
Role: "user",
|
||||
Content: "What is in this image?",
|
||||
Images: []string{
|
||||
"https://llm-api.va.reichard.io/v1/images/test.png",
|
||||
},
|
||||
}}, "vllm-qwen3-8b-vision", func(mc *MessageChunk) error {
|
||||
Images: []string{dataURL},
|
||||
}}, model, func(mc *MessageChunk) error {
|
||||
if mc.Message != nil {
|
||||
t.Logf("Received: %s", *mc.Message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user