Package dev.langchain4j.model.openai
Class InternalOpenAiHelper
java.lang.Object
dev.langchain4j.model.openai.InternalOpenAiHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic dev.langchain4j.data.message.AiMessage
aiMessageFrom
(dev.ai4j.openai4j.chat.ChatCompletionResponse response) static dev.langchain4j.model.output.FinishReason
finishReasonFrom
(String openAiFinishReason) static List
<dev.ai4j.openai4j.chat.Function> toFunctions
(Collection<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications) Deprecated.static dev.langchain4j.model.output.TokenUsage
tokenUsageFrom
(dev.ai4j.openai4j.shared.Usage openAiUsage) static dev.ai4j.openai4j.chat.Message
toOpenAiMessage
(dev.langchain4j.data.message.ChatMessage message) static List
<dev.ai4j.openai4j.chat.Message> toOpenAiMessages
(List<dev.langchain4j.data.message.ChatMessage> messages) static List
<dev.ai4j.openai4j.chat.Tool> toTools
(Collection<dev.langchain4j.agent.tool.ToolSpecification> toolSpecifications)
-
Constructor Details
-
InternalOpenAiHelper
public InternalOpenAiHelper()
-
-
Method Details
-
toOpenAiMessages
-
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, usetoTools(Collection)
instead -
aiMessageFrom
public static dev.langchain4j.data.message.AiMessage aiMessageFrom(dev.ai4j.openai4j.chat.ChatCompletionResponse response) -
finishReasonFrom
-
toTools(Collection)
instead