Skip to content

Commit

Permalink
feat : change model for ollamma
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed May 3, 2024
1 parent 9c53147 commit 845f81a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ spring.application.name=rag-springai-ollama-llm
spring.threads.virtual.enabled=true
spring.mvc.problemdetails.enabled=true

spring.ai.ollama.chat.options.model=llama2
spring.ai.ollama.chat.options.model=orca-mini

spring.ai.ollama.embedding.options.model=llama2
spring.ai.ollama.embedding.options.model=orca-mini

spring.ai.vectorstore.redis.index=vector_store
spring.ai.vectorstore.redis.prefix=ai

spring.ai.ollama.baseUrl=http://localhost:11434

spring.testcontainers.beans.startup=parallel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void setUp() {
@Test
void testRag() {
given().contentType(ContentType.JSON)
.body(new AIChatRequest("Is Rohit Sharma batsman?"))
.body(new AIChatRequest("Records held by Rohit Sharma ?"))
.when()
.post("/api/ai/chat")
.then()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public class TestLlmRagWithSpringAiApplication {

@Bean
OllamaContainer ollama(DynamicPropertyRegistry properties) {
OllamaContainer ollama = new OllamaContainer(
DockerImageName.parse("langchain4j/ollama-llama2:latest").asCompatibleSubstituteFor("ollama/ollama"));
// The model name to use (e.g., "orca-mini", "mistral", "llama2", "codellama", "phi", or
// "tinyllama")
OllamaContainer ollama = new OllamaContainer(DockerImageName.parse("langchain4j/ollama-orca-mini:latest")
.asCompatibleSubstituteFor("ollama/ollama"));
properties.add("spring.ai.ollama.base-url", ollama::getEndpoint);
return ollama;
}
Expand Down

0 comments on commit 845f81a

Please sign in to comment.