Skip to content

Conversation

@alexwolfmsft
Copy link
Contributor

@alexwolfmsft alexwolfmsft commented Jun 5, 2024

Summary

Describe your changes here.

Fixes #Issue_Number (if available)


Internal previews

📄 File 🔗 Preview link
docs/ai/quickstarts/quickstart-local-ai.md Chat with a local AI model using .NET and Semantic Kernel

@dotnet-bot dotnet-bot added this to the June 2024 milestone Jun 5, 2024
@alexwolfmsft alexwolfmsft marked this pull request as ready for review June 5, 2024 20:36
@alexwolfmsft alexwolfmsft requested a review from a team as a code owner June 5, 2024 20:36
@alexwolfmsft alexwolfmsft merged commit 1206330 into dotnet:main Jun 6, 2024
@manoj-jain-techporch
Copy link

Hi @alexwolfmsft @IEvangelist - Thanks for the document. Very helpful.

But when we tried it, it gives following error in
await foreach (var item in aiChatService.GetStreamingChatMessageContentsAsync(chatHistory))

System.ClientModel.ClientResultException: 'Service request failed. Status: 404 (Not Found)

On the same system, if we try the sample from OlllamaSharp - that works fine on the same model + same port.

If we browse to the http://localhost:11434 it shows "Ollama is running"

Any suggestions?

@alexwolfmsft
Copy link
Contributor Author

But when we tried it, it gives following error in await foreach (var item in aiChatService.GetStreamingChatMessageContentsAsync(chatHistory))

System.ClientModel.ClientResultException: 'Service request failed. Status: 404 (Not Found)

On the same system, if we try the sample from OlllamaSharp - that works fine on the same model + same port.

If we browse to the http://localhost:11434 it shows "Ollama is running"

Any suggestions?

Thank you for surfacing this - you can find an updated code example here:
https://github.com/dotnet/docs/blob/main/docs/ai/quickstarts/snippets/local-ai/Program.cs

This approach uses the Microsoft.SemanticKernel.Connectors.Ollama package for a better connection experience to Ollama, so you'll need to add that to your project as well.

@manoj-jain-techporch
Copy link

Thanks @alexwolfmsft. This worked.

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.

4 participants