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