Skip to content

.Net: Add Ollama Connector - #7362

Merged
Roger Barreto (rogerbarreto) merged 22 commits into
mainfrom
feature-connectors-ollama
Sep 6, 2024
Merged

Roger Barreto (rogerbarreto) merged 22 commits into
mainfrom
feature-connectors-ollama

Conversation

@rogerbarreto

@rogerbarreto Roger Barreto (rogerbarreto) commented Jul 19, 2024 •

Copy link
Copy Markdown
Member

Motivation and Context

This PR brings support for Ollama Connector, this Connector uses the OllamaSharp library client to allow usage of native Ollama Endpoints.

### Motivation and Context



### Description



### Contribution Checklist



- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
### Motivation and Context



### Description



### Contribution Checklist



- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄

---------

Signed-off-by: dependabot[bot] 
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
Co-authored-by: Dmytro Struk <13853051+dmytrostruk@users.noreply.github.com>
Co-authored-by: Ikko Eltociear Ashimine 
Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
Co-authored-by: ShuaiHua Du 
Co-authored-by: Krzysztof Kasprowicz <60486987+Krzysztof318@users.noreply.github.com>
Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com>
Co-authored-by: Nico Möller 
Co-authored-by: Nico Möller 
Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
Co-authored-by: Tao Chen 
Co-authored-by: Eduard van Valkenburg 
Co-authored-by: NEWTON MALLICK <38786893+N-E-W-T-O-N@users.noreply.github.com>
Co-authored-by: qowlsdn8007 <33804074+qowlsdn8007@users.noreply.github.com>
Co-authored-by: Gil LaHaye 
…ustments (#7212)

### Motivation and Context

- Integration Tests added
- Metadata generated with new client result data
- Adjustments in parameter names, following SK convention.
### Motivation and Context

Using most recent update where a ChatMessage metadata can be used by
OllamaSharp Client Chat().

### Description



### Contribution Checklist



- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel labels Jul 19, 2024
@github-actions github-actions Bot changed the title Draft Merge main into connectors ollama .Net: Draft Merge main into connectors ollama Jul 19, 2024
@rogerbarreto Roger Barreto (rogerbarreto) changed the title .Net: Draft Merge main into connectors ollama .Net: [Draft] main -> feature-connectors-ollama Jul 19, 2024
### Motivation and Context

- Update to the latest version of `OllamaSharp` 
    - Adapted to the new changes to Embedding API update below
    awaescher/OllamaSharp#60
@rogerbarreto Roger Barreto (rogerbarreto) changed the title .Net: [Draft] main -> feature-connectors-ollama .Net: Add support for Ollama Connector Aug 14, 2024
@rogerbarreto Roger Barreto (rogerbarreto) changed the title .Net: Add support for Ollama Connector .Net: Add Ollama Connector Aug 14, 2024
### Motivation and Context

Adding missing samples using the new Ollama Connector.
- Embedding generation
- Text Generation
- Chat Completion
- AIModelRouting Demo with Ollama Connector
### Motivation and Context

Small fix identified during bugbash.
@rogerbarreto
Roger Barreto (rogerbarreto) marked this pull request as ready for review September 4, 2024 10:13
Comment thread dotnet/src/Connectors/Connectors.Ollama.UnitTests/HttpMessageHandlerStub.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/Connectors.Ollama.csproj Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/Connectors.Ollama.csproj Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/Core/OllamaChatResponseStreamer.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/Core/ServiceBase.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/OllamaMetadata.cs Outdated
Comment thread dotnet/Directory.Packages.props Outdated
Comment thread dotnet/samples/Concepts/ChatCompletion/Ollama_ChatCompletion.cs Outdated
Comment thread dotnet/samples/Concepts/ChatCompletion/Ollama_ChatCompletion.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama.UnitTests/OllamaTestHelper.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama.UnitTests/OllamaTestHelper.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/OllamaMetadata.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/OllamaMetadata.cs Outdated
Comment thread dotnet/src/Connectors/Connectors.Ollama/OllamaPromptExecutionSettings.cs Outdated
@rogerbarreto
Roger Barreto (rogerbarreto) added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit f149f95 Sep 6, 2024
@rogerbarreto
Roger Barreto (rogerbarreto) deleted the feature-connectors-ollama branch September 6, 2024 14:41
@magols

Copy link
Copy Markdown

Thank you. I think we are many who have been waiting for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Issues or pull requests impacting the core kernel .NET Issue or Pull requests regarding .NET code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants