From 4df1644b07252198c451cefd8c99fce07393c490 Mon Sep 17 00:00:00 2001 From: Antonio Goncalves Date: Thu, 6 Jun 2024 15:09:17 +0200 Subject: [PATCH] Expose newly created AzureOpenAITokenizer --- .../dev/langchain4j/azure/openai/spring/AutoConfig.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/langchain4j-azure-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/azure/openai/spring/AutoConfig.java b/langchain4j-azure-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/azure/openai/spring/AutoConfig.java index ac0c7f0..ad4ae4a 100644 --- a/langchain4j-azure-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/azure/openai/spring/AutoConfig.java +++ b/langchain4j-azure-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/azure/openai/spring/AutoConfig.java @@ -7,7 +7,9 @@ import dev.langchain4j.model.azure.AzureOpenAiEmbeddingModel; import dev.langchain4j.model.azure.AzureOpenAiImageModel; import dev.langchain4j.model.azure.AzureOpenAiStreamingChatModel; +import dev.langchain4j.model.azure.AzureOpenAiTokenizer; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -148,4 +150,11 @@ AzureOpenAiImageModel openAiImageModel(Properties properties) { } return builder.build(); } + + + @Bean + @ConditionalOnMissingBean + AzureOpenAiTokenizer openAiTokenizer() { + return new AzureOpenAiTokenizer(); + } } \ No newline at end of file