Class OpenAiOfficialStreamingChatModel
java.lang.Object
dev.langchain4j.model.openaiofficial.OpenAiOfficialStreamingChatModel
- All Implemented Interfaces:
dev.langchain4j.model.chat.StreamingChatModel
public class OpenAiOfficialStreamingChatModel
extends Object
implements dev.langchain4j.model.chat.StreamingChatModel
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.openai.client.OpenAIClientAsyncprotected com.openai.client.OpenAIClientprotected OpenAiOfficialChatRequestParametersprotected List<dev.langchain4j.model.chat.listener.ChatModelListener> protected Stringprotected dev.langchain4j.model.ModelProviderprotected Stringprotected Booleanprotected Booleanprotected Set<dev.langchain4j.model.chat.Capability> protected dev.langchain4j.model.TokenCountEstimator -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbuilder()voiddoChat(dev.langchain4j.model.chat.request.ChatRequest chatRequest, dev.langchain4j.model.chat.response.StreamingChatResponseHandler handler) voidinit(String baseUrl, String apiKey, com.openai.credential.Credential credential, String microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion, String organizationId, boolean isAzure, boolean isGitHubModels, dev.langchain4j.model.chat.request.ChatRequestParameters defaultRequestParameters, String modelName, Double temperature, Double topP, List<String> stop, Integer maxCompletionTokens, Double presencePenalty, Double frequencyPenalty, Map<String, Integer> logitBias, String responseFormat, Boolean strictJsonSchema, Integer seed, String user, Boolean strictTools, Boolean parallelToolCalls, Boolean store, Map<String, String> metadata, String serviceTier, Duration timeout, Integer maxRetries, Proxy proxy, dev.langchain4j.model.TokenCountEstimator tokenCountEstimator, Map<String, String> customHeaders, List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners, Set<dev.langchain4j.model.chat.Capability> capabilities, boolean isAsync) List<dev.langchain4j.model.chat.listener.ChatModelListener> dev.langchain4j.model.ModelProviderprovider()Set<dev.langchain4j.model.chat.Capability> Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.langchain4j.model.chat.StreamingChatModel
chat, chat, chat, chat, defaultRequestParameters, listeners, provider, supportedCapabilities
-
Field Details
-
client
protected com.openai.client.OpenAIClient client -
asyncClient
protected com.openai.client.OpenAIClientAsync asyncClient -
modelName
-
defaultRequestParameters
-
responseFormat
-
strictJsonSchema
-
strictTools
-
tokenCountEstimator
protected dev.langchain4j.model.TokenCountEstimator tokenCountEstimator -
listeners
-
supportedCapabilities
-
modelProvider
protected dev.langchain4j.model.ModelProvider modelProvider
-
-
Constructor Details
-
OpenAiOfficialStreamingChatModel
-
-
Method Details
-
doChat
public void doChat(dev.langchain4j.model.chat.request.ChatRequest chatRequest, dev.langchain4j.model.chat.response.StreamingChatResponseHandler handler) - Specified by:
doChatin interfacedev.langchain4j.model.chat.StreamingChatModel
-
builder
-
init
public void init(String baseUrl, String apiKey, com.openai.credential.Credential credential, String microsoftFoundryDeploymentName, com.openai.azure.AzureOpenAIServiceVersion azureOpenAIServiceVersion, String organizationId, boolean isAzure, boolean isGitHubModels, dev.langchain4j.model.chat.request.ChatRequestParameters defaultRequestParameters, String modelName, Double temperature, Double topP, List<String> stop, Integer maxCompletionTokens, Double presencePenalty, Double frequencyPenalty, Map<String, Integer> logitBias, String responseFormat, Boolean strictJsonSchema, Integer seed, String user, Boolean strictTools, Boolean parallelToolCalls, Boolean store, Map<String, String> metadata, String serviceTier, Duration timeout, Integer maxRetries, Proxy proxy, dev.langchain4j.model.TokenCountEstimator tokenCountEstimator, Map<String, String> customHeaders, List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners, Set<dev.langchain4j.model.chat.Capability> capabilities, boolean isAsync) -
defaultRequestParameters
-
supportedCapabilities
-
listeners
-
provider
public dev.langchain4j.model.ModelProvider provider()
-