exa

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.exa.ai"

DefaultBaseURL is the standard Exa API endpoint.

Variables

This section is empty.

Functions

func ApplyConfigDefaults

func ApplyConfigDefaults(baseURL *string, textMaxChars *int, defaultTextMaxChars int)

func ApplyEnv

func ApplyEnv(apiKey, baseURL *string)

ApplyEnv fills empty Exa credentials from standard environment variables.

func AuthHeaders

func AuthHeaders(baseURL, apiKey string) map[string]string

AuthHeaders returns the standard Exa API authentication headers. For non-Exa base URLs, it also attaches a Bearer Authorization header.

func Enabled

func Enabled(enabled *bool, apiKey string) bool

Enabled returns true when the Exa provider is enabled and has credentials.

func Endpoint

func Endpoint(baseURL, path string) (string, error)

Endpoint resolves an Exa API endpoint path against the configured base URL.

func NewProvider

func NewProvider[P any](enabled *bool, apiKey string, build func() P) P

func PostAndDecodeJSON

func PostAndDecodeJSON(ctx context.Context, baseURL, path, apiKey string, payload any, timeoutSecs int, out any) error

PostAndDecodeJSON sends a JSON request and decodes the JSON response into out.

func PostJSON

func PostJSON(ctx context.Context, baseURL, path, apiKey string, payload any, timeoutSecs int) ([]byte, error)

PostJSON sends a JSON request to the configured Exa endpoint with standard auth headers.

func ShouldAttachBearerAuth

func ShouldAttachBearerAuth(baseURL string) bool

ShouldAttachBearerAuth returns true when the base URL is a non-Exa proxy that requires a standard Bearer token in addition to the x-api-key header.

Types

This section is empty.

Jump to

Keyboard shortcuts

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