diff --git a/langchain4j-dashscope-spring-boot-starter/pom.xml b/langchain4j-dashscope-spring-boot-starter/pom.xml
deleted file mode 100644
index caa25b37..00000000
--- a/langchain4j-dashscope-spring-boot-starter/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
- 4.0.0
-
-
- dev.langchain4j
- langchain4j-spring
- 1.0.0-alpha2-SNAPSHOT
- ../pom.xml
-
-
- langchain4j-dashscope-spring-boot-starter
- LangChain4j Spring Boot starter for DashScope
-
-
-
-
- dev.langchain4j
- langchain4j-dashscope
- ${project.version}
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
- org.springframework.boot
- spring-boot-autoconfigure-processor
- true
-
-
-
-
- org.projectlombok
- lombok
- provided
-
-
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
- Apache-2.0
- https://www.apache.org/licenses/LICENSE-2.0.txt
- repo
- A business-friendly OSS license
-
-
-
-
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/AutoConfig.java b/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/AutoConfig.java
deleted file mode 100644
index 98eb1c7f..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/AutoConfig.java
+++ /dev/null
@@ -1,113 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import dev.langchain4j.model.dashscope.*;
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-
-@AutoConfiguration
-@EnableConfigurationProperties(Properties.class)
-public class AutoConfig {
-
- @Bean
- @ConditionalOnProperty(Properties.PREFIX + ".chat-model.api-key")
- QwenChatModel qwenChatModel(Properties properties) {
- ChatModelProperties chatModelProperties = properties.getChatModel();
- return QwenChatModel.builder()
- .baseUrl(chatModelProperties.getBaseUrl())
- .apiKey(chatModelProperties.getApiKey())
- .modelName(chatModelProperties.getModelName())
- .temperature(chatModelProperties.getTemperature())
- .topP(chatModelProperties.getTopP())
- .topK(chatModelProperties.getTopK())
- .enableSearch(chatModelProperties.getEnableSearch())
- .seed(chatModelProperties.getSeed())
- .repetitionPenalty(chatModelProperties.getRepetitionPenalty())
- .temperature(chatModelProperties.getTemperature())
- .stops(chatModelProperties.getStops())
- .maxTokens(chatModelProperties.getMaxTokens())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(Properties.PREFIX + ".streaming-chat-model.api-key")
- QwenStreamingChatModel qwenStreamingChatModel(Properties properties) {
- ChatModelProperties chatModelProperties = properties.getStreamingChatModel();
- return QwenStreamingChatModel.builder()
- .baseUrl(chatModelProperties.getBaseUrl())
- .apiKey(chatModelProperties.getApiKey())
- .modelName(chatModelProperties.getModelName())
- .temperature(chatModelProperties.getTemperature())
- .topP(chatModelProperties.getTopP())
- .topK(chatModelProperties.getTopK())
- .enableSearch(chatModelProperties.getEnableSearch())
- .seed(chatModelProperties.getSeed())
- .repetitionPenalty(chatModelProperties.getRepetitionPenalty())
- .temperature(chatModelProperties.getTemperature())
- .stops(chatModelProperties.getStops())
- .maxTokens(chatModelProperties.getMaxTokens())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(Properties.PREFIX + ".language-model.api-key")
- QwenLanguageModel qwenLanguageModel(Properties properties) {
- LanguageModelProperties languageModelProperties = properties.getLanguageModel();
- return QwenLanguageModel.builder()
- .baseUrl(languageModelProperties.getBaseUrl())
- .apiKey(languageModelProperties.getApiKey())
- .modelName(languageModelProperties.getModelName())
- .temperature(languageModelProperties.getTemperature())
- .topP(languageModelProperties.getTopP())
- .topK(languageModelProperties.getTopK())
- .enableSearch(languageModelProperties.getEnableSearch())
- .seed(languageModelProperties.getSeed())
- .repetitionPenalty(languageModelProperties.getRepetitionPenalty())
- .temperature(languageModelProperties.getTemperature())
- .stops(languageModelProperties.getStops())
- .maxTokens(languageModelProperties.getMaxTokens())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(Properties.PREFIX + ".streaming-language-model.api-key")
- QwenStreamingLanguageModel qwenStreamingLanguageModel(Properties properties) {
- LanguageModelProperties languageModelProperties = properties.getStreamingLanguageModel();
- return QwenStreamingLanguageModel.builder()
- .baseUrl(languageModelProperties.getBaseUrl())
- .apiKey(languageModelProperties.getApiKey())
- .modelName(languageModelProperties.getModelName())
- .temperature(languageModelProperties.getTemperature())
- .topP(languageModelProperties.getTopP())
- .topK(languageModelProperties.getTopK())
- .enableSearch(languageModelProperties.getEnableSearch())
- .seed(languageModelProperties.getSeed())
- .repetitionPenalty(languageModelProperties.getRepetitionPenalty())
- .temperature(languageModelProperties.getTemperature())
- .stops(languageModelProperties.getStops())
- .maxTokens(languageModelProperties.getMaxTokens())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(Properties.PREFIX + ".embedding-model.api-key")
- QwenEmbeddingModel qwenEmbeddingModel(Properties properties) {
- EmbeddingModelProperties embeddingModelProperties = properties.getEmbeddingModel();
- return QwenEmbeddingModel.builder()
- .baseUrl(embeddingModelProperties.getBaseUrl())
- .apiKey(embeddingModelProperties.getApiKey())
- .modelName(embeddingModelProperties.getModelName())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(Properties.PREFIX + ".tokenizer.api-key")
- QwenTokenizer qwenTokenizer(Properties properties) {
- TokenizerProperties tokenizerProperties = properties.getTokenizer();
- return QwenTokenizer.builder()
- .apiKey(tokenizerProperties.getApiKey())
- .modelName(tokenizerProperties.getModelName())
- .build();
- }
-}
\ No newline at end of file
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/ChatModelProperties.java b/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/ChatModelProperties.java
deleted file mode 100644
index a5d1d0da..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/ChatModelProperties.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-@Getter
-@Setter
-class ChatModelProperties {
-
- private String baseUrl;
- private String apiKey;
- private String modelName;
- private Double topP;
- private Integer topK;
- private Boolean enableSearch;
- private Integer seed;
- private Float repetitionPenalty;
- private Float temperature;
- private List stops;
- private Integer maxTokens;
-}
\ No newline at end of file
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/EmbeddingModelProperties.java b/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/EmbeddingModelProperties.java
deleted file mode 100644
index 095430bf..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/EmbeddingModelProperties.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-class EmbeddingModelProperties {
- private String baseUrl;
- private String apiKey;
- private String modelName;
-}
\ No newline at end of file
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/LanguageModelProperties.java b/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/LanguageModelProperties.java
deleted file mode 100644
index 994382ca..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/LanguageModelProperties.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.List;
-
-@Getter
-@Setter
-class LanguageModelProperties {
-
- private String baseUrl;
- private String apiKey;
- private String modelName;
- private Double topP;
- private Integer topK;
- private Boolean enableSearch;
- private Integer seed;
- private Float repetitionPenalty;
- private Float temperature;
- private List stops;
- private Integer maxTokens;
-}
\ No newline at end of file
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/Properties.java b/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/Properties.java
deleted file mode 100644
index 2e81b3c3..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/Properties.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.NestedConfigurationProperty;
-
-@Getter
-@Setter
-@ConfigurationProperties(prefix = Properties.PREFIX)
-public class Properties {
-
- static final String PREFIX = "langchain4j.dashscope";
-
- @NestedConfigurationProperty
- ChatModelProperties chatModel;
-
- @NestedConfigurationProperty
- ChatModelProperties streamingChatModel;
-
- @NestedConfigurationProperty
- LanguageModelProperties languageModel;
-
- @NestedConfigurationProperty
- LanguageModelProperties streamingLanguageModel;
-
- @NestedConfigurationProperty
- EmbeddingModelProperties embeddingModel;
-
- @NestedConfigurationProperty
- TokenizerProperties tokenizer;
-}
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/TokenizerProperties.java b/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/TokenizerProperties.java
deleted file mode 100644
index 0d2ad8f8..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/java/dev/langchain4j/dashscope/spring/TokenizerProperties.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class TokenizerProperties {
- private String apiKey;
- private String modelName;
-}
diff --git a/langchain4j-dashscope-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/langchain4j-dashscope-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
deleted file mode 100644
index 9914be73..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ /dev/null
@@ -1 +0,0 @@
-dev.langchain4j.dashscope.spring.AutoConfig
\ No newline at end of file
diff --git a/langchain4j-dashscope-spring-boot-starter/src/test/java/dev/langchain4j/dashscope/spring/AutoConfigIT.java b/langchain4j-dashscope-spring-boot-starter/src/test/java/dev/langchain4j/dashscope/spring/AutoConfigIT.java
deleted file mode 100644
index 1017b07e..00000000
--- a/langchain4j-dashscope-spring-boot-starter/src/test/java/dev/langchain4j/dashscope/spring/AutoConfigIT.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package dev.langchain4j.dashscope.spring;
-
-import dev.langchain4j.data.message.AiMessage;
-import dev.langchain4j.model.StreamingResponseHandler;
-import dev.langchain4j.model.chat.ChatLanguageModel;
-import dev.langchain4j.model.chat.StreamingChatLanguageModel;
-import dev.langchain4j.model.dashscope.*;
-import dev.langchain4j.model.embedding.EmbeddingModel;
-import dev.langchain4j.model.language.LanguageModel;
-import dev.langchain4j.model.language.StreamingLanguageModel;
-import dev.langchain4j.model.output.Response;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import java.util.concurrent.CompletableFuture;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.assertj.core.api.Assertions.assertThat;
-
-@EnabledIfEnvironmentVariable(named = "DASHSCOPE_API_KEY", matches = ".+")
-public class AutoConfigIT {
- private static final String API_KEY = System.getenv("DASHSCOPE_API_KEY");
- private static final String CHAT_MODEL = QwenModelName.QWEN_MAX;
-
- ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(AutoConfig.class));
-
- @Test
- void should_provide_chat_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.dashscope.chat-model.api-key=" + API_KEY,
- "langchain4j.dashscope.chat-model.model-name=" + CHAT_MODEL,
- "langchain4j.dashscope.chat-model.max-tokens=20"
- )
- .run(context -> {
- ChatLanguageModel chatLanguageModel = context.getBean(ChatLanguageModel.class);
- assertThat(chatLanguageModel).isInstanceOf(QwenChatModel.class);
- assertThat(chatLanguageModel.generate("What is the capital of Germany?")).contains("Berlin");
-
- assertThat(context.getBean(QwenChatModel.class)).isSameAs(chatLanguageModel);
- });
- }
-
- @Test
- void should_provide_streaming_chat_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.dashscope.streaming-chat-model.api-key=" + API_KEY,
- "langchain4j.dashscope.streaming-chat-model.model-name=" + CHAT_MODEL,
- "langchain4j.dashscope.streaming-chat-model.max-tokens=20"
- )
- .run(context -> {
-
- StreamingChatLanguageModel streamingChatLanguageModel = context.getBean(StreamingChatLanguageModel.class);
- assertThat(streamingChatLanguageModel).isInstanceOf(QwenStreamingChatModel.class);
- CompletableFuture> future = new CompletableFuture<>();
- streamingChatLanguageModel.generate("What is the capital of Germany?", new StreamingResponseHandler<>() {
-
- @Override
- public void onNext(String token) {
- }
-
- @Override
- public void onComplete(Response response) {
- future.complete(response);
- }
-
- @Override
- public void onError(Throwable error) {
- }
- });
- Response response = future.get(60, SECONDS);
- assertThat(response.content().text()).contains("Berlin");
-
- assertThat(context.getBean(QwenStreamingChatModel.class)).isSameAs(streamingChatLanguageModel);
- });
- }
-
- @Test
- void should_provide_language_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.dashscope.language-model.api-key=" + API_KEY,
- "langchain4j.dashscope.language-model.max-tokens=20"
- )
- .run(context -> {
-
- LanguageModel languageModel = context.getBean(LanguageModel.class);
- assertThat(languageModel).isInstanceOf(QwenLanguageModel.class);
- assertThat(languageModel.generate("What is the capital of Germany?").content()).contains("Berlin");
-
- assertThat(context.getBean(QwenLanguageModel.class)).isSameAs(languageModel);
- });
- }
-
- @Test
- void should_provide_streaming_language_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.dashscope.streaming-language-model.api-key=" + API_KEY,
- "langchain4j.dashscope.streaming-language-model.max-tokens=20"
- )
- .run(context -> {
-
- StreamingLanguageModel streamingLanguageModel = context.getBean(StreamingLanguageModel.class);
- assertThat(streamingLanguageModel).isInstanceOf(QwenStreamingLanguageModel.class);
- CompletableFuture> future = new CompletableFuture<>();
- streamingLanguageModel.generate("What is the capital of Germany?", new StreamingResponseHandler<>() {
-
- @Override
- public void onNext(String token) {
- }
-
- @Override
- public void onComplete(Response response) {
- future.complete(response);
- }
-
- @Override
- public void onError(Throwable error) {
- }
- });
- Response response = future.get(60, SECONDS);
- assertThat(response.content()).contains("Berlin");
-
- assertThat(context.getBean(QwenStreamingLanguageModel.class)).isSameAs(streamingLanguageModel);
- });
- }
-
- @Test
- void should_provide_embedding_model() {
- contextRunner
- .withPropertyValues("langchain4j.dashscope.embedding-model.api-key=" + API_KEY)
- .run(context -> {
-
- EmbeddingModel embeddingModel = context.getBean(EmbeddingModel.class);
- assertThat(embeddingModel).isInstanceOf(QwenEmbeddingModel.class);
- assertThat(embeddingModel.embed("hi").content().dimension()).isEqualTo(1536);
-
- assertThat(context.getBean(QwenEmbeddingModel.class)).isSameAs(embeddingModel);
- });
- }
-}
diff --git a/langchain4j-qianfan-spring-boot-starter/pom.xml b/langchain4j-qianfan-spring-boot-starter/pom.xml
deleted file mode 100644
index 5ea0316c..00000000
--- a/langchain4j-qianfan-spring-boot-starter/pom.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
- 4.0.0
-
- dev.langchain4j
- langchain4j-spring
- 1.0.0-alpha2-SNAPSHOT
- ../pom.xml
-
-
- langchain4j-qianfan-spring-boot-starter
- LangChain4j Spring Boot starter for Qianfan
-
-
- dev.langchain4j
- langchain4j-qianfan
- ${project.version}
-
-
-
- org.springframework.boot
- spring-boot-starter
-
-
-
- org.springframework.boot
- spring-boot-autoconfigure-processor
- true
-
-
-
-
- org.projectlombok
- lombok
- provided
-
-
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
- Apache-2.0
- https://www.apache.org/licenses/LICENSE-2.0.txt
- repo
- A business-friendly OSS license
-
-
-
\ No newline at end of file
diff --git a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/AutoConfig.java b/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/AutoConfig.java
deleted file mode 100644
index 3d70c0ce..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/AutoConfig.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package dev.langchain4j.qianfan.spring;
-
-import dev.langchain4j.model.qianfan.*;
-import org.springframework.boot.autoconfigure.AutoConfiguration;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Bean;
-
-import static dev.langchain4j.qianfan.spring.Properties.PREFIX;
-
-@AutoConfiguration
-@EnableConfigurationProperties(Properties.class)
-public class AutoConfig {
-
- @Bean
- @ConditionalOnProperty(PREFIX + ".chat-model.api-key")
- QianfanChatModel qianfanChatModel(Properties properties) {
- ChatModelProperties chatModelProperties = properties.getChatModel();
- return QianfanChatModel.builder()
- .baseUrl(chatModelProperties.getBaseUrl())
- .apiKey(chatModelProperties.getApiKey())
- .secretKey(chatModelProperties.getSecretKey())
- .endpoint(chatModelProperties.getEndpoint())
- .penaltyScore(chatModelProperties.getPenaltyScore())
- .modelName(chatModelProperties.getModelName())
- .temperature(chatModelProperties.getTemperature())
- .topP(chatModelProperties.getTopP())
- .responseFormat(chatModelProperties.getResponseFormat())
- .maxRetries(chatModelProperties.getMaxRetries())
- .logRequests(chatModelProperties.getLogRequests())
- .logResponses(chatModelProperties.getLogResponses())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(PREFIX + ".streaming-chat-model.api-key")
- QianfanStreamingChatModel qianfanStreamingChatModel(Properties properties) {
- ChatModelProperties chatModelProperties = properties.getStreamingChatModel();
- return QianfanStreamingChatModel.builder()
- .endpoint(chatModelProperties.getEndpoint())
- .penaltyScore(chatModelProperties.getPenaltyScore())
- .temperature(chatModelProperties.getTemperature())
- .topP(chatModelProperties.getTopP())
- .baseUrl(chatModelProperties.getBaseUrl())
- .apiKey(chatModelProperties.getApiKey())
- .secretKey(chatModelProperties.getSecretKey())
- .modelName(chatModelProperties.getModelName())
- .responseFormat(chatModelProperties.getResponseFormat())
- .logRequests(chatModelProperties.getLogRequests())
- .logResponses(chatModelProperties.getLogResponses())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(PREFIX + ".language-model.api-key")
- QianfanLanguageModel qianfanLanguageModel(Properties properties) {
- LanguageModelProperties languageModelProperties = properties.getLanguageModel();
- return QianfanLanguageModel.builder()
- .endpoint(languageModelProperties.getEndpoint())
- .penaltyScore(languageModelProperties.getPenaltyScore())
- .topK(languageModelProperties.getTopK())
- .topP(languageModelProperties.getTopP())
- .baseUrl(languageModelProperties.getBaseUrl())
- .apiKey(languageModelProperties.getApiKey())
- .secretKey(languageModelProperties.getSecretKey())
- .modelName(languageModelProperties.getModelName())
- .temperature(languageModelProperties.getTemperature())
- .maxRetries(languageModelProperties.getMaxRetries())
- .logRequests(languageModelProperties.getLogRequests())
- .logResponses(languageModelProperties.getLogResponses())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(PREFIX + ".streaming-language-model.api-key")
- QianfanStreamingLanguageModel openAiStreamingLanguageModel(Properties properties) {
- LanguageModelProperties languageModelProperties = properties.getStreamingLanguageModel();
- return QianfanStreamingLanguageModel.builder()
- .endpoint(languageModelProperties.getEndpoint())
- .penaltyScore(languageModelProperties.getPenaltyScore())
- .topK(languageModelProperties.getTopK())
- .topP(languageModelProperties.getTopP())
- .baseUrl(languageModelProperties.getBaseUrl())
- .apiKey(languageModelProperties.getApiKey())
- .secretKey(languageModelProperties.getSecretKey())
- .modelName(languageModelProperties.getModelName())
- .temperature(languageModelProperties.getTemperature())
- .maxRetries(languageModelProperties.getMaxRetries())
- .logRequests(languageModelProperties.getLogRequests())
- .logResponses(languageModelProperties.getLogResponses())
- .build();
- }
-
- @Bean
- @ConditionalOnProperty(PREFIX + ".embedding-model.api-key")
- QianfanEmbeddingModel qianfanEmbeddingModel(Properties properties) {
- EmbeddingModelProperties embeddingModelProperties = properties.getEmbeddingModel();
- return QianfanEmbeddingModel.builder()
- .baseUrl(embeddingModelProperties.getBaseUrl())
- .endpoint(embeddingModelProperties.getEndpoint())
- .apiKey(embeddingModelProperties.getApiKey())
- .secretKey(embeddingModelProperties.getSecretKey())
- .modelName(embeddingModelProperties.getModelName())
- .user(embeddingModelProperties.getUser())
- .maxRetries(embeddingModelProperties.getMaxRetries())
- .logRequests(embeddingModelProperties.getLogRequests())
- .logResponses(embeddingModelProperties.getLogResponses())
- .build();
- }
-}
\ No newline at end of file
diff --git a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/ChatModelProperties.java b/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/ChatModelProperties.java
deleted file mode 100644
index 703e9d20..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/ChatModelProperties.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package dev.langchain4j.qianfan.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.NestedConfigurationProperty;
-
-import java.time.Duration;
-import java.util.List;
-import java.util.Map;
-
-@Getter
-@Setter
-class ChatModelProperties {
- String baseUrl;
- String apiKey;
- String secretKey;
- Double temperature;
- Integer maxRetries;
- Double topP;
- String modelName;
- String endpoint;
- String responseFormat;
- Double penaltyScore;
- Boolean logRequests;
- Boolean logResponses;
-}
\ No newline at end of file
diff --git a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/EmbeddingModelProperties.java b/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/EmbeddingModelProperties.java
deleted file mode 100644
index 41dbba67..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/EmbeddingModelProperties.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package dev.langchain4j.qianfan.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.NestedConfigurationProperty;
-
-import java.time.Duration;
-
-@Getter
-@Setter
-class EmbeddingModelProperties {
-
- String baseUrl;
- String apiKey;
- String secretKey;
- Integer maxRetries;
- String modelName;
- String endpoint;
- String user;
- Boolean logRequests;
- Boolean logResponses;
-}
\ No newline at end of file
diff --git a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/LanguageModelProperties.java b/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/LanguageModelProperties.java
deleted file mode 100644
index 135bfb73..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/LanguageModelProperties.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package dev.langchain4j.qianfan.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.NestedConfigurationProperty;
-
-import java.time.Duration;
-
-@Getter
-@Setter
-class LanguageModelProperties {
-
- String baseUrl;
- String apiKey;
- String secretKey;
- Double temperature;
- Integer maxRetries;
- Integer topK;
- Double topP;
- String modelName;
- String endpoint;
- Double penaltyScore;
- Boolean logRequests;
- Boolean logResponses;
-}
\ No newline at end of file
diff --git a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/Properties.java b/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/Properties.java
deleted file mode 100644
index 7f809283..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/main/java/dev/langchain4j/qianfan/spring/Properties.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package dev.langchain4j.qianfan.spring;
-
-import lombok.Getter;
-import lombok.Setter;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.NestedConfigurationProperty;
-
-@Getter
-@Setter
-@ConfigurationProperties(prefix = Properties.PREFIX)
-public class Properties {
-
- static final String PREFIX = "langchain4j.qianfan";
-
- @NestedConfigurationProperty
- ChatModelProperties chatModel;
-
- @NestedConfigurationProperty
- ChatModelProperties streamingChatModel;
-
- @NestedConfigurationProperty
- LanguageModelProperties languageModel;
-
- @NestedConfigurationProperty
- LanguageModelProperties streamingLanguageModel;
-
- @NestedConfigurationProperty
- EmbeddingModelProperties embeddingModel;
-}
diff --git a/langchain4j-qianfan-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/langchain4j-qianfan-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
deleted file mode 100644
index 610d79a9..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
+++ /dev/null
@@ -1 +0,0 @@
-dev.langchain4j.qianfan.spring.AutoConfig
\ No newline at end of file
diff --git a/langchain4j-qianfan-spring-boot-starter/src/test/java/dev/langchain4j/qianfan/spring/AutoConfigIT.java b/langchain4j-qianfan-spring-boot-starter/src/test/java/dev/langchain4j/qianfan/spring/AutoConfigIT.java
deleted file mode 100644
index 876265b7..00000000
--- a/langchain4j-qianfan-spring-boot-starter/src/test/java/dev/langchain4j/qianfan/spring/AutoConfigIT.java
+++ /dev/null
@@ -1,163 +0,0 @@
-package dev.langchain4j.qianfan.spring;
-
-import dev.langchain4j.data.message.AiMessage;
-import dev.langchain4j.model.StreamingResponseHandler;
-import dev.langchain4j.model.chat.ChatLanguageModel;
-import dev.langchain4j.model.chat.StreamingChatLanguageModel;
-import dev.langchain4j.model.embedding.EmbeddingModel;
-import dev.langchain4j.model.language.LanguageModel;
-import dev.langchain4j.model.language.StreamingLanguageModel;
-import dev.langchain4j.model.output.Response;
-import dev.langchain4j.model.qianfan.*;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
-import org.springframework.boot.autoconfigure.AutoConfigurations;
-import org.springframework.boot.test.context.runner.ApplicationContextRunner;
-
-import java.util.concurrent.CompletableFuture;
-
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.assertj.core.api.Assertions.assertThat;
-
-/**
- * @Author: fanjia
- * @createTime: 2024年04月18日 12:54:25
- * @version: 1.0
- * @Description:
- */
-@EnabledIfEnvironmentVariable(named = "QIANFAN_API_KEY", matches = ".+")
-class AutoConfigIT {
-
- private static final String API_KEY = System.getenv("QIANFAN_API_KEY");
- private static final String SECRET_KEY = System.getenv("QIANFAN_SECRET_KEY");
-
- ApplicationContextRunner contextRunner = new ApplicationContextRunner()
- .withConfiguration(AutoConfigurations.of(AutoConfig.class));
-
- @Test
- void should_provide_chat_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.qianfan.chat-model.api-key=" + API_KEY,
- "langchain4j.qianfan.chat-model.secret_key="+SECRET_KEY,
- "langchain4j.qianfan.chat-model.endpoint=ernie-3.5-8k-1222"
- )
- .run(context -> {
-
- ChatLanguageModel chatLanguageModel = context.getBean(ChatLanguageModel.class);
- assertThat(chatLanguageModel).isInstanceOf(QianfanChatModel.class);
- assertThat(chatLanguageModel.generate("What is the capital of Germany?")).contains("柏林");
-
- assertThat(context.getBean(QianfanChatModel.class)).isSameAs(chatLanguageModel);
- });
- }
-
- @Test
- void should_provide_streaming_chat_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.qianfan.streamingChatModel.api-key=" + API_KEY,
- "langchain4j.qianfan.streamingChatModel.secret_key="+SECRET_KEY,
- "langchain4j.qianfan.streamingChatModel.endpoint=ernie-3.5-8k-1222"
- )
- .run(context -> {
-
- StreamingChatLanguageModel streamingChatLanguageModel = context.getBean(StreamingChatLanguageModel.class);
- assertThat(streamingChatLanguageModel).isInstanceOf(QianfanStreamingChatModel.class);
- CompletableFuture> future = new CompletableFuture<>();
- streamingChatLanguageModel.generate("德国的首都是哪里?", new StreamingResponseHandler() {
-
- @Override
- public void onNext(String token) {
- }
-
- @Override
- public void onComplete(Response response) {
- future.complete(response);
- }
-
- @Override
- public void onError(Throwable error) {
- }
- });
- Response response = future.get(60, SECONDS);
- assertThat(response.content().text()).isNotNull();
-
- assertThat(context.getBean(QianfanStreamingChatModel.class)).isSameAs(streamingChatLanguageModel);
- });
- }
-
- @Test
- void should_provide_language_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.qianfan.languageModel.api-key=" + API_KEY,
- "langchain4j.qianfan.languageModel.secret_key="+SECRET_KEY,
- "langchain4j.qianfan.languageModel.modelName=CodeLlama-7b-Instruct",
- "langchain4j.qianfan.languageModel.logRequests=true",
- "langchain4j.qianfan.languageModel.logResponses=true"
- )
- .run(context -> {
-
- LanguageModel languageModel = context.getBean(LanguageModel.class);
- assertThat(languageModel).isInstanceOf(QianfanLanguageModel.class);
- assertThat(languageModel.generate("What is the capital of Germany?").content()).contains("Berlin");
- assertThat(context.getBean(QianfanLanguageModel.class)).isSameAs(languageModel);
- });
- }
-
- @Test
- void should_provide_streaming_language_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.qianfan.streamingLanguageModel.api-key=" + API_KEY,
- "langchain4j.qianfan.streamingLanguageModel.secret_key="+SECRET_KEY,
- "langchain4j.qianfan.streamingLanguageModel.modelName=CodeLlama-7b-Instruct",
- "langchain4j.qianfan.streamingLanguageModel.logRequests=true",
- "langchain4j.qianfan.streamingLanguageModel.logResponses=true"
- )
- .run(context -> {
-
- StreamingLanguageModel streamingLanguageModel = context.getBean(StreamingLanguageModel.class);
- assertThat(streamingLanguageModel).isInstanceOf(QianfanStreamingLanguageModel.class);
- CompletableFuture> future = new CompletableFuture<>();
- streamingLanguageModel.generate("What is the capital of Germany?", new StreamingResponseHandler() {
-
- @Override
- public void onNext(String token) {
- }
-
- @Override
- public void onComplete(Response response) {
- future.complete(response);
- }
-
- @Override
- public void onError(Throwable error) {
- }
- });
- Response response = future.get(60, SECONDS);
- assertThat(response.content()).isNotNull();
-
- assertThat(context.getBean(QianfanStreamingLanguageModel.class)).isSameAs(streamingLanguageModel);
- });
- }
-
- @Test
- void should_provide_embedding_model() {
- contextRunner
- .withPropertyValues(
- "langchain4j.qianfan.embeddingModel.api-key=" + API_KEY,
- "langchain4j.qianfan.embeddingModel.secret_key="+SECRET_KEY,
- "langchain4j.qianfan.embeddingModel.modelName=bge-large-zh"
- )
- .run(context -> {
-
- EmbeddingModel embeddingModel = context.getBean(EmbeddingModel.class);
- assertThat(embeddingModel).isInstanceOf(QianfanEmbeddingModel.class);
- assertThat(embeddingModel.embed("hi").content().dimension()).isEqualTo(1024);
-
- assertThat(context.getBean(QianfanEmbeddingModel.class)).isSameAs(embeddingModel);
- });
- }
-}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index f41d62a7..8526470f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,9 +28,7 @@
langchain4j-vertex-ai-gemini-spring-boot-starter
langchain4j-elasticsearch-spring-boot-starter
langchain4j-redis-spring-boot-starter
-
langchain4j-milvus-spring-boot-starter
-
langchain4j-reactor