Skip to content

Conversation

@ThomasVitale
Copy link
Contributor

  • Adopted new tool calling logic in OllamaChatModel, while maintaining full API backward compatibility thanks to the LegacyToolCallingManager.
  • Improved efficiency and robustness of merging options in prompts for Ollama.
  • Update Ollama Autoconfiguration to use the new ToolCallingManager.
  • Improved troubleshooting for new tool calling APIs and finalised changes for full backward compatibility.
  • Updated Ollama Testcontainers dependency to 0.5.7.

Relates to gh-2049

* Adopted new tool calling logic in OllamaChatModel, while maintaining full API backward compatibility thanks to the LegacyToolCallingManager.
* Improved efficiency and robustness of merging options in prompts for Ollama.
* Update Ollama Autoconfiguration to use the new ToolCallingManager.
* Improved troubleshooting for new tool calling APIs and finalised changes for full backward compatibility.
* Updated Ollama Testcontainers dependency to 0.5.7.

Relates to spring-projectsgh-2049

Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>

@Test
public void createRequestWithDefaultOptions() {
void createRequestWithDefaultOptions() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are the only Ollama tests that I had to change, and just because they are testing implementation details and not the public API. All the other tests I left untouched, supporting the backward compatibility validation.


@Bean
@ConditionalOnMissingBean
ToolCallingManager toolCallingManager(ToolCallbackResolver toolCallbackResolver,
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 can be re-used across all ChatModel instances.
In special cases, like Vertex, it can be overwritten to provide a variant using the non-standard schema config.

<version>${milvus.version}</version>
</dependency>

<!-- This is HORRIBLE! But IntelliJ doesn't want to work without it -->
Copy link
Contributor Author

@ThomasVitale ThomasVitale Jan 30, 2025

Choose a reason for hiding this comment

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

There's something in the Milvus Java SDK causing a compilation error in IntelliJ if Lombok is not added as a dependency. And the error propagates to the spring-ai-spring-boot-auto-configure module, making it impossible to run auto tests from the IDE. I should probably remove this from the PR (I forgot to undo the change before committing), but since it's here I figured it'd be good to bring this up and talk about it, before reverting the change.

@tzolov tzolov self-assigned this Jan 30, 2025
@tzolov
Copy link
Contributor

tzolov commented Jan 30, 2025

Thanks @ThomasVitale
Rebased, cleaned and merged at b902ca2

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