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 List<AnthropicMessage> toAnthropicMessages(List<dev.langchain4j.data.message.ChatMessage> messages) static List<AnthropicMessage> toAnthropicMessages(List<dev.langchain4j.data.message.ChatMessage> messages, boolean sendThinking) static List<AnthropicTextContent> toAnthropicSystemPrompt(List<dev.langchain4j.data.message.ChatMessage> messages, AnthropicCacheType cacheType) static AnthropicTooltoAnthropicTool(dev.langchain4j.agent.tool.ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt) 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) 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:
-
-
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) -
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) -
toAnthropicTool
public static AnthropicTool toAnthropicTool(dev.langchain4j.agent.tool.ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt)
-