Package com.langchainbeam.model.openai
Class OpenAiModelBuilder
java.lang.Object
com.langchainbeam.model.openai.OpenAiModelBuilder
- All Implemented Interfaces:
LangchainModelBuilder
Internal builder for constructing an
OpenAiChatModel
using
OpenAiModelOptions
.
This class is responsible for setting model options and building an OpenAI-based model
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondev.langchain4j.model.openai.OpenAiChatModel
build()
Builds and returns anOpenAiChatModel
based on the configured options.Returns theOpenAiModelOptions
used by this builder.void
setOptions
(LangchainModelOptions modelOptions) Sets theOpenAiModelOptions
for the builder
-
Constructor Details
-
OpenAiModelBuilder
public OpenAiModelBuilder()
-
-
Method Details
-
getOptions
Returns theOpenAiModelOptions
used by this builder.- Returns:
- the model options
-
setOptions
Sets theOpenAiModelOptions
for the builder- Specified by:
setOptions
in interfaceLangchainModelBuilder
- Parameters:
modelOptions
- the model options to set- Throws:
IllegalArgumentException
- if the options are not of typeOpenAiModelOptions
-
build
public dev.langchain4j.model.openai.OpenAiChatModel build()Builds and returns anOpenAiChatModel
based on the configured options.- Specified by:
build
in interfaceLangchainModelBuilder
- Returns:
- a configured OpenAiChatModel
-