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