Skip to content

Conversation

ThomasVitale
Copy link
Contributor

  • Add doneReason to ChatResponse and update OllamaChatModel accordingly
  • Add missing descriptions to Ollama options
  • Consolidate Ollama Testcontainers image setup
  • Fix multimodality Ollama test

@@ -201,53 +202,43 @@ public Flux<ChatResponse> stream(Prompt prompt) {
*/
OllamaApi.ChatRequest ollamaChatRequest(Prompt prompt, boolean stream) {

List<OllamaApi.Message> ollamaMessages = prompt.getInstructions()
.stream()
.filter(message -> message.getMessageType() == MessageType.USER
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff looks really weird, but the only change I made was removing the "filter()" expression since we now accept all message types, so there's no filter needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the Spring Formatter plugin made formatting changes after removing the filter() part.

* @param options Additional model parameters. You can use the {@link OllamaOptions} builder
* to create the options then {@link OllamaOptions#toMap()} to convert the options into a
* map.
* @param model The model to use for completion. It should be a name familiar to Ollama from the <a href="https://ollama.com/library">Library</a>.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synced with Ollama GO code, including the field order to make it easier to maintain it whenever there are changes

* Add doneReason to ChatResponse and update OllamaChatModel accordingly
* Add missing descriptions to Ollama options
* Consolidate Ollama Testcontainers image setup
* Fix multimodality Ollama test
* Add new models to enum: llama 3.1, mistral-nemo, moondream.

Signed-off-by: Thomas Vitale <[email protected]>
@tzolov
Copy link
Contributor

tzolov commented Jul 26, 2024

Thanks @ThomasVitale . Made few small adjustments and it is ready to go.

@tzolov
Copy link
Contributor

tzolov commented Jul 26, 2024

Rebased and merged at 78cd3e9

@tzolov tzolov closed this Jul 26, 2024
@tzolov tzolov added this to the 1.0.0-M2 milestone Jul 26, 2024
@tzolov tzolov self-assigned this Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants