Class AnthropicMapper
java.lang.Object
dev.langchain4j.model.anthropic.internal.mapper.AnthropicMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AiMessage
toAiMessage
(List<AnthropicContent> contents) static List
<AnthropicMessage> toAnthropicMessages
(List<ChatMessage> messages) static List
<AnthropicTextContent> toAnthropicSystemPrompt
(List<ChatMessage> messages, AnthropicCacheType cacheType) static AnthropicTool
toAnthropicTool
(ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt) static List
<AnthropicTool> toAnthropicTools
(List<ToolSpecification> toolSpecifications, AnthropicCacheType cacheToolsPrompt) static FinishReason
toFinishReason
(String anthropicStopReason) static TokenUsage
toTokenUsage
(AnthropicUsage anthropicUsage)
-
Constructor Details
-
AnthropicMapper
public AnthropicMapper()
-
-
Method Details
-
toAnthropicMessages
-
toAnthropicSystemPrompt
public static List<AnthropicTextContent> toAnthropicSystemPrompt(List<ChatMessage> messages, AnthropicCacheType cacheType) -
toAiMessage
-
toTokenUsage
-
toFinishReason
-
toAnthropicTools
public static List<AnthropicTool> toAnthropicTools(List<ToolSpecification> toolSpecifications, AnthropicCacheType cacheToolsPrompt) -
toAnthropicTool
public static AnthropicTool toAnthropicTool(ToolSpecification toolSpecification, AnthropicCacheType cacheToolsPrompt)
-