Skip to content

Commit

Permalink
feat : adds connection readtimeout to 5 min
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Apr 1, 2024
1 parent 6bab7a0 commit cb29e84
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

AI implementations using java, stores and either of Langchain4j or springai framework

| Module Name | Description |
|----------------------------------------------------------------------|---------------------------------------------------------------------------------------|
| [opensearch langchain4j](./ai-opensearch-langchain4j) | Embeddings implementation using langchain4j and opensearch store |
| [chatmodel springai](./chatmodel-springai) | AI chat playground using springai |
| [pgvector lanchain4j](./pgvector-langchain4j) | Embeddings implementation using langchain4j and pgvector |
| [pgvector springai](./pgvector-springai) | Embeddings implementation using springai and pgvector |
| [playground](./playground) | AI playground using Langchain4j |
| [rag langchain4j AllMiniLmL6V2](./rag-langchain4j-AllMiniLmL6V2-llm) | RAG Implementation using Langchain4j, PGVector store and openai LLM |
| [rag springai ollama llm](./rag-springai-ollama-llm) | RAG Implementation using springai, Redis store and ollama LLM with llama2 model |
| [rag springai openai llm](./rag-springai-openai-llm) | RAG Implementation using springai, PGVector store and openai LLM |
| **_Module Name_** | **_Description_** |
|----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| [opensearch langchain4j](./ai-opensearch-langchain4j) | Embeddings implementation using langchain4j and opensearch store |
| [chatmodel springai](./chatmodel-springai) | AI chat playground using springai |
| [pgvector lanchain4j](./pgvector-langchain4j) | Embeddings implementation using langchain4j and pgvector |
| [pgvector springai](./pgvector-springai) | Embeddings implementation using springai and pgvector |
| [playground](./playground) | AI playground using Langchain4j |
| [rag langchain4j AllMiniLmL6V2](./rag-langchain4j-AllMiniLmL6V2-llm) | RAG Implementation using Langchain4j, PGVector store and openai LLM |
| [rag springai ollama llm](./rag-springai-ollama-llm) | RAG Implementation using springai, Redis store, PDF document reader and ollama LLM with llama2 model |
| [rag springai openai llm](./rag-springai-openai-llm) | RAG Implementation using springai, PGVector store, Tika document reader and openai LLM |

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.learning.ai.llmragwithspringai.config;

import java.time.Duration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.JdkClientHttpRequestFactory;
import org.springframework.web.client.RestClient;

@Configuration(proxyBeanMethods = false)
public class RestClientBuilderConfig {

@Bean
RestClient.Builder restClientBuilder(JdkClientHttpRequestFactory jdkClientHttpRequestFactory) {
return RestClient.builder().requestFactory(jdkClientHttpRequestFactory);
}

@Bean
JdkClientHttpRequestFactory jdkClientHttpRequestFactory() {
JdkClientHttpRequestFactory jdkClientHttpRequestFactory = new JdkClientHttpRequestFactory();
jdkClientHttpRequestFactory.setReadTimeout(Duration.ofMinutes(5));
return jdkClientHttpRequestFactory;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/ai")
Expand Down

0 comments on commit cb29e84

Please sign in to comment.