diff --git a/chatbot/chatbot-ollama-springai/src/main/resources/application.properties b/chatbot/chatbot-ollama-springai/src/main/resources/application.properties index 8823695..70560b8 100644 --- a/chatbot/chatbot-ollama-springai/src/main/resources/application.properties +++ b/chatbot/chatbot-ollama-springai/src/main/resources/application.properties @@ -6,4 +6,4 @@ spring.mvc.problemdetails.enabled=true spring.ai.ollama.chat.options.model=llama3 spring.ai.ollama.embedding.options.model=llama3 -spring.testcontainers.beans.startup=parallel +spring.testcontainers.beans.startup=parallel \ No newline at end of file diff --git a/embeddingstores/pgvector-springai/pom.xml b/embeddingstores/pgvector-springai/pom.xml index d5c842b..6714e1d 100644 --- a/embeddingstores/pgvector-springai/pom.xml +++ b/embeddingstores/pgvector-springai/pom.xml @@ -18,7 +18,7 @@ UTF-8 21 - 1.0.0-M1 + 1.0.0-M2 2.43.0 @@ -99,7 +99,7 @@ - 2.47.0 + 2.50.0 diff --git a/embeddingstores/pgvector-springai/src/main/java/com/learning/ai/PgVectorEmbeddingStoreExample.java b/embeddingstores/pgvector-springai/src/main/java/com/learning/ai/PgVectorOpenAIEmbeddingStoreExample.java similarity index 63% rename from embeddingstores/pgvector-springai/src/main/java/com/learning/ai/PgVectorEmbeddingStoreExample.java rename to embeddingstores/pgvector-springai/src/main/java/com/learning/ai/PgVectorOpenAIEmbeddingStoreExample.java index 4b50ab0..78b3b8d 100644 --- a/embeddingstores/pgvector-springai/src/main/java/com/learning/ai/PgVectorEmbeddingStoreExample.java +++ b/embeddingstores/pgvector-springai/src/main/java/com/learning/ai/PgVectorOpenAIEmbeddingStoreExample.java @@ -4,9 +4,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class PgVectorEmbeddingStoreExample { +public class PgVectorOpenAIEmbeddingStoreExample { public static void main(String[] args) { - SpringApplication.run(PgVectorEmbeddingStoreExample.class, args); + SpringApplication.run(PgVectorOpenAIEmbeddingStoreExample.class, args); } } diff --git a/embeddingstores/pgvector-springai/src/main/resources/application.properties b/embeddingstores/pgvector-springai/src/main/resources/application.properties index 54b18ca..859a3f0 100644 --- a/embeddingstores/pgvector-springai/src/main/resources/application.properties +++ b/embeddingstores/pgvector-springai/src/main/resources/application.properties @@ -5,7 +5,7 @@ spring.ai.openai.base-url=http://langchain4j.dev/demo/openai spring.ai.openai.image.enabled=false spring.ai.openai.chat.options.temperature=0.7 spring.ai.openai.chat.options.model=gpt-4o-mini -spring.ai.openai.chat.options.responseFormat=json_object +spring.ai.openai.chat.options.responseFormat.type=json_schema spring.ai.openai.embedding.options.model=text-embedding-3-small spring.threads.virtual.enabled=true @@ -14,4 +14,5 @@ spring.threads.virtual.enabled=true #PgVector spring.ai.vectorstore.pgvector.dimensions=1536 ## only for development -spring.ai.vectorstore.pgvector.removeExistingVectorStoreTable=true \ No newline at end of file +spring.ai.vectorstore.pgvector.removeExistingVectorStoreTable=true +spring.ai.vectorstore.pgvector.initialize-schema=true \ No newline at end of file diff --git a/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/TestPgVectorEmbeddingStoreExample.java b/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/TestPgVectorOpenAIEmbeddingStoreExample.java similarity index 68% rename from embeddingstores/pgvector-springai/src/test/java/com/learning/ai/TestPgVectorEmbeddingStoreExample.java rename to embeddingstores/pgvector-springai/src/test/java/com/learning/ai/TestPgVectorOpenAIEmbeddingStoreExample.java index a0ce954..a08be3e 100644 --- a/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/TestPgVectorEmbeddingStoreExample.java +++ b/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/TestPgVectorOpenAIEmbeddingStoreExample.java @@ -7,11 +7,11 @@ @TestConfiguration(proxyBeanMethods = false) @ImportTestcontainers(ContainersConfig.class) -public class TestPgVectorEmbeddingStoreExample { +public class TestPgVectorOpenAIEmbeddingStoreExample { public static void main(String[] args) { - SpringApplication.from(PgVectorEmbeddingStoreExample::main) - .with(TestPgVectorEmbeddingStoreExample.class) + SpringApplication.from(PgVectorOpenAIEmbeddingStoreExample::main) + .with(TestPgVectorOpenAIEmbeddingStoreExample.class) .run(args); } } diff --git a/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/controller/QueryControllerTest.java b/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/controller/QueryControllerTest.java index 7f5e214..4dddb14 100644 --- a/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/controller/QueryControllerTest.java +++ b/embeddingstores/pgvector-springai/src/test/java/com/learning/ai/controller/QueryControllerTest.java @@ -3,7 +3,7 @@ import static io.restassured.RestAssured.given; import static org.hamcrest.Matchers.equalTo; -import com.learning.ai.TestPgVectorEmbeddingStoreExample; +import com.learning.ai.TestPgVectorOpenAIEmbeddingStoreExample; import io.restassured.RestAssured; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -13,7 +13,7 @@ @SpringBootTest( webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, - classes = TestPgVectorEmbeddingStoreExample.class) + classes = TestPgVectorOpenAIEmbeddingStoreExample.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) class QueryControllerTest { diff --git a/rag/rag-springai-ollama-llm/src/main/resources/application.properties b/rag/rag-springai-ollama-llm/src/main/resources/application.properties index 9870b16..6a0724c 100644 --- a/rag/rag-springai-ollama-llm/src/main/resources/application.properties +++ b/rag/rag-springai-ollama-llm/src/main/resources/application.properties @@ -12,7 +12,7 @@ spring.ai.ollama.embedding.options.model=nomic-embed-text spring.ai.vectorstore.redis.index=vector_store spring.ai.vectorstore.redis.prefix=ai -spring.ai.vectorstore.redis.initializeSchema=true +spring.ai.vectorstore.redis.initialize-schema=true spring.ai.ollama.baseUrl=http://localhost:11434 diff --git a/rag/rag-springai-openai-llm/pom.xml b/rag/rag-springai-openai-llm/pom.xml index 6e42756..d7f9a6b 100644 --- a/rag/rag-springai-openai-llm/pom.xml +++ b/rag/rag-springai-openai-llm/pom.xml @@ -120,7 +120,7 @@ - 2.47.0 + 2.50.0 diff --git a/rag/rag-springai-openai-llm/src/main/resources/application.properties b/rag/rag-springai-openai-llm/src/main/resources/application.properties index fe4dfac..ffe001c 100644 --- a/rag/rag-springai-openai-llm/src/main/resources/application.properties +++ b/rag/rag-springai-openai-llm/src/main/resources/application.properties @@ -5,8 +5,9 @@ spring.mvc.problemdetails.enabled=true spring.ai.openai.api-key=demo spring.ai.openai.base-url=http://langchain4j.dev/demo/openai -spring.ai.openai.chat.options.model=gpt-3.5-turbo +spring.ai.openai.chat.options.model=gpt-4o-mini spring.ai.openai.chat.options.temperature=0.2 spring.ai.openai.chat.options.responseFormat=json_object +spring.ai.openai.embedding.options.model=text-embedding-3-small #spring.ai.openai.image.model=dall-e-3