Skip to content

Commit dd13bce

Browse files
IEvangelistCopilot
andauthored
Update API docs for Aspire 13.4 (#1132)
Regenerate the integration catalog, C# API JSON, TypeScript API JSON, and twoslash declarations from the release/13.4 NuGet feed. Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ef32e48 commit dd13bce

219 files changed

Lines changed: 43581 additions & 14744 deletions

File tree

Some content is hidden

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

src/frontend/scripts/generate-twoslash-types.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,13 @@ export declare const InputType: {
397397
}`,
398398
];
399399

400+
const POST_SNAPSHOT_DECLARATION_TYPE_NAMES = new Set([
401+
'BeforePublishEvent',
402+
'AfterPublishEvent',
403+
'InputType',
404+
'ParameterCustomInputOptions',
405+
]);
406+
400407
const POST_SNAPSHOT_AUGMENTATIONS = [
401408
`export interface IDistributedApplicationBuilder {
402409
/**
@@ -614,10 +621,15 @@ const BUILT_IN = new Set([
614621
]);
615622

616623
const declaredTypes = new Set<string>([
617-
...dtoTypes.map((d) => d.name),
618-
...enumTypes.map((e) => e.name),
624+
...dtoTypes
625+
.filter((d) => !POST_SNAPSHOT_DECLARATION_TYPE_NAMES.has(d.name))
626+
.map((d) => d.name),
627+
...enumTypes
628+
.filter((e) => !POST_SNAPSHOT_DECLARATION_TYPE_NAMES.has(e.name))
629+
.map((e) => e.name),
619630
...handleTypes.map((h) => h.name),
620631
...methodsByTarget.keys(),
632+
...POST_SNAPSHOT_DECLARATION_TYPE_NAMES,
621633
]);
622634

623635
const parts: string[] = [];
@@ -653,6 +665,7 @@ for (const declaration of POST_SNAPSHOT_DECLARATIONS) {
653665
parts.push('');
654666
}
655667
for (const en of enumTypes) {
668+
if (POST_SNAPSHOT_DECLARATION_TYPE_NAMES.has(en.name)) continue;
656669
parts.push(jsdoc([`Enum ${en.fullName}`]));
657670
const members = en.members.map((m) => JSON.stringify(m)).join(' | ') || 'string';
658671
parts.push(`export type ${en.name} = ${members};`);
@@ -669,6 +682,7 @@ for (const en of enumTypes) {
669682

670683
parts.push(`// ---- DTOs ----`);
671684
for (const dto of dtoTypes) {
685+
if (POST_SNAPSHOT_DECLARATION_TYPE_NAMES.has(dto.name)) continue;
672686
parts.push(jsdoc([`DTO ${dto.fullName}`]));
673687
parts.push(`export interface ${dto.name} {`);
674688
for (const f of dto.fields) {

src/frontend/src/content/docs/integrations/ai/github-models/github-models-host.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ import { createBuilder, GitHubModelName } from './.aspire/modules/aspire.mjs';
278278
const builder = await createBuilder();
279279

280280
const chat = await builder.addGitHubModel("chat", GitHubModelName.OpenAIGpt4oMini);
281-
await chat.withHealthCheck();
281+
chat.enableHealthCheck();
282282

283283
await builder.addNodeApp("api", "./api", "index.js")
284284
.withReference(chat);

src/frontend/src/content/docs/integrations/cloud/azure/azure-ai-foundry/azure-ai-foundry-host.mdx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ await foundry
351351

352352
## Publish a hosted agent to Azure AI Foundry
353353

354-
Use `PublishAsHostedAgent` to publish an executable or containerized app as a hosted agent in a Foundry project:
354+
Use `PublishAsHostedAgent` in C# or `withComputeEnvironment` in TypeScript to publish an executable or containerized app as a hosted agent in a Foundry project:
355355

356356
<Tabs syncKey='aspire-lang'>
357357
<TabItem id='csharp' label='C#'>
@@ -397,22 +397,22 @@ await builder
397397
.addPythonApp('agent-python', '../agent', 'main:app')
398398
.withReference(project)
399399
.withReference(chat)
400-
.publishAsHostedAgent({ project });
400+
.withComputeEnvironment({ project });
401401

402402
await builder
403403
.addProject('agent-dotnet', '../Agent/Agent.csproj')
404404
.withHttpEndpoint({ targetPort: 9000 })
405405
.withReference(project)
406406
.withReference(chat)
407-
.publishAsHostedAgent({ project });
407+
.withComputeEnvironment({ project });
408408

409409
await builder.build().run();
410410
```
411411

412412
</TabItem>
413413
</Tabs>
414414

415-
In run mode, `PublishAsHostedAgent(...)` configures a local `http` endpoint for the agent. Aspire first checks whether the resource already has an endpoint named `http`. If that endpoint has a target port, Aspire preserves it. If there is no existing `http` target port, Aspire defaults to `8088`.
415+
In run mode, the hosted-agent configuration configures a local `http` endpoint for the agent. Aspire first checks whether the resource already has an endpoint named `http`. If that endpoint has a target port, Aspire preserves it. If there is no existing `http` target port, Aspire defaults to `8088`.
416416

417417
Aspire also injects the selected port as `DEFAULT_AD_PORT`, so hosted-agent apps can bind to the right port:
418418

@@ -421,7 +421,7 @@ var port = Environment.GetEnvironmentVariable("DEFAULT_AD_PORT") ?? "8088";
421421
builder.WebHost.UseUrls($"http://+:{port}");
422422
```
423423

424-
If your hosted agent listens on a different port, declare the endpoint before calling `PublishAsHostedAgent(...)`:
424+
If your hosted agent listens on a different port, declare the endpoint before configuring the resource as a hosted agent:
425425

426426
<Tabs syncKey="aspire-lang">
427427
<TabItem id="csharp" label="C#">
@@ -450,7 +450,7 @@ const dotnetWeatherAgent = await builder
450450
.withReference(chat)
451451
.waitFor(chat);
452452

453-
await dotnetWeatherAgent.publishAsHostedAgent({ project });
453+
await dotnetWeatherAgent.withComputeEnvironment({ project });
454454
```
455455

456456
</TabItem>
@@ -509,12 +509,14 @@ const webSearch = await project.addWebSearchTool('web-search');
509509

510510
await project
511511
.addPromptAgent(
512-
chat,
513512
'web-researcher',
514-
`
513+
chat,
514+
{
515+
instructions: `
515516
You are the Web Researcher. Use web search for current information,
516517
cite sources, summarize tradeoffs, and keep answers concise and practical.
517-
`
518+
`,
519+
}
518520
)
519521
.withTool(webSearch);
520522

src/frontend/src/content/docs/integrations/cloud/azure/azure-openai/azure-openai-host.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Referencing `chat` passes a connection named `chat` to the consuming project, an
185185

186186
By default, Aspire provisions Azure OpenAI with `disableLocalAuth: true` and automatically creates a `CognitiveServicesOpenAIUser` role assignment for each app that references the resource. This means consuming apps authenticate via managed identity — no API key is needed.
187187

188-
To explicitly assign roles to a consuming app (for example, to grant contributor access for fine-tuning scenarios), call `WithRoleAssignments` (or `withRoleAssignments`) on the consuming resource:
188+
To explicitly assign roles to a consuming app (for example, to grant contributor access for fine-tuning scenarios), call `WithRoleAssignments` in C# or `withCognitiveServicesRoleAssignments` in TypeScript on the consuming resource:
189189

190190
<Tabs syncKey="aspire-lang">
191191
<TabItem id="csharp" label="C#">
@@ -219,7 +219,7 @@ const chat = await openai.addDeployment("chat", "gpt-4o", "2024-08-06");
219219
await builder.addNodeApp("api", "./api", "index.js")
220220
.withReference(chat)
221221
.waitFor(chat)
222-
.withRoleAssignments(openai, [AzureOpenAIRole.CognitiveServicesOpenAIContributor]);
222+
.withCognitiveServicesRoleAssignments(openai, [AzureOpenAIRole.CognitiveServicesOpenAIContributor]);
223223

224224
// After adding all resources, run the app...
225225
```

src/frontend/src/content/docs/integrations/cloud/azure/role-assignments.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ const builder = await createBuilder();
8686
const search = await builder.addAzureSearch("search");
8787

8888
const api = await builder.addProject("api", "../Api/Api.csproj");
89-
await api.withRoleAssignments(search, [AzureSearchRole.SearchIndexDataReader]);
89+
await api.withSearchRoleAssignments(search, [AzureSearchRole.SearchIndexDataReader]);
9090
await api.withReference(search);
9191
````
9292

9393
</TabItem>
9494
</Tabs>
9595

96-
When you use the `WithRoleAssignments` method, it replaces the default role assignments with the specified ones. This method requires two parameters: the resource to which the role assignment applies and the built-in role to assign. In the preceding example, the `search` resource is assigned the `Azure.Provisioning.Search.SearchBuiltInRole.SearchIndexDataReader` role.
96+
When you use the `WithRoleAssignments` method in C# or a resource-specific TypeScript role assignment method such as `withSearchRoleAssignments`, it replaces the default role assignments with the specified ones. This method requires two parameters: the resource to which the role assignment applies and the built-in role to assign. In the preceding example, the `search` resource is assigned the `Azure.Provisioning.Search.SearchBuiltInRole.SearchIndexDataReader` role.
9797

9898
When you replace the default role assignments with the `SearchIndexDataReader` role, the API project is restricted to only reading data from the Azure Search resource. This ensures the API project can't write data to the Azure Search resource.
9999

src/frontend/src/content/docs/ja/whats-new/aspire-13-2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ const chat = await project.addModelDeployment("chat", {
880880
await builder.addPythonApp("agent", "../agent", "main:app")
881881
.withReference(project)
882882
.withReference(chat)
883-
.publishAsHostedAgent({ project });
883+
.withComputeEnvironment({ project });
884884

885885
await builder.build().run();
886886
```

src/frontend/src/content/docs/whats-new/aspire-13-2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ const chat = await project.addModelDeployment("chat", {
881881
await builder.addPythonApp("agent", "../agent", "main:app")
882882
.withReference(project)
883883
.withReference(chat)
884-
.publishAsHostedAgent({ project });
884+
.withComputeEnvironment({ project });
885885

886886
await builder.build().run();
887887
```

0 commit comments

Comments
 (0)