claude

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package claude holds the Claude request mapping shared by the Anthropic and Bedrock adapters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToolUseID

func ToolUseID(id string) string

ToolUseID returns id in a form both Claude protocols accept: Anthropic allows [a-zA-Z0-9_-]+ and Bedrock Converse at most 64 characters. A conforming id is returned unchanged; any other is rewritten deterministically, with a hash of the original appended so distinct ids stay distinct. Apply it to tool calls and tool results alike.

Types

type ThinkingConfig

type ThinkingConfig struct {
	Type         string `json:"type"`
	BudgetTokens *int   `json:"budget_tokens,omitempty"`
	Display      string `json:"display,omitempty"`
	Effort       string `json:"-"`
}

ThinkingConfig is Claude's thinking object; Effort travels separately in output_config.

func Thinking

func Thinking(t *litellm.Thinking) *ThinkingConfig

Thinking maps t: a budget selects "enabled" with budget_tokens, otherwise "adaptive". Values are sent as given. It returns nil when t is nil.

Jump to

Keyboard shortcuts

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