Class InternalOpenAiHelper

java.lang.Object
dev.langchain4j.model.openai.InternalOpenAiHelper

public class InternalOpenAiHelper extends Object
  • Constructor Details

    • InternalOpenAiHelper

      public InternalOpenAiHelper()
  • Method Details

    • toOpenAiMessages

      public static List<dev.ai4j.openai4j.chat.Message> toOpenAiMessages(List<dev.langchain4j.data.message.ChatMessage> messages)
    • toOpenAiMessage

      public static dev.ai4j.openai4j.chat.Message toOpenAiMessage(dev.langchain4j.data.message.ChatMessage message)
    • toTools

      public static List<dev.ai4j.openai4j.chat.Tool> toTools(Collection<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications)
    • toFunctions

      @Deprecated public static List<dev.ai4j.openai4j.chat.Function> toFunctions(Collection<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications)
      Deprecated.
      Functions are deprecated by OpenAI, use toTools(Collection) instead
    • aiMessageFrom

      public static dev.langchain4j.data.message.AiMessage aiMessageFrom(dev.ai4j.openai4j.chat.ChatCompletionResponse response)
    • tokenUsageFrom

      public static dev.langchain4j.model.output.TokenUsage tokenUsageFrom(dev.ai4j.openai4j.shared.Usage openAiUsage)
    • finishReasonFrom

      public static dev.langchain4j.model.output.FinishReason finishReasonFrom(String openAiFinishReason)