Skip to content

Commit 6ffbb3a

Browse files
committed
Add simple hello world test to reproduce issue #2957 with qwen/ollama
1 parent bfcaad7 commit 6ffbb3a

File tree

1 file changed

+19
-0
lines changed
  • auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/java/org/springframework/ai/model/ollama/autoconfigure/tool

1 file changed

+19
-0
lines changed

auto-configurations/models/spring-ai-autoconfigure-model-ollama/src/test/java/org/springframework/ai/model/ollama/autoconfigure/tool/OllamaFunctionCallbackIT.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.slf4j.LoggerFactory;
2626
import reactor.core.publisher.Flux;
2727

28+
import org.springframework.ai.chat.client.ChatClient;
2829
import org.springframework.ai.chat.messages.AssistantMessage;
2930
import org.springframework.ai.chat.messages.UserMessage;
3031
import org.springframework.ai.chat.model.ChatResponse;
@@ -65,6 +66,24 @@ public static void beforeAll() {
6566
initializeOllama(MODEL_NAME);
6667
}
6768

69+
/**
70+
* See https://github.com/spring-projects/spring-ai/issues/2957
71+
*/
72+
@Test
73+
void chatClientHelloWorld() {
74+
this.contextRunner.run(context -> {
75+
76+
OllamaChatModel chatModel = context.getBean(OllamaChatModel.class);
77+
ChatClient chatClient = ChatClient.builder(chatModel).build();
78+
79+
UserMessage userMessage = new UserMessage("What is 2+2");
80+
81+
var response = chatClient.prompt(new Prompt(userMessage)).call().content();
82+
logger.info("Response: " + response);
83+
84+
});
85+
}
86+
6887
@Test
6988
void functionCallTest() {
7089
this.contextRunner.run(context -> {

0 commit comments

Comments
 (0)