Class AnthropicMapper
java.lang.Object
dev.langchain4j.model.anthropic.internal.mapper.AnthropicMapper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AiMessagetoAiMessage(List<AnthropicContent> contents) static AiMessagetoAiMessage(List<AnthropicContent> contents, boolean returnThinking) static AiMessagetoAiMessage(List<AnthropicContent> contents, boolean returnThinking, boolean returnServerToolResults) static List<AnthropicMessage> toAnthropicMessages(List<ChatMessage> messages) static List<AnthropicMessage> toAnthropicMessages(List<ChatMessage> messages, boolean sendThinking) toAnthropicSchema(JsonSchemaElement schemaElement) static List<AnthropicTextContent> toAnthropicSystemPrompt(List<ChatMessage> messages, AnthropicCacheType cacheType) static AnthropicTooltoAnthropicTool(ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt) static AnthropicTooltoAnthropicTool(ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt, Set<String> toolMetadataKeysToSend, Boolean strictTools) static AnthropicTooltoAnthropicTool(AnthropicServerTool serverTool) static AnthropicToolChoicetoAnthropicToolChoice(ToolChoice toolChoice, String toolChoiceName, Boolean disableParallelToolUse) static List<AnthropicTool> toAnthropicTools(List<ToolSpecification> toolSpecifications, AnthropicCacheType cacheToolsPrompt, Boolean strictTools) static List<AnthropicTool> toAnthropicTools(List<ToolSpecification> toolSpecifications, AnthropicCacheType cacheToolsPrompt, Set<String> toolMetadataKeysToSend, Boolean strictTools) static List<AnthropicTool> toAnthropicTools(List<AnthropicServerTool> serverTools) static FinishReasontoFinishReason(String anthropicStopReason) static TokenUsagetoTokenUsage(AnthropicUsage anthropicUsage)
-
Field Details
-
THINKING_SIGNATURE_KEY
- See Also:
-
REDACTED_THINKING_KEY
- See Also:
-
SERVER_TOOL_RESULTS_KEY
- See Also:
-
-
Constructor Details
-
AnthropicMapper
public AnthropicMapper()
-
-
Method Details
-
toAnthropicMessages
-
toAnthropicMessages
public static List<AnthropicMessage> toAnthropicMessages(List<ChatMessage> messages, boolean sendThinking) -
toAnthropicSystemPrompt
public static List<AnthropicTextContent> toAnthropicSystemPrompt(List<ChatMessage> messages, AnthropicCacheType cacheType) -
toAiMessage
-
toAiMessage
-
toAiMessage
public static AiMessage toAiMessage(List<AnthropicContent> contents, boolean returnThinking, boolean returnServerToolResults) -
toTokenUsage
-
toFinishReason
-
toAnthropicToolChoice
public static AnthropicToolChoice toAnthropicToolChoice(ToolChoice toolChoice, String toolChoiceName, Boolean disableParallelToolUse) -
toAnthropicTools
public static List<AnthropicTool> toAnthropicTools(List<ToolSpecification> toolSpecifications, AnthropicCacheType cacheToolsPrompt, Boolean strictTools) -
toAnthropicTools
public static List<AnthropicTool> toAnthropicTools(List<ToolSpecification> toolSpecifications, AnthropicCacheType cacheToolsPrompt, Set<String> toolMetadataKeysToSend, Boolean strictTools) -
toAnthropicTool
public static AnthropicTool toAnthropicTool(ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt) -
toAnthropicTool
public static AnthropicTool toAnthropicTool(ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt, Set<String> toolMetadataKeysToSend, Boolean strictTools) -
retainKeys
-
toAnthropicTools
-
toAnthropicTool
-
toAnthropicSchema
-