Skip to content

Commit

Permalink
Merge branch 'main' into polish-rag
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli authored Jan 6, 2025
2 parents aa7f8c0 + b313655 commit 1328f0d
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"configurations": [
{
"type": "java",
"name": "LangChain4JAIServicesDemo",
"request": "launch",
"mainClass": "com.learning.openai.LangChain4JAIServicesDemo",
"projectName": "playground-langchain4j"
},
{
"type": "java",
"name": "LangChain4JObservabilityDemo",
Expand Down
2 changes: 1 addition & 1 deletion chatbot/chatbot-ollama-springai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion chatmodel-springai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
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;
import org.springframework.http.HttpRequest;
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)
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion embeddingstores/neo4j-springai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion embeddingstores/pgvector-langchain4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion embeddingstores/pgvector-springai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion rag/rag-langchain4j-AllMiniLmL6V2-llm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion rag/rag-springai-ollama-llm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion rag/rag-springai-openai-llm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.7.0</version>
<version>2.8.1</version>
</dependency>

<dependency>
Expand Down

0 comments on commit 1328f0d

Please sign in to comment.