transform

package
v0.260625.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MPL-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanBetaSystemMessages added in v0.260625.1

func CleanBetaSystemMessages(blocks []anthropic.BetaTextBlockParam) []anthropic.BetaTextBlockParam

CleanBetaSystemMessages removes billing header messages from beta system blocks

func CleanSystemMessages added in v0.260625.1

func CleanSystemMessages(blocks []anthropic.TextBlockParam) []anthropic.TextBlockParam

CleanSystemMessages removes billing header messages from system blocks This is used for Claude Code scenario to filter out injected billing headers

Types

type CleanHeaderTransform added in v0.260625.1

type CleanHeaderTransform struct{}

CleanHeaderTransform strips injected billing header blocks from system messages. Used by Claude Code scenarios to remove upstream-injected x-anthropic-billing-header blocks. Only added to the chain when CleanHeader flag is true.

func NewCleanHeaderTransform added in v0.260625.1

func NewCleanHeaderTransform() *CleanHeaderTransform

NewCleanHeaderTransform creates a CleanHeaderTransform.

func (*CleanHeaderTransform) Apply added in v0.260625.1

func (*CleanHeaderTransform) Name added in v0.260625.1

func (t *CleanHeaderTransform) Name() string

type MCPToolInjectionTransform

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

MCPToolInjectionTransform injects enabled server-side MCP tools into requests.

func NewMCPToolInjectionTransform

func NewMCPToolInjectionTransform(rt *runtime.Runtime) *MCPToolInjectionTransform

func (*MCPToolInjectionTransform) Apply

func (*MCPToolInjectionTransform) Name

type MCPToolStripGuardTransform

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

MCPToolStripGuardTransform strips disabled MCP tool declarations/tool calls when enabled.

func NewMCPToolStripGuardTransform

func NewMCPToolStripGuardTransform(rt *runtime.Runtime, stripEnabled bool) *MCPToolStripGuardTransform

func (*MCPToolStripGuardTransform) Apply

func (*MCPToolStripGuardTransform) Name

type MaxTokensTransform added in v0.260625.1

type MaxTokensTransform struct {
	DefaultMaxTokens int
	MaxAllowed       int
}

MaxTokensTransform ensures max_tokens is set and properly bounded for Anthropic requests.

It applies three rules:

  1. Fill defaultMaxTokens when the client sends 0.
  2. Cap max_tokens at maxAllowed.
  3. If the thinking budget exceeds maxAllowed, shrink it to max(maxAllowed/10, 1024).

func NewMaxTokensTransform added in v0.260625.1

func NewMaxTokensTransform(defaultMaxTokens, maxAllowed int) *MaxTokensTransform

NewMaxTokensTransform creates a MaxTokensTransform.

func (*MaxTokensTransform) Apply added in v0.260625.1

func (*MaxTokensTransform) Name added in v0.260625.1

func (t *MaxTokensTransform) Name() string

type NativeWebSearchStripTransform added in v0.260514.1

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

NativeWebSearchStripTransform removes native web_search / web_fetch tool definitions from upstream requests when tingly-box's own MCP equivalents are enabled and ready.

This prevents the LLM from selecting Anthropic's built-in web tools (which require a Claude Code subscription) when our MCP-backed versions are available via Serper/Jina.

func NewNativeWebSearchStripTransform added in v0.260514.1

func NewNativeWebSearchStripTransform(rt *runtime.Runtime) *NativeWebSearchStripTransform

func (*NativeWebSearchStripTransform) Apply added in v0.260514.1

func (*NativeWebSearchStripTransform) Name added in v0.260514.1

Jump to

Keyboard shortcuts

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