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

DRAFT: Adding support for an AI + .NET Aspire template #6083

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jmatthiesen
Copy link
Contributor

@jmatthiesen jmatthiesen commented Mar 11, 2025

Currently still in a draft state - This initial version creates a second "AI + .NET Aspire Chat App" template which can be manually installed and works with Ollama.

Still TODO:

  • Add support for the other providers from the existing AI Chat Web App template
  • Expand with additional vector stores
  • Update README
Microsoft Reviewers: Open in CodeFlow

@github-actions github-actions bot added the area-ai-templates Microsoft.Extensions.AI.Templates label Mar 11, 2025
"shortName": "aiaspirechat",
"defaultName": "AspireChatApp",
"preferNameDirectory": false,
// The placeholder sourceName needs to contain a dash to ensure the CSS bundle asset uses the assembly identity name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left this comment in for now until we know that we've addressed the issue raised here. I haven't tested it yet.

@@ -0,0 +1,349 @@
{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I'm going with a separate template, instead of this being an "Add Aspire Support" for the existing AI Chat Web App Template. This is because a) there's a different approach to configuration and project structure for Aspire support, b) we likely will have additional options for Aspire that you wouldn't see in a non-Aspire scenario, and c) it's a lot easier to merge 2 down to 1 later than to unravel a lot of #if conditional logic.

@@ -0,0 +1,109 @@
using AspireAIChat.Web.Services;
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 is a bit of feature creep - this PR splits out code behind from the .razor files, so there are new .razor.cs files. I based this update off of some source sent to me, but there has been general feedback about best practices should be to separate the code behind from the Razor file. I agree with that approach and it does seem to work better in the Razor editor in VS Code if your C# code is in a .cs file.

@MackinnonBuck
Copy link
Member

Looks like the .csproj files didn't get committed, and that's because they're .gitignored. We'll want to add .csproj.in files that generate .csproj files at build time at some point. We'll also want this new template to participate in JS dependency update automation (I've set that up locally but can add it to this PR if necessary).

@jmatthiesen
Copy link
Contributor Author

Looks like the .csproj files didn't get committed, and that's because they're .gitignored. We'll want to add .csproj.in files that generate .csproj files at build time at some point. We'll also want this new template to participate in JS dependency update automation (I've set that up locally but can add it to this PR if necessary).

Oh good catch - I can add the csproj files in here, just so you can see what I did there.

If we're going to go with your local changes moving forward (per offline chat), no need to fix up this PR/branch. We'll just move to that when you commit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ai-templates Microsoft.Extensions.AI.Templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants