Skip to content

Commit 34cd461

Browse files
MackinnonBuckSteveSandersonMSjeffhandleyjmatthiesen
authored
Add Aspire support to chat template (#6102)
Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com> Co-authored-by: Jordan Matthiesen <1333029+jmatthiesen@users.noreply.github.com>
1 parent d256f6b commit 34cd461

File tree

156 files changed

+19274
-157
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+19274
-157
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,6 @@ BenchmarkDotNet.artifacts/
316316
*.binlog
317317
/eng/scripts/repo-digest.html
318318
**/.DS_Store
319+
320+
# VERIFY
321+
!**/*.verified/**

eng/Versions.props

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,23 @@
147147
<MicrosoftCodeAnalysisVersion>4.8.0</MicrosoftCodeAnalysisVersion>
148148
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisAnalyzersVersion>
149149
<!-- AI templates -->
150+
<AspireVersion>9.1.0</AspireVersion>
151+
<AspireAzureAIOpenAIVersion>9.1.0-preview.1.25121.10</AspireAzureAIOpenAIVersion>
150152
<AzureAIProjectsVersion>1.0.0-beta.3</AzureAIProjectsVersion>
151-
<AzureAIOpenAIVersion>2.2.0-beta.1</AzureAIOpenAIVersion>
153+
<AzureAIOpenAIVersion>2.2.0-beta.3</AzureAIOpenAIVersion>
152154
<AzureIdentityVersion>1.13.2</AzureIdentityVersion>
153155
<AzureSearchDocumentsVersion>11.6.0</AzureSearchDocumentsVersion>
154-
<MicrosoftSemanticKernelConnectorsAzureAISearchVersion>1.37.0-preview</MicrosoftSemanticKernelConnectorsAzureAISearchVersion>
155-
<MicrosoftSemanticKernelCoreVersion>1.37.0</MicrosoftSemanticKernelCoreVersion>
156+
<CommunityToolkitAspireHostingOllamaVersion>9.2.2-beta.236</CommunityToolkitAspireHostingOllamaVersion>
157+
<CommunityToolkitAspireHostingSqliteVersion>9.2.2-beta.236</CommunityToolkitAspireHostingSqliteVersion>
158+
<CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion>9.2.2-beta.236</CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion>
159+
<CommunityToolkitAspireOllamaSharpVersion>9.2.2-beta.236</CommunityToolkitAspireOllamaSharpVersion>
160+
<MicrosoftExtensionsServiceDiscoveryVersion>9.1.0</MicrosoftExtensionsServiceDiscoveryVersion>
161+
<MicrosoftSemanticKernelConnectorsAzureAISearchVersion>1.41.0-preview</MicrosoftSemanticKernelConnectorsAzureAISearchVersion>
162+
<MicrosoftSemanticKernelConnectorsQdrantVersion>1.41.0-preview</MicrosoftSemanticKernelConnectorsQdrantVersion>
163+
<MicrosoftSemanticKernelCoreVersion>1.41.0</MicrosoftSemanticKernelCoreVersion>
156164
<OllamaSharpVersion>5.1.9</OllamaSharpVersion>
157-
<OpenAIVersion>2.2.0-beta.1</OpenAIVersion>
165+
<OpenAIVersion>2.2.0-beta.3</OpenAIVersion>
166+
<OpenTelemetryVersion>1.9.0</OpenTelemetryVersion>
158167
<PdfPigVersion>0.1.9</PdfPigVersion>
159168
<SystemLinqAsyncVersion>6.0.1</SystemLinqAsyncVersion>
160169
<!--

eng/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ fi
113113
# - If more than one solution is found - fail.
114114
if [[ "$hasProjects" == false ]]; then
115115
repoRoot=$(realpath $DIR/../)
116-
fileCount=$(find $repoRoot -path "$repoRoot/*.sln" | wc -l)
116+
fileCount=$(find $repoRoot -path "$repoRoot/*.sln" -maxdepth 1 | wc -l)
117117
if [[ $fileCount > 1 ]]; then
118118
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
119119
exit -1
@@ -154,4 +154,4 @@ if [[ "$testCoverage" == true ]]; then
154154
echo ""
155155
echo -e "\e[32mCode coverage results:\e[0m $testResultPath/CoverageResultsHtml/index.html"
156156
echo ""
157-
fi
157+
fi

src/ProjectTemplates/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ package-lock.json
66

77
# Don't track files generated for debugging templates locally.
88
*/src/**/*.csproj
9+
*/src/**/*.sln
910
*/src/**/NuGet.config
1011
*/src/**/Directory.Build.targets
11-
*/src/**/ingestioncache.db
12+
*/src/**/ingestioncache.*
1213

1314
# launchSettings.json files are required for the templates.
1415
!launchSettings.json

src/ProjectTemplates/GeneratedContent.targets

Lines changed: 53 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,36 @@
11
<Project>
22

33
<PropertyGroup>
4-
<_ChatWithCustomDataWebContentRoot>$(MSBuildThisFileDirectory)Microsoft.Extensions.AI.Templates\src\ChatWithCustomData\ChatWithCustomData.Web-CSharp\</_ChatWithCustomDataWebContentRoot>
4+
<!--
5+
Configures which chat template variant to use when debugging locally.
6+
Options are:
7+
- singleproject
8+
- aspire
9+
-->
10+
<_LocalChatTemplateVariant>aspire</_LocalChatTemplateVariant>
11+
12+
<_ChatWithCustomDataContentRoot>$(MSBuildThisFileDirectory)Microsoft.Extensions.AI.Templates\src\ChatWithCustomData\</_ChatWithCustomDataContentRoot>
513
</PropertyGroup>
614

715
<Target Name="ComputeGeneratedContentProperties">
816
<PropertyGroup>
917
<!-- Define optional pinned versions of certain dependencies. -->
10-
<TemplatePinnedMicrosoftExtensionsAIVersion>9.3.0-preview.1.25161.3</TemplatePinnedMicrosoftExtensionsAIVersion>
18+
<TemplatePinnedRepoPackagesVersion>9.3.0-preview.1.25161.3</TemplatePinnedRepoPackagesVersion>
1119
<TemplatePinnedMicrosoftEntityFrameworkCoreSqliteVersion>9.0.3</TemplatePinnedMicrosoftEntityFrameworkCoreSqliteVersion>
1220

13-
<!-- By default, use pinned dependency versions. -->
14-
<TemplateUsePinnedMicrosoftExtensionsAIVersion Condition="'$(TemplateUsePinnedMicrosoftExtensionsAIVersion)' == ''">false</TemplateUsePinnedMicrosoftExtensionsAIVersion>
21+
<!-- By default, don't use pinned dependency versions. -->
22+
<TemplateUsePinnedRepoPackagesVersion Condition="'$(TemplateUsePinnedRepoPackagesVersion)' == ''">false</TemplateUsePinnedRepoPackagesVersion>
1523
<TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion Condition="'$(TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion)' == ''">false</TemplateUsePinnedMicrosoftEntityFrameworkCoreSqliteVersion>
1624

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

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

25-
<_TemplateUsingJustBuiltPackages Condition="'$(TemplateMicrosoftExtensionsAIVersion)' == '$(Version)'">true</_TemplateUsingJustBuiltPackages>
33+
<_TemplateUsingJustBuiltPackages Condition="'$(TemplateRepoPackagesVersion)' == '$(Version)'">true</_TemplateUsingJustBuiltPackages>
2634

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

3442
<!-- Package version properties -->
35-
OllamaSharpVersion=$(OllamaSharpVersion);
36-
OpenAIVersion=$(OpenAIVersion);
43+
AspireVersion=$(AspireVersion);
44+
AspireAzureAIOpenAIVersion=$(AspireAzureAIOpenAIVersion);
3745
AzureAIProjectsVersion=$(AzureAIProjectsVersion);
3846
AzureAIOpenAIVersion=$(AzureAIOpenAIVersion);
3947
AzureIdentityVersion=$(AzureIdentityVersion);
48+
AzureSearchDocumentsVersion=$(AzureSearchDocumentsVersion);
49+
CommunityToolkitAspireHostingOllamaVersion=$(CommunityToolkitAspireHostingOllamaVersion);
50+
CommunityToolkitAspireHostingSqliteVersion=$(CommunityToolkitAspireHostingSqliteVersion);
51+
CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion=$(CommunityToolkitAspireMicrosoftEntityFrameworkCoreSqliteVersion);
52+
CommunityToolkitAspireOllamaSharpVersion=$(CommunityToolkitAspireOllamaSharpVersion);
4053
MicrosoftEntityFrameworkCoreSqliteVersion=$(TemplateMicrosoftEntityFrameworkCoreSqliteVersion);
41-
MicrosoftExtensionsAIVersion=$(TemplateMicrosoftExtensionsAIVersion);
54+
MicrosoftExtensionsAIVersion=$(TemplateRepoPackagesVersion);
55+
MicrosoftExtensionsHttpResilienceVersion=$(TemplateRepoPackagesVersion);
56+
MicrosoftExtensionsServiceDiscoveryVersion=$(MicrosoftExtensionsServiceDiscoveryVersion);
57+
MicrosoftSemanticKernelConnectorsAzureAISearchVersion=$(MicrosoftSemanticKernelConnectorsAzureAISearchVersion);
58+
MicrosoftSemanticKernelConnectorsQdrantVersion=$(MicrosoftSemanticKernelConnectorsQdrantVersion);
4259
MicrosoftSemanticKernelCoreVersion=$(MicrosoftSemanticKernelCoreVersion);
60+
OllamaSharpVersion=$(OllamaSharpVersion);
61+
OpenAIVersion=$(OpenAIVersion);
62+
OpenTelemetryVersion=$(OpenTelemetryVersion);
4363
PdfPigVersion=$(PdfPigVersion);
4464
SystemLinqAsyncVersion=$(SystemLinqAsyncVersion);
45-
AzureSearchDocumentsVersion=$(AzureSearchDocumentsVersion);
46-
MicrosoftSemanticKernelConnectorsAzureAISearchVersion=$(MicrosoftSemanticKernelConnectorsAzureAISearchVersion);
65+
66+
<!-- Other properties -->
67+
LocalChatTemplateVariant=$(_LocalChatTemplateVariant);
68+
UsingJustBuiltPackages=$(_TemplateUsingJustBuiltPackages);
4769
</GeneratedContentProperties>
4870
</PropertyGroup>
4971

5072
<ItemGroup>
5173
<GeneratedContent
52-
Include="$(_ChatWithCustomDataWebContentRoot)ChatWithCustomData.Web-CSharp.csproj.in"
53-
OutputPath="$(_ChatWithCustomDataWebContentRoot)ChatWithCustomData.Web-CSharp.csproj" />
74+
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.sln.in"
75+
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.sln" />
76+
<GeneratedContent
77+
Include="$(_ChatWithCustomDataContentRoot)Directory.Build.targets.in"
78+
OutputPath="$(_ChatWithCustomDataContentRoot)Directory.Build.targets" />
79+
<GeneratedContent
80+
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\ChatWithCustomData-CSharp.Web.csproj.in"
81+
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\ChatWithCustomData-CSharp.Web.csproj" />
82+
<GeneratedContent
83+
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\Directory.Build.targets.in"
84+
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.Web\Directory.Build.targets" />
85+
<GeneratedContent
86+
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.AppHost\ChatWithCustomData-CSharp.AppHost.csproj.in"
87+
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.AppHost\ChatWithCustomData-CSharp.AppHost.csproj" />
88+
<GeneratedContent
89+
Include="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.ServiceDefaults\ChatWithCustomData-CSharp.ServiceDefaults.csproj.in"
90+
OutputPath="$(_ChatWithCustomDataContentRoot)ChatWithCustomData-CSharp.ServiceDefaults\ChatWithCustomData-CSharp.ServiceDefaults.csproj" />
5491

5592
<!-- The following content only gets generated when using just-built packages -->
5693
<_GeneratedContentEnablingJustBuiltPackages
57-
Include="$(_ChatWithCustomDataWebContentRoot)NuGet.config.in"
58-
OutputPath="$(_ChatWithCustomDataWebContentRoot)NuGet.config" />
59-
<_GeneratedContentEnablingJustBuiltPackages
60-
Include="$(_ChatWithCustomDataWebContentRoot)Directory.Build.targets.in"
61-
OutputPath="$(_ChatWithCustomDataWebContentRoot)Directory.Build.targets" />
94+
Include="$(_ChatWithCustomDataContentRoot)NuGet.config.in"
95+
OutputPath="$(_ChatWithCustomDataContentRoot)NuGet.config" />
6296

6397
<GeneratedContent
6498
Include="@(_GeneratedContentEnablingJustBuiltPackages)"

src/ProjectTemplates/Microsoft.Extensions.AI.Templates/Microsoft.Extensions.AI.Templates.csproj

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<PackageType>Template</PackageType>
5-
<TargetFrameworks>$(NetCoreTargetFrameworks);netstandard2.0</TargetFrameworks>
5+
<TargetFrameworks>$(NetCoreTargetFrameworks)</TargetFrameworks>
66
<Description>Project templates for Microsoft.Extensions.AI.</Description>
77
<PackageTags>dotnet-new;templates;ai</PackageTags>
88

@@ -22,15 +22,24 @@
2222
<NoPackageAnalysis>true</NoPackageAnalysis>
2323
</PropertyGroup>
2424

25-
<!--
26-
Reference the GenerateTemplateContent project so that template content gets generated prior
27-
to building this project.
28-
-->
2925
<ItemGroup>
26+
<!--
27+
Reference the GenerateTemplateContent project so that template content gets generated prior
28+
to building this project.
29+
-->
3030
<ProjectReference
3131
Include="..\GenerateTemplateContent\GenerateTemplateContent.csproj"
3232
ReferenceOutputAssembly="false"
3333
PrivateAssets="all" />
34+
35+
<!--
36+
Internal packages referenced by the templates that aren't in the AI workstream.
37+
We include these references here so that local NuGet packages get generated for use by the templates.
38+
-->
39+
<ProjectReference
40+
Include="..\..\Libraries\Microsoft.Extensions.Http.Resilience\Microsoft.Extensions.Http.Resilience.csproj"
41+
ReferenceOutputAssembly="false"
42+
PrivateAssets="all" />
3443
</ItemGroup>
3544

3645
<ItemGroup>
@@ -40,13 +49,14 @@
4049
Exclude="
4150
**\bin\**;
4251
**\obj\**;
52+
**\.vs\**;
4353
**\node_modules\**;
4454
**\*.user;
4555
**\*.in;
4656
**\*.out.js;
4757
**\*.generated.css;
4858
**\package-lock.json;
49-
**\ingestioncache.db;
59+
**\ingestioncache.*;
5060
**\NuGet.config;
5161
**\Directory.Build.targets;" />
5262
<None Include="THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="." />

src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/dotnetcli.host.json

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,44 @@
11
{
22
"$schema": "https://json.schemastore.org/dotnetcli.host",
33
"symbolInfo": {
4-
"kestrelHttpPort": {
4+
"AiServiceProvider": {
5+
"longName": "provider",
6+
"shortName": ""
7+
},
8+
"VectorStore": {
9+
"longName": "vector-store",
10+
"shortName": ""
11+
},
12+
"UseManagedIdentity": {
13+
"longName": "managed-identity",
14+
"shortName": ""
15+
},
16+
"UseAspire": {
17+
"longName": "aspire",
18+
"shortName": ""
19+
},
20+
"webHttpPort": {
21+
"isHidden": true
22+
},
23+
"webHttpsPort": {
24+
"isHidden": true
25+
},
26+
"appHostHttpPort": {
27+
"isHidden": true
28+
},
29+
"appHostOtlpHttpPort": {
30+
"isHidden": true
31+
},
32+
"appHostResourceHttpPort": {
33+
"isHidden": true
34+
},
35+
"appHostHttpsPort": {
36+
"isHidden": true
37+
},
38+
"appHostOtlpHttpsPort": {
539
"isHidden": true
640
},
7-
"kestrelHttpsPort": {
41+
"appHostResourceHttpsPort": {
842
"isHidden": true
943
}
1044
},

src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/ide.host.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
{
1616
"id": "VectorStore",
1717
"isVisible": true
18+
},
19+
{
20+
"id": "UseAspire",
21+
"isVisible": true
1822
}
1923
]
2024
}

0 commit comments

Comments
 (0)