Skip to content
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

Error page when starting CommunityToolkit.Aspire.Hosting.Ollama.AppHost #294

Closed
anoordover opened this issue Nov 26, 2024 · 2 comments · Fixed by #296
Closed

Error page when starting CommunityToolkit.Aspire.Hosting.Ollama.AppHost #294

anoordover opened this issue Nov 26, 2024 · 2 comments · Fixed by #296
Assignees
Milestone

Comments

@anoordover
Copy link
Contributor

Describe the bug

When I go to the web-project after starting CommunityToolkit.Aspire.Hosting.Ollama.AppHost I get an error page with the title:
InvalidOperationException: Cannot provide a value for property 'OllamaClient1' on type 'CommunityToolkit.Aspire.Hosting.Ollama.Web.Components.Pages.Home'. There is no registered keyed service of type 'Microsoft.Extensions.AI.IChatClient' with key 'phi3'.

Regression

No response

Steps to reproduce

1. start CommunityToolkit.Aspire.Hosting.Ollama.AppHost
2. go to the web-project using the link in the AppHost

Expected behavior

I wouldn't expect this error to show up.

Screenshots

Image

IDE and version

Rider

IDE version

2024.3

Nuget packages


Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item

@anoordover
Copy link
Contributor Author

Should we change the lines

builder.AddKeyedOllamaApiClient(ServiceKeys.Phi3);
builder.AddKeyedOllamaApiClient(ServiceKeys.Llama);

to

builder.AddKeyedOllamaSharpChatClient(ServiceKeys.Phi3);
builder.AddKeyedOllamaSharpChatClient(ServiceKeys.Llama);

in the program.cs class in the Ollama.Web project?

@aaronpowell
Copy link
Member

Ah good catch. Yes, it should be using the second registration. I must have messed that up in a refactor.

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 a pull request may close this issue.

2 participants