Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
512b95a
Use GUID keys for vector store records
MackinnonBuck Mar 11, 2025
92564ae
Aspire template starting point
MackinnonBuck Mar 11, 2025
72974a2
Unify Aspire and single-project templates
MackinnonBuck Mar 13, 2025
59dad4a
Started on AzureOpenAI Aspire support
MackinnonBuck Mar 13, 2025
513480f
Copy existing non-aspire functionality into Program.Aspire.cs
MackinnonBuck Mar 13, 2025
58f6e54
Use version properties
MackinnonBuck Mar 13, 2025
5b40a68
Merge remote-tracking branch 'origin/main' into mbuck/chat-template-a…
MackinnonBuck Mar 17, 2025
2b9c10d
Fix merge problems + remove use of obsolete APIs
MackinnonBuck Mar 17, 2025
20a6571
Update Versions.props
MackinnonBuck Mar 17, 2025
2754615
Fix Microsoft.Extensions.Http.Resilience reference
MackinnonBuck Mar 18, 2025
d6fb86d
Fix in-repo build
MackinnonBuck Mar 18, 2025
c6b706d
Ollama fixes
MackinnonBuck Mar 18, 2025
7e94d85
Revert snapshot changes until tests are fixed
MackinnonBuck Mar 18, 2025
3984dfc
Update src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/Cha…
MackinnonBuck Mar 18, 2025
f55cbec
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 18, 2025
8fd88ad
Remove .Web suffix in non-Aspire variant
MackinnonBuck Mar 18, 2025
87364b5
Move Azure OpenAI + Sqlite to AppHost
MackinnonBuck Mar 18, 2025
6081418
Merge remote-tracking branch 'origin/main' into mbuck/chat-template-a…
MackinnonBuck Mar 18, 2025
1c12ac3
Move GH Models config to AppHost
MackinnonBuck Mar 18, 2025
6f7204e
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 18, 2025
972e8dc
Move OpenAI config to AppHost
MackinnonBuck Mar 18, 2025
18607e3
Move Azure AI search config to AppHost
MackinnonBuck Mar 18, 2025
41e5534
Update existing test snapshots
MackinnonBuck Mar 18, 2025
87e0d22
Update template tests
MackinnonBuck Mar 18, 2025
f97ec71
Fix build by using generated .sln
MackinnonBuck Mar 19, 2025
c514446
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 19, 2025
4fefb2b
Remove .sln file from snapshot
MackinnonBuck Mar 19, 2025
63549b0
Only use GUID keys when UseQdrant
MackinnonBuck Mar 19, 2025
0006710
If duplicate .sln files, output full paths of each
MackinnonBuck Mar 19, 2025
40dcd79
Limit .sln file search depth on Linux
MackinnonBuck Mar 19, 2025
2fb83f5
Add back .sln to snapshot to see if it will work
MackinnonBuck Mar 19, 2025
9a7c53a
Enable Aspire option in VS
MackinnonBuck Mar 19, 2025
500d36a
Improve Azure+Aspire integration
MackinnonBuck Mar 19, 2025
adcf32c
Update test snapshots
MackinnonBuck Mar 19, 2025
b8165b1
Improved Aspire+OpenAI integration
MackinnonBuck Mar 19, 2025
371a348
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 19, 2025
6b4f144
Fix accidental .gitignore change
MackinnonBuck Mar 19, 2025
e2b0741
Update src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/Cha…
MackinnonBuck Mar 21, 2025
c4d9b63
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 21, 2025
a85a0cf
PR feedback
MackinnonBuck Mar 21, 2025
ae151bd
Add `UseOpenTelemetry()`
MackinnonBuck Mar 21, 2025
ee39b7b
Update snapshots
MackinnonBuck Mar 21, 2025
8f18b5a
Simplified OpenAI configuration
MackinnonBuck Mar 21, 2025
3ee2dca
Update snapshots
MackinnonBuck Mar 21, 2025
f51e491
Add README for Aspire template
MackinnonBuck Mar 21, 2025
88c4e71
Small fix + update snapshots
MackinnonBuck Mar 21, 2025
d02e736
Update .gitignore
MackinnonBuck Mar 21, 2025
62217f5
Merge remote-tracking branch 'origin/main' into mbuck/chat-template-a…
MackinnonBuck Mar 25, 2025
fe1287e
PR feedback
MackinnonBuck Mar 25, 2025
c171afa
Add quotes around connection strings
MackinnonBuck Mar 25, 2025
efdd968
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 25, 2025
017ff1f
Add comment about warning suppression
MackinnonBuck Mar 27, 2025
f08025d
Merge branch 'main' into mbuck/chat-template-aspire
MackinnonBuck Mar 27, 2025
b569f81
Fix filename filtering
MackinnonBuck Mar 27, 2025
e40f170
Merge remote-tracking branch 'origin/main' into mbuck/chat-template-a…
MackinnonBuck Mar 27, 2025
84718b5
Add Blazor and .NET Aspire classifications
jmatthiesen Mar 27, 2025
86e9b49
PR feedback
MackinnonBuck Mar 28, 2025
9ed832d
Merge remote-tracking branch 'origin/main' into mbuck/chat-template-a…
MackinnonBuck Mar 28, 2025
1917bc8
Added support for OTel semantic conventions for GenAI with Aspire (#6…
jmatthiesen Mar 28, 2025
319a0d3
Update test snapshots
MackinnonBuck Mar 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,6 @@ BenchmarkDotNet.artifacts/
*.binlog
/eng/scripts/repo-digest.html
**/.DS_Store

# VERIFY
!**/*.verified/**
17 changes: 13 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,23 @@
<MicrosoftCodeAnalysisVersion>4.8.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisAnalyzersVersion>
<!-- AI templates -->
<AspireVersion>9.1.0</AspireVersion>
<AspireAzureAIOpenAIVersion>9.1.0-preview.1.25121.10</AspireAzureAIOpenAIVersion>
<AzureAIProjectsVersion>1.0.0-beta.3</AzureAIProjectsVersion>
<AzureAIOpenAIVersion>2.2.0-beta.1</AzureAIOpenAIVersion>
<AzureAIOpenAIVersion>2.2.0-beta.3</AzureAIOpenAIVersion>
<AzureIdentityVersion>1.13.2</AzureIdentityVersion>
<AzureSearchDocumentsVersion>11.6.0</AzureSearchDocumentsVersion>
<MicrosoftSemanticKernelConnectorsAzureAISearchVersion>1.37.0-preview</MicrosoftSemanticKernelConnectorsAzureAISearchVersion>
<MicrosoftSemanticKernelCoreVersion>1.37.0</MicrosoftSemanticKernelCoreVersion>
<CommunityToolkitAspireHostingOllamaVersion>9.2.2-beta.236</CommunityToolkitAspireHostingOllamaVersion>
<CommunityToolkitAspireHostingSqliteVersion>9.2.2-beta.236</CommunityToolkitAspireHostingSqliteVersion>
<CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion>9.2.2-beta.236</CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion>
<CommunityToolkitAspireOllamaSharpVersion>9.2.2-beta.236</CommunityToolkitAspireOllamaSharpVersion>
<MicrosoftExtensionsServiceDiscoveryVersion>9.1.0</MicrosoftExtensionsServiceDiscoveryVersion>
<MicrosoftSemanticKernelConnectorsAzureAISearchVersion>1.41.0-preview</MicrosoftSemanticKernelConnectorsAzureAISearchVersion>
<MicrosoftSemanticKernelConnectorsQdrantVersion>1.41.0-preview</MicrosoftSemanticKernelConnectorsQdrantVersion>
<MicrosoftSemanticKernelCoreVersion>1.41.0</MicrosoftSemanticKernelCoreVersion>
<OllamaSharpVersion>5.1.9</OllamaSharpVersion>
<OpenAIVersion>2.2.0-beta.1</OpenAIVersion>
<OpenAIVersion>2.2.0-beta.3</OpenAIVersion>
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>
<PdfPigVersion>0.1.9</PdfPigVersion>
<SystemLinqAsyncVersion>6.0.1</SystemLinqAsyncVersion>
<!--
Expand Down
4 changes: 2 additions & 2 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fi
# - If more than one solution is found - fail.
if [[ "$hasProjects" == false ]]; then
repoRoot=$(realpath $DIR/../)
fileCount=$(find $repoRoot -path "$repoRoot/*.sln" | wc -l)
fileCount=$(find $repoRoot -path "$repoRoot/*.sln" -maxdepth 1 | wc -l)
if [[ $fileCount > 1 ]]; then
echo -e '\e[31m[ERROR] Multiple .sln files found in the root of the repository. Use '--projects' to specify the one you wish to build.\e[0m' >&2
exit -1
Expand Down Expand Up @@ -154,4 +154,4 @@ if [[ "$testCoverage" == true ]]; then
echo ""
echo -e "\e[32mCode coverage results:\e[0m $testResultPath/CoverageResultsHtml/index.html"
echo ""
fi
fi
3 changes: 2 additions & 1 deletion src/ProjectTemplates/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ package-lock.json

# Don't track files generated for debugging templates locally.
*/src/**/*.csproj
*/src/**/*.sln
*/src/**/NuGet.config
*/src/**/Directory.Build.targets
*/src/**/ingestioncache.db
*/src/**/ingestioncache.*

# launchSettings.json files are required for the templates.
!launchSettings.json
Expand Down
72 changes: 53 additions & 19 deletions src/ProjectTemplates/GeneratedContent.targets
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
<Project>

<PropertyGroup>
<_ChatWithCustomDataWebContentRoot>$(MSBuildThisFileDirectory)Microsoft.Extensions.AI.Templates\src\ChatWithCustomData\ChatWithCustomData.Web-CSharp\</_ChatWithCustomDataWebContentRoot>
<!--
Configures which chat template variant to use when debugging locally.
Options are:
- singleproject
- aspire
-->
<_LocalChatTemplateVariant>aspire</_LocalChatTemplateVariant>

<_ChatWithCustomDataContentRoot>$(MSBuildThisFileDirectory)Microsoft.Extensions.AI.Templates\src\ChatWithCustomData\</_ChatWithCustomDataContentRoot>
</PropertyGroup>

<Target Name="ComputeGeneratedContentProperties">
<PropertyGroup>
<!-- Define optional pinned versions of certain dependencies. -->
<TemplatePinnedMicrosoftExtensionsAIVersion>9.3.0-preview.1.25161.3</TemplatePinnedMicrosoftExtensionsAIVersion>
<TemplatePinnedRepoPackagesVersion>9.3.0-preview.1.25161.3</TemplatePinnedRepoPackagesVersion>
<TemplatePinnedMicrosoftEntityFrameworkCoreSqliteVersion>9.0.3</TemplatePinnedMicrosoftEntityFrameworkCoreSqliteVersion>

<!-- By default, use pinned dependency versions. -->
<TemplateUsePinnedMicrosoftExtensionsAIVersion Condition="'$(TemplateUsePinnedMicrosoftExtensionsAIVersion)' == ''">false</TemplateUsePinnedMicrosoftExtensionsAIVersion>
<!-- By default, don't use pinned dependency versions. -->
<TemplateUsePinnedRepoPackagesVersion Condition="'$(TemplateUsePinnedRepoPackagesVersion)' == ''">false</TemplateUsePinnedRepoPackagesVersion>
<TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion Condition="'$(TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion)' == ''">false</TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion>

<!-- Apply pinned dependency versions if enabled. -->
<TemplateMicrosoftExtensionsAIVersion Condition="'$(TemplateUsePinnedMicrosoftExtensionsAIVersion)' == 'true'">$(TemplatePinnedMicrosoftExtensionsAIVersion)</TemplateMicrosoftExtensionsAIVersion>
<TemplateRepoPackagesVersion Condition="'$(TemplateUsePinnedRepoPackagesVersion)' == 'true'">$(TemplatePinnedRepoPackagesVersion)</TemplateRepoPackagesVersion>
<TemplateMicrosoftEntityFrameworkCoreSqliteVersion Condition="'$(TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion)' == 'true'">$(TemplatePinnedMicrosoftEntityFrameworkCoreSqliteVersion)</TemplateMicrosoftEntityFrameworkCoreSqliteVersion>

<!-- Fall back on default dependency versions if pinned versions were not applied. -->
<TemplateMicrosoftExtensionsAIVersion Condition="'$(TemplateMicrosoftExtensionsAIVersion)' == ''">$(Version)</TemplateMicrosoftExtensionsAIVersion>
<TemplateRepoPackagesVersion Condition="'$(TemplateRepoPackagesVersion)' == ''">$(Version)</TemplateRepoPackagesVersion>
<TemplateMicrosoftEntityFrameworkCoreSqliteVersion Condition="'$(TemplateMicrosoftEntityFrameworkCoreSqliteVersion)' == ''">$(MicrosoftEntityFrameworkCoreSqliteVersion)</TemplateMicrosoftEntityFrameworkCoreSqliteVersion>

<_TemplateUsingJustBuiltPackages Condition="'$(TemplateMicrosoftExtensionsAIVersion)' == '$(Version)'">true</_TemplateUsingJustBuiltPackages>
<_TemplateUsingJustBuiltPackages Condition="'$(TemplateRepoPackagesVersion)' == '$(Version)'">true</_TemplateUsingJustBuiltPackages>

<!-- Specify package version variables used in template content. -->
<GeneratedContentProperties>
Expand All @@ -32,33 +40,59 @@
ArtifactsShippingPackagesDir=$(ArtifactsShippingPackagesDir);

<!-- Package version properties -->
OllamaSharpVersion=$(OllamaSharpVersion);
OpenAIVersion=$(OpenAIVersion);
AspireVersion=$(AspireVersion);
AspireAzureAIOpenAIVersion=$(AspireAzureAIOpenAIVersion);
AzureAIProjectsVersion=$(AzureAIProjectsVersion);
AzureAIOpenAIVersion=$(AzureAIOpenAIVersion);
AzureIdentityVersion=$(AzureIdentityVersion);
AzureSearchDocumentsVersion=$(AzureSearchDocumentsVersion);
CommunityToolkitAspireHostingOllamaVersion=$(CommunityToolkitAspireHostingOllamaVersion);
CommunityToolkitAspireHostingSqliteVersion=$(CommunityToolkitAspireHostingSqliteVersion);
CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion=$(CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion);
CommunityToolkitAspireOllamaSharpVersion=$(CommunityToolkitAspireOllamaSharpVersion);
MicrosoftEntityFrameworkCoreSqliteVersion=$(TemplateMicrosoftEntityFrameworkCoreSqliteVersion);
MicrosoftExtensionsAIVersion=$(TemplateMicrosoftExtensionsAIVersion);
MicrosoftExtensionsAIVersion=$(TemplateRepoPackagesVersion);
MicrosoftExtensionsHttpResilienceVersion=$(TemplateRepoPackagesVersion);
MicrosoftExtensionsServiceDiscoveryVersion=$(MicrosoftExtensionsServiceDiscoveryVersion);
MicrosoftSemanticKernelConnectorsAzureAISearchVersion=$(MicrosoftSemanticKernelConnectorsAzureAISearchVersion);
MicrosoftSemanticKernelConnectorsQdrantVersion=$(MicrosoftSemanticKernelConnectorsQdrantVersion);
MicrosoftSemanticKernelCoreVersion=$(MicrosoftSemanticKernelCoreVersion);
OllamaSharpVersion=$(OllamaSharpVersion);
OpenAIVersion=$(OpenAIVersion);
OpenTelemetryVersion=$(OpenTelemetryVersion);
PdfPigVersion=$(PdfPigVersion);
SystemLinqAsyncVersion=$(SystemLinqAsyncVersion);
AzureSearchDocumentsVersion=$(AzureSearchDocumentsVersion);
MicrosoftSemanticKernelConnectorsAzureAISearchVersion=$(MicrosoftSemanticKernelConnectorsAzureAISearchVersion);

<!-- Other properties -->
LocalChatTemplateVariant=$(_LocalChatTemplateVariant);
UsingJustBuiltPackages=$(_TemplateUsingJustBuiltPackages);
</GeneratedContentProperties>
</PropertyGroup>

<ItemGroup>
<GeneratedContent
Include="$(_ChatWithCustomDataWebContentRoot)ChatWithCustomData.Web-CSharp.csproj.in"
OutputPath="$(_ChatWithCustomDataWebContentRoot)ChatWithCustomData.Web-CSharp.csproj" />
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.sln.in"
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.sln" />
<GeneratedContent
Include="$(_ChatWithCustomDataContentRoot)Directory.Build.targets.in"
OutputPath="$(_ChatWithCustomDataContentRoot)Directory.Build.targets" />
<GeneratedContent
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\ChatWithCustomData-CSharp.Web.csproj.in"
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\ChatWithCustomData-CSharp.Web.csproj" />
<GeneratedContent
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\Directory.Build.targets.in"
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\Directory.Build.targets" />
<GeneratedContent
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.AppHost\ChatWithCustomData-CSharp.AppHost.csproj.in"
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.AppHost\ChatWithCustomData-CSharp.AppHost.csproj" />
<GeneratedContent
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.ServiceDefaults\ChatWithCustomData-CSharp.ServiceDefaults.csproj.in"
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.ServiceDefaults\ChatWithCustomData-CSharp.ServiceDefaults.csproj" />

<!-- The following content only gets generated when using just-built packages -->
<_GeneratedContentEnablingJustBuiltPackages
Include="$(_ChatWithCustomDataWebContentRoot)NuGet.config.in"
OutputPath="$(_ChatWithCustomDataWebContentRoot)NuGet.config" />
<_GeneratedContentEnablingJustBuiltPackages
Include="$(_ChatWithCustomDataWebContentRoot)Directory.Build.targets.in"
OutputPath="$(_ChatWithCustomDataWebContentRoot)Directory.Build.targets" />
Include="$(_ChatWithCustomDataContentRoot)NuGet.config.in"
OutputPath="$(_ChatWithCustomDataContentRoot)NuGet.config" />

<GeneratedContent
Include="@(_GeneratedContentEnablingJustBuiltPackages)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageType>Template</PackageType>
<TargetFrameworks>$(NetCoreTargetFrameworks);netstandard2.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreTargetFrameworks)</TargetFrameworks>
<Description>Project templates for Microsoft.Extensions.AI.</Description>
<PackageTags>dotnet-new;templates;ai</PackageTags>

