Package dev.langchain4j.model.openai
Class OpenAiStreamingLanguageModel
java.lang.Object
dev.langchain4j.model.openai.OpenAiStreamingLanguageModel
- All Implemented Interfaces:
dev.langchain4j.model.language.StreamingLanguageModel
public class OpenAiStreamingLanguageModel
extends Object
implements dev.langchain4j.model.language.StreamingLanguageModel
Represents an OpenAI language model with a completion interface, such as gpt-3.5-turbo-instruct.
The model's response is streamed token by token and should be handled with
StreamingResponseHandler
.
However, it's recommended to use OpenAiStreamingChatModel
instead,
as it offers more advanced features like function calling, multi-turn conversations, etc.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
-
Constructor Summary
ConstructorsConstructorDescriptionOpenAiStreamingLanguageModel
(OpenAiStreamingLanguageModel.OpenAiStreamingLanguageModelBuilder builder) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface dev.langchain4j.model.language.StreamingLanguageModel
generate
-
Constructor Details
-
OpenAiStreamingLanguageModel
public OpenAiStreamingLanguageModel(OpenAiStreamingLanguageModel.OpenAiStreamingLanguageModelBuilder builder)
-
-
Method Details
-
modelName
-
generate
- Specified by:
generate
in interfacedev.langchain4j.model.language.StreamingLanguageModel
-
builder
-