Skip to content

Commit 867a8d8

Browse files
committed
Make user proper of EmbeddingModelConfig optional
1 parent 229ad86 commit 867a8d8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

openai/openai-vanilla/runtime/src/main/java/io/quarkiverse/langchain4j/openai/runtime/OpenAiRecorder.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ public Supplier<?> embeddingModel(Langchain4jOpenAiConfig runtimeConfig) {
103103
.maxRetries(runtimeConfig.maxRetries())
104104
.logRequests(firstOrDefault(false, embeddingModelConfig.logRequests(), runtimeConfig.logRequests()))
105105
.logResponses(firstOrDefault(false, embeddingModelConfig.logResponses(), runtimeConfig.logResponses()))
106-
.modelName(embeddingModelConfig.modelName())
107-
.user(embeddingModelConfig.user());
106+
.modelName(embeddingModelConfig.modelName());
107+
108+
if (embeddingModelConfig.user().isPresent()) {
109+
builder.user(embeddingModelConfig.user().get());
110+
}
108111

109112
runtimeConfig.organizationId().ifPresent(builder::organizationId);
110113

openai/openai-vanilla/runtime/src/main/java/io/quarkiverse/langchain4j/openai/runtime/config/EmbeddingModelConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ public interface EmbeddingModelConfig {
3030
/**
3131
* A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
3232
*/
33-
@WithDefault("default")
34-
String user();
33+
Optional<String> user();
3534
}

0 commit comments

Comments
 (0)