-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update Ollama APIs and fix multimodality test #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ThomasVitale
commented
Jul 25, 2024
- Add doneReason to ChatResponse and update OllamaChatModel accordingly
- Add missing descriptions to Ollama options
- Consolidate Ollama Testcontainers image setup
- Fix multimodality Ollama test
98cfb16
to
1e2ab24
Compare
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>. |
There was a problem hiding this comment.
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
1e2ab24
to
00e6c87
Compare
* 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]>
00e6c87
to
81836ed
Compare
Thanks @ThomasVitale . Made few small adjustments and it is ready to go. |
Rebased and merged at 78cd3e9 |