Expand All @@ -22,15 +22,24 @@
<NoPackageAnalysis>true</NoPackageAnalysis>
</PropertyGroup>

<!--
Reference the GenerateTemplateContent project so that template content gets generated prior
to building this project.
-->
<ItemGroup>
<!--
Reference the GenerateTemplateContent project so that template content gets generated prior
to building this project.
-->
<ProjectReference
Include="..\GenerateTemplateContent\GenerateTemplateContent.csproj"
ReferenceOutputAssembly="false"
PrivateAssets="all" />

<!--
Internal packages referenced by the templates that aren't in the AI workstream.
We include these references here so that local NuGet packages get generated for use by the templates.
-->
<ProjectReference
Include="..\..\Libraries\Microsoft.Extensions.Http.Resilience\Microsoft.Extensions.Http.Resilience.csproj"
ReferenceOutputAssembly="false"
PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand All @@ -40,13 +49,14 @@
Exclude="
**\bin\**;
**\obj\**;
**\.vs\**;
**\node_modules\**;
**\*.user;
**\*.in;
**\*.out.js;
**\*.generated.css;
**\package-lock.json;
**\ingestioncache.db;
**\ingestioncache.*;
**\NuGet.config;
**\Directory.Build.targets;" />
<None Include="THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="." />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
{
"$schema": "https://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"kestrelHttpPort": {
"AiServiceProvider": {
"longName": "provider",
"shortName": ""
},
"VectorStore": {
"longName": "vector-store",
"shortName": ""
},
"UseManagedIdentity": {
"longName": "managed-identity",
"shortName": ""
},
"UseAspire": {
"longName": "aspire",
"shortName": ""
},
"webHttpPort": {
"isHidden": true
},
"webHttpsPort": {
"isHidden": true
},
"appHostHttpPort": {
"isHidden": true
},
"appHostOtlpHttpPort": {
"isHidden": true
},
"appHostResourceHttpPort": {
"isHidden": true
},
"appHostHttpsPort": {
"isHidden": true
},
"appHostOtlpHttpsPort": {
"isHidden": true
},
"kestrelHttpsPort": {
"appHostResourceHttpsPort": {
"isHidden": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{
"id": "VectorStore",
"isVisible": true
},
{
"id": "UseAspire",
"isVisible": true
}
]
}
Loading
Loading