public class OpenAiEmbeddingModel extends Object implements EmbeddingModel, TokenCountEstimator
Constructor and Description |
---|
OpenAiEmbeddingModel(String baseUrl,
String apiKey,
String organizationId,
String modelName,
String user,
Duration timeout,
Integer maxRetries,
Proxy proxy,
Boolean logRequests,
Boolean logResponses,
Tokenizer tokenizer) |
Modifier and Type | Method and Description |
---|---|
Response<List<Embedding>> |
embedAll(List<TextSegment> textSegments) |
int |
estimateTokenCount(String text) |
static OpenAiEmbeddingModel |
withApiKey(String apiKey) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
embed, embed
estimateTokenCount, estimateTokenCount
public Response<List<Embedding>> embedAll(List<TextSegment> textSegments)
embedAll
in interface EmbeddingModel
public int estimateTokenCount(String text)
estimateTokenCount
in interface TokenCountEstimator
public static OpenAiEmbeddingModel withApiKey(String apiKey)
Copyright © 2023. All rights reserved.