fix: improve LLM test feedback for empty responses (#162)

* fix: show explicit success message and handle empty LLM response

* fix: enhance MaxTokens to accommodate reasoning model tests

* chore: optimize code conventions

* chore: delete \n
This commit is contained in:
Jiale Li 2026-06-17 12:56:39 +08:00 committed by GitHub
parent 257f9ac105
commit 848f97b44e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,7 +72,7 @@ func runLLMTest() error {
return llmClient.CompletionsWithCtx(ctx, llm.ChatRequest{
Model: ep.Model,
Messages: messages,
MaxTokens: 256,
MaxTokens: 2048,
})
}()
if err != nil {
@ -86,7 +86,13 @@ func runLLMTest() error {
fmt.Printf("Source: %s\n", ep.Source)
fmt.Printf("URL: %s\n", ep.URL)
fmt.Printf("Model: %s\n", model)
fmt.Printf("%s\n", resp.Content())
content := resp.Content()
if content == "" {
content = "(empty response)"
}
fmt.Printf("%s\n", content)
fmt.Println("✓ Connection test successful")
return nil
}