Skip to content

Commit

Permalink
Rename classes
Browse files Browse the repository at this point in the history
  • Loading branch information
kszapsza committed Dec 12, 2024
1 parent a91845a commit b2cab43
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.kszapsza.springairag.adapter.llm.data;
package io.github.kszapsza.springairag.adapter.application;

import io.github.kszapsza.springairag.domain.embedding.EmbeddingsFeeder;
import org.springframework.boot.context.event.ApplicationReadyEvent;
Expand All @@ -8,11 +8,11 @@

@Component
@Profile("local")
public class EmbeddingsStartupListener {
public class ApplicationStartupListener {

private final EmbeddingsFeeder embeddingsFeeder;

public EmbeddingsStartupListener(EmbeddingsFeeder embeddingsFeeder) {
public ApplicationStartupListener(EmbeddingsFeeder embeddingsFeeder) {
this.embeddingsFeeder = embeddingsFeeder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@Configuration
public class ChatConfiguration {

@Bean
ChatService chatService(ChatProvider chatProvider) {
return new ChatService(chatProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import org.springframework.stereotype.Component;

@Component
public class ResourceEmbeddingDataProvider implements EmbeddingDataProvider {
public class ClasspathEmbeddingDataProvider implements EmbeddingDataProvider {

private static final Logger logger = LoggerFactory.getLogger(ResourceEmbeddingDataProvider.class);
private static final Logger logger = LoggerFactory.getLogger(ClasspathEmbeddingDataProvider.class);

private final List<Document> data;

public ResourceEmbeddingDataProvider(
public ClasspathEmbeddingDataProvider(
@Value("classpath:/embedding/faq-data.json") Resource exampleDocumentResource) {
if (exampleDocumentResource == null || !exampleDocumentResource.exists()
|| !exampleDocumentResource.isReadable()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,22 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ai.vectorstore.VectorStore;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;

import io.github.kszapsza.springairag.adapter.llm.data.ResourceEmbeddingDataProvider;
import io.github.kszapsza.springairag.adapter.llm.data.EmbeddingDataProvider;
import io.github.kszapsza.springairag.domain.embedding.EmbeddingsFeeder;

@Component
public class OpenAiEmbeddingsFeeder implements EmbeddingsFeeder {

private static final Logger logger = LoggerFactory.getLogger(OpenAiEmbeddingsFeeder.class);

private final ResourceEmbeddingDataProvider dataProvider;
private final EmbeddingDataProvider dataProvider;
private final VectorStore vectorStore;

public OpenAiEmbeddingsFeeder(
JdbcTemplate jdbcTemplate,
VectorStore vectorStore,
ResourceEmbeddingDataProvider dataProvider) {
EmbeddingDataProvider dataProvider) {
this.vectorStore = vectorStore;
this.dataProvider = dataProvider;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import org.springframework.stereotype.Component;

@Component
public class ResourceSystemPromptTemplateProvider implements SystemPromptTemplateProvider {
public class ClasspathSystemPromptTemplateProvider implements SystemPromptTemplateProvider {

private static final Logger logger = LoggerFactory.getLogger(ResourceSystemPromptTemplateProvider.class);
private static final Logger logger = LoggerFactory.getLogger(ClasspathSystemPromptTemplateProvider.class);

private final SystemPromptTemplate systemPromptTemplate;

public ResourceSystemPromptTemplateProvider(
public ClasspathSystemPromptTemplateProvider(
@Value("classpath:/chat/system-message.txt") Resource systemPromptResource) {
if (systemPromptResource == null || !systemPromptResource.exists() || !systemPromptResource.isReadable()) {
throw new IllegalStateException("System prompt resource is missing or not readable");
Expand Down

0 comments on commit b2cab43

Please sign in to comment.