hasMessageContent (pipeline/empty_response.go)

axonhub · llm/pipeline/empty_response.go · go · Apache-2.0
ai, AI / Agents

Checks LLM messages and responses for meaningful content, used for empty‑response detection.

// Source: https://github.com/looplj/axonhub | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
package pipeline

import (
	"errors"

	"github.com/looplj/axonhub/llm"
)

// ErrEmptyResponse indicates the response contains no meaningful content.
// This error triggers channel retry when empty response detection is enabled.
var ErrEmptyResponse = llm.ErrEmptyResponse

// ErrStreamFirstEventTimeout indicates a streaming response did not produce the first event in time.
var ErrStreamFirstEventTimeout = errors.New("stream first event timeout")

// ErrPreCommitBufferExceeded indicates that a retryable stream produced too
// many or too many bytes of non-meaningful events before reaching a 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key