complexity

package
v0.30.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package complexity is a client for the Firewall Complexity API, which scores the complexity of a user message in [0,1] so the load balancer can route by difficulty.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = errors.New("complexity: client not configured")

ErrNotConfigured is returned when Score is called without a base URL and token.

View Source
var ErrUnauthorized = errors.New("complexity: unauthorized")

ErrUnauthorized is returned when the Firewall Complexity API rejects the token.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client calls the Firewall Complexity API with a static bearer token.

func NewClient

func NewClient(baseURL, token string, timeout time.Duration) *Client

NewClient builds a Client. An empty baseURL or token leaves it unconfigured (see Configured), so callers can fall back to another strategy.

func (*Client) Configured

func (c *Client) Configured() bool

Configured reports whether both a base URL and token are set.

func (*Client) Score

func (c *Client) Score(ctx context.Context, input, conversationID, tenantID string) (float64, error)

Score returns the session-smoothed complexity score in [0,1] for input. conversationID and tenantID are optional and omitted from the request when empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL