Documentation
¶
Index ¶
- func CleanBetaSystemMessages(blocks []anthropic.BetaTextBlockParam) []anthropic.BetaTextBlockParam
- func CleanSystemMessages(blocks []anthropic.TextBlockParam) []anthropic.TextBlockParam
- type CleanHeaderTransform
- type MCPToolInjectionTransform
- type MCPToolStripGuardTransform
- type MaxTokensTransform
- type NativeWebSearchStripTransform
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 (t *CleanHeaderTransform) Apply(ctx *protocoltransform.TransformContext) error
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 (t *MCPToolInjectionTransform) Apply(ctx *protocoltransform.TransformContext) error
func (*MCPToolInjectionTransform) Name ¶
func (t *MCPToolInjectionTransform) Name() string
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 (t *MCPToolStripGuardTransform) Apply(ctx *protocoltransform.TransformContext) error
func (*MCPToolStripGuardTransform) Name ¶
func (t *MCPToolStripGuardTransform) Name() string
type MaxTokensTransform ¶ added in v0.260625.1
MaxTokensTransform ensures max_tokens is set and properly bounded for Anthropic requests.
It applies three rules:
- Fill defaultMaxTokens when the client sends 0.
- Cap max_tokens at maxAllowed.
- 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 (t *MaxTokensTransform) Apply(ctx *protocoltransform.TransformContext) error
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 (t *NativeWebSearchStripTransform) Apply(ctx *protocoltransform.TransformContext) error
func (*NativeWebSearchStripTransform) Name ¶ added in v0.260514.1
func (t *NativeWebSearchStripTransform) Name() string