On https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html#_function_calling the constructor call is not valid anymore:

var chatModel = new OllamaChatModel(this.ollamaApi, OllamaOptions.create() .withModel(OllamaOptions.DEFAULT_MODEL) .withTemperature(0.9));

Should be something along the lines:

var chatModel = OllamaChatModel.builder()
                                     .withOllamaApi( this.ollamaApi )
                                     .withXXX(...) )
                                     .build();

Comment From: iftv

It seems that starting from version M4, support for the OllamaChatModel(OllamaApi, OllamaOptions) constructor has been removed. Is this a feature or deprecation ?