diff --git a/.vscode/launch.json b/.vscode/launch.json
index 3b80028..f385298 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,5 +1,12 @@
{
"configurations": [
+ {
+ "type": "java",
+ "name": "LangChain4JAIServicesDemo",
+ "request": "launch",
+ "mainClass": "com.learning.openai.LangChain4JAIServicesDemo",
+ "projectName": "playground-langchain4j"
+ },
{
"type": "java",
"name": "LangChain4JObservabilityDemo",
diff --git a/chatbot/chatbot-ollama-springai/pom.xml b/chatbot/chatbot-ollama-springai/pom.xml
index c72a303..ea00380 100644
--- a/chatbot/chatbot-ollama-springai/pom.xml
+++ b/chatbot/chatbot-ollama-springai/pom.xml
@@ -42,7 +42,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/chatmodel-springai/pom.xml b/chatmodel-springai/pom.xml
index be995b2..e97e3ce 100644
--- a/chatmodel-springai/pom.xml
+++ b/chatmodel-springai/pom.xml
@@ -47,7 +47,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/chatmodel-springai/src/main/java/com/example/ai/config/LoggingConfig.java b/chatmodel-springai/src/main/java/com/example/ai/config/LoggingConfig.java
index 7aa3740..2d50776 100644
--- a/chatmodel-springai/src/main/java/com/example/ai/config/LoggingConfig.java
+++ b/chatmodel-springai/src/main/java/com/example/ai/config/LoggingConfig.java
@@ -7,6 +7,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.http.client.ClientHttpRequestFactoryBuilder;
import org.springframework.boot.web.client.RestClientCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -14,7 +15,6 @@
import org.springframework.http.MediaType;
import org.springframework.http.client.BufferingClientHttpRequestFactory;
import org.springframework.http.client.ClientHttpResponse;
-import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.util.StreamUtils;
@Configuration(proxyBeanMethods = false)
@@ -26,7 +26,8 @@ public class LoggingConfig {
@Bean
RestClientCustomizer restClientCustomizer() {
return restClientBuilder -> restClientBuilder
- .requestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()))
+ .requestFactory(new BufferingClientHttpRequestFactory(
+ ClientHttpRequestFactoryBuilder.httpComponents().build()))
.requestInterceptor((request, body, execution) -> {
logRequest(request, body);
ClientHttpResponse response = execution.execute(request, body);
diff --git a/embeddingstores/neo4j-springai/pom.xml b/embeddingstores/neo4j-springai/pom.xml
index 98e4a92..dbe91ae 100644
--- a/embeddingstores/neo4j-springai/pom.xml
+++ b/embeddingstores/neo4j-springai/pom.xml
@@ -43,7 +43,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/embeddingstores/pgvector-langchain4j/pom.xml b/embeddingstores/pgvector-langchain4j/pom.xml
index dfea680..b6cefaf 100644
--- a/embeddingstores/pgvector-langchain4j/pom.xml
+++ b/embeddingstores/pgvector-langchain4j/pom.xml
@@ -48,7 +48,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/embeddingstores/pgvector-springai/pom.xml b/embeddingstores/pgvector-springai/pom.xml
index c1a67e2..dba5535 100644
--- a/embeddingstores/pgvector-springai/pom.xml
+++ b/embeddingstores/pgvector-springai/pom.xml
@@ -44,7 +44,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/playground-langchain4j/src/main/java/com/learning/openai/LangChain4JAIServicesDemo.java b/playground-langchain4j/src/main/java/com/learning/openai/LangChain4JAIServicesDemo.java
index 2dad94e..41bb575 100644
--- a/playground-langchain4j/src/main/java/com/learning/openai/LangChain4JAIServicesDemo.java
+++ b/playground-langchain4j/src/main/java/com/learning/openai/LangChain4JAIServicesDemo.java
@@ -8,15 +8,16 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.Optional;
+
public class LangChain4JAIServicesDemo {
private static final Logger LOGGER = LoggerFactory.getLogger(LangChain4JAIServicesDemo.class);
public static void main(String[] args) {
- // String openAIKey = System.getenv("OPEN_AI_KEY");
- // OpenAiChatModel openAiChatModel = OpenAiChatModel.withApiKey("demo");
+ String openAIKey = System.getenv("OPEN_AI_KEY");
OpenAiChatModel openAiChatModel = OpenAiChatModel.builder()
- .apiKey("demo")
+ .apiKey(Optional.ofNullable(openAIKey).orElse("demo"))
.modelName(OpenAiChatModelName.GPT_4_O_MINI)
.logRequests(false)
.logResponses(false)
diff --git a/rag/rag-langchain4j-AllMiniLmL6V2-llm/pom.xml b/rag/rag-langchain4j-AllMiniLmL6V2-llm/pom.xml
index 3fb3ac8..736af91 100644
--- a/rag/rag-langchain4j-AllMiniLmL6V2-llm/pom.xml
+++ b/rag/rag-langchain4j-AllMiniLmL6V2-llm/pom.xml
@@ -67,7 +67,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/rag/rag-springai-ollama-llm/pom.xml b/rag/rag-springai-ollama-llm/pom.xml
index 1730d20..6088efe 100644
--- a/rag/rag-springai-ollama-llm/pom.xml
+++ b/rag/rag-springai-ollama-llm/pom.xml
@@ -53,7 +53,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1
diff --git a/rag/rag-springai-openai-llm/pom.xml b/rag/rag-springai-openai-llm/pom.xml
index 670b46f..f43bab3 100644
--- a/rag/rag-springai-openai-llm/pom.xml
+++ b/rag/rag-springai-openai-llm/pom.xml
@@ -61,7 +61,7 @@
org.springdoc
springdoc-openapi-starter-webmvc-ui
- 2.7.0
+ 2.8.1