Skip to content

Commit

Permalink
upgrade docker
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Dec 24, 2024
1 parent d03f105 commit cbe0c01
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
31 changes: 25 additions & 6 deletions rag/rag-springai-ollama-llm/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
services:
ollama:
image: langchain4j/ollama-llama3:latest
image: langchain4j/ollama-mistral:latest
ports:
- '11434:11434'
redis-stack:
image: redis/redis-stack-server
ports:
- '6379:6379'

postgresqldb:
container_name: postgresqldb
image: pgvector/pgvector:pg17
extra_hosts: [ 'host.docker.internal:host-gateway' ]
restart: always
environment:
- POSTGRES_USER=appuser
- POSTGRES_PASSWORD=secret
- POSTGRES_DB=appdb
- PGPASSWORD=secret
logging:
options:
max-size: 10m
max-file: "3"
ports:
- '5432:5432'
healthcheck:
test: "pg_isready -U appuser -d appdb"
interval: 2s
timeout: 20s
retries: 10

lgtm-stack:
image: grafana/otel-lgtm:0.8.0
image: grafana/otel-lgtm:0.8.1
extra_hosts: ['host.docker.internal:host-gateway']
container_name: lgtm-stack
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.slf4j.LoggerFactory;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.RetrievalAugmentationAdvisor;
import org.springframework.ai.chat.prompt.AssistantPromptTemplate;
import org.springframework.ai.rag.generation.augmentation.ContextualQueryAugmenter;
import org.springframework.ai.rag.retrieval.search.VectorStoreDocumentRetriever;
import org.springframework.ai.vectorstore.VectorStore;
Expand All @@ -15,17 +14,6 @@ public class AIChatService {

private static final Logger LOGGER = LoggerFactory.getLogger(AIChatService.class);

private static final String template =
"""
You are a helpful assistant, conversing with a user about the subjects contained in a set of documents.
Use the information from the DOCUMENTS section to provide accurate answers. If unsure or if the answer
isn't found in the DOCUMENTS section, simply state that you don't know the answer.
DOCUMENTS:
{query}
""";

private final ChatClient aiClient;

public AIChatService(ChatClient.Builder builder, VectorStore vectorStore) {
Expand All @@ -35,10 +23,8 @@ public AIChatService(ChatClient.Builder builder, VectorStore vectorStore) {
.similarityThreshold(0.50)
.build();

var queryAugmenter = ContextualQueryAugmenter.builder()
.promptTemplate(new AssistantPromptTemplate(template))
.allowEmptyContext(true)
.build();
var queryAugmenter =
ContextualQueryAugmenter.builder().allowEmptyContext(true).build();

RetrievalAugmentationAdvisor retrievalAugmentationAdvisor = RetrievalAugmentationAdvisor.builder()
.documentRetriever(documentRetriever)
Expand Down

0 comments on commit cbe0c01

Please sign in to comment.