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<ChatMessage> messages)
    • toOpenAiMessage

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

      public static List<dev.ai4j.openai4j.chat.Tool> toTools(Collection<ToolSpecification> toolSpecifications, boolean strict)
    • toFunctions

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

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

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

      public static FinishReason finishReasonFrom(String openAiFinishReason)