Class AnthropicMapper

java.lang.Object
dev.langchain4j.model.anthropic.internal.mapper.AnthropicMapper

public class AnthropicMapper extends Object
  • Constructor Details

    • AnthropicMapper

      public AnthropicMapper()
  • Method Details

    • toAnthropicMessages

      public static List<AnthropicMessage> toAnthropicMessages(List<dev.langchain4j.data.message.ChatMessage> messages)
    • toAnthropicSystemPrompt

      public static List<AnthropicTextContent> toAnthropicSystemPrompt(List<dev.langchain4j.data.message.ChatMessage> messages, AnthropicCacheType cacheType)
    • toAiMessage

      public static dev.langchain4j.data.message.AiMessage toAiMessage(List<AnthropicContent> contents)
    • toTokenUsage

      public static dev.langchain4j.model.output.TokenUsage toTokenUsage(AnthropicUsage anthropicUsage)
    • toFinishReason

      public static dev.langchain4j.model.output.FinishReason toFinishReason(String anthropicStopReason)
    • 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)