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