anthropic

package
v0.14.4-beta.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 24 Imported by: ? 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

View Source
const (
	AnthropicDefaultAPIVersion           = "2023-06-01"
	AnthropicDefaultMaxTokens            = 4096
	AnthropicThinkingBudget              = 1024
	AnthropicMinThinkingBudget           = 1024
	ProviderMetadataThinkingSignatureKey = "anthropic:signature"
)

Variables

This section is empty.

Functions

func ConvertAIChatToUIChat

func ConvertAIChatToUIChat(aiChat uctypes.AIChat) (*uctypes.UIChat, error)

ConvertAIChatToUIChat converts an AIChat to a UIChat for Anthropic

func ConvertAIMessageToAnthropicChatMessage

func ConvertAIMessageToAnthropicChatMessage(aiMsg uctypes.AIMessage) (*anthropicChatMessage, error)

convertAIMessageToAnthropicChatMessage converts an AIMessage to anthropicChatMessage These messages are ALWAYS role "user"

func ConvertToolResultsToAnthropicChatMessage

func ConvertToolResultsToAnthropicChatMessage(toolResults []uctypes.AIToolResult) (*anthropicChatMessage, error)

ConvertToolResultsToAnthropicChatMessage converts AIToolResult slice to anthropicChatMessage

func GetFunctionCallInputByToolCallId added in v0.14.2

func GetFunctionCallInputByToolCallId(aiChat uctypes.AIChat, toolCallId string) *uctypes.AIFunctionCallInput

func RemoveToolUseCall added in v0.14.2

func RemoveToolUseCall(chatId string, toolCallId string) error

func RunAnthropicChatStep

func RunAnthropicChatStep(
	ctx context.Context,
	sse *sse.SSEHandlerCh,
	chatOpts uctypes.WaveChatOpts,
	cont *uctypes.WaveContinueResponse,
) (*uctypes.WaveStopReason, *anthropicChatMessage, *uctypes.RateLimitInfo, error)

func UpdateToolUseData added in v0.14.2

func UpdateToolUseData(chatId string, toolCallId string, toolUseData uctypes.UIMessageDataToolUse) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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