public class OpenAiStreamingLanguageModel extends Object implements StreamingLanguageModel, TokenCountEstimator
StreamingResponseHandler.
However, it's recommended to use OpenAiStreamingChatModel instead,
as it offers more advanced features like function calling, multi-turn conversations, etc.| Constructor and Description |
|---|
OpenAiStreamingLanguageModel(String baseUrl,
String apiKey,
String organizationId,
String modelName,
Double temperature,
Duration timeout,
Proxy proxy,
Boolean logRequests,
Boolean logResponses,
Tokenizer tokenizer) |
| Modifier and Type | Method and Description |
|---|---|
int |
estimateTokenCount(String prompt) |
void |
generate(String prompt,
StreamingResponseHandler<String> handler) |
static OpenAiStreamingLanguageModel |
withApiKey(String apiKey) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateestimateTokenCount, estimateTokenCountpublic void generate(String prompt, StreamingResponseHandler<String> handler)
generate in interface StreamingLanguageModelpublic int estimateTokenCount(String prompt)
estimateTokenCount in interface TokenCountEstimatorpublic static OpenAiStreamingLanguageModel withApiKey(String apiKey)
Copyright © 2023. All rights reserved.