Skip to content

Commit 646a30f

Browse files
.NET: Declarative Agents (microsoft#2476)
* Update the declarative agent samples * Add the Microsoft.Agents.AI.Declarative project * Make the package non packable * Use the RecalcEngine when creating the ChatOptions * Ignore VSTHRD200 * Add geting started samples * Address code review feedback
1 parent d82ebef commit 646a30f

Some content is hidden

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

43 files changed

+2411
-36
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
kind: Prompt
22
name: Assistant
33
description: Helpful assistant
4-
instructions: You are a helpful assistant. You answer questions is the language specified by the user. You return your answers in a JSON format. You must include Assistants as the type in your response.
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format. You must include Assistants as the type in your response.
55
model:
6-
id: =Env.AZURE_OPENAI_DEPLOYMENT_NAME
6+
id: gpt-4o-mini
77
provider: AzureOpenAI
88
apiType: Assistants
99
options:
@@ -12,14 +12,14 @@ model:
1212
outputSchema:
1313
properties:
1414
language:
15-
kind: string
15+
type: string
1616
required: true
1717
description: The language of the answer.
1818
answer:
19-
kind: string
19+
type: string
2020
required: true
2121
description: The answer text.
2222
type:
23-
kind: string
23+
type: string
2424
required: true
2525
description: The type of the response.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
kind: Prompt
2+
name: Assistant
3+
description: Helpful assistant
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format. You must include Chat as the type in your response.
5+
model:
6+
id: gpt-4o-mini
7+
provider: AzureOpenAI
8+
apiType: Chat
9+
options:
10+
temperature: 0.9
11+
topP: 0.95
12+
outputSchema:
13+
properties:
14+
language:
15+
type: string
16+
required: true
17+
description: The language of the answer.
18+
answer:
19+
type: string
20+
required: true
21+
description: The answer text.
22+
type:
23+
type: string
24+
required: true
25+
description: The type of the response.
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
11
kind: Prompt
22
name: Assistant
33
description: Helpful assistant
4-
instructions: You are a helpful assistant. You answer questions is the language specified by the user. You return your answers in a JSON format. You must include Responses as the type in your response.
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format. You must include Responses as the type in your response.
55
model:
6-
id: =Env.AZURE_OPENAI_DEPLOYMENT_NAME
6+
id: gpt-4o-mini
77
provider: AzureOpenAI
88
apiType: Responses
99
options:
10-
text:
11-
verbosity: medium
12-
connection:
13-
kind: remote
14-
endpoint: =Env.AZURE_OPENAI_ENDPOINT
10+
temperature: 0.9
11+
topP: 0.95
1512
outputSchema:
1613
properties:
1714
language:
18-
kind: string
15+
type: string
1916
required: true
2017
description: The language of the answer.
2118
answer:
22-
kind: string
19+
type: string
2320
required: true
2421
description: The answer text.
2522
type:
26-
kind: string
23+
type: string
2724
required: true
2825
description: The type of the response.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
kind: Prompt
22
name: Assistant
33
description: Helpful assistant
4-
instructions: You are a helpful assistant. You answer questions is the language specified by the user. You return your answers in a JSON format.
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format.
55
model:
66
options:
77
temperature: 0.9
88
topP: 0.95
99
outputSchema:
1010
properties:
1111
language:
12-
kind: string
12+
type: string
1313
required: true
1414
description: The language of the answer.
1515
answer:
16-
kind: string
16+
type: string
1717
required: true
1818
description: The answer text.

agent-samples/chatclient/GetWeather.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ description: Helpful assistant
44
instructions: You are a helpful assistant. You answer questions using the tools provided.
55
model:
66
options:
7+
temperature: 0.9
8+
topP: 0.95
79
allowMultipleToolCalls: true
810
chatToolMode: auto
911
tools:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
kind: Prompt
2+
name: Assistant
3+
description: Helpful assistant
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format.
5+
model:
6+
id: gpt-4.1-mini
7+
options:
8+
temperature: 0.9
9+
topP: 0.95
10+
connection:
11+
kind: Remote
12+
endpoint: =Env.AZURE_FOUNDRY_PROJECT_ENDPOINT
13+
outputSchema:
14+
properties:
15+
language:
16+
type: string
17+
required: true
18+
description: The language of the answer.
19+
answer:
20+
type: string
21+
required: true
22+
description: The answer text.
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
kind: Prompt
22
name: Assistant
33
description: Helpful assistant
4-
instructions: You are a helpful assistant. You answer questions is the language specified by the user. You return your answers in a JSON format. You must include Assistants as the type in your response.
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format. You must include Assistants as the type in your response.
55
model:
6-
id: =Env.OPENAI_MODEL
6+
id: gpt-4.1-mini
77
provider: OpenAI
88
apiType: Assistants
99
options:
1010
temperature: 0.9
1111
topP: 0.95
1212
connection:
13-
kind: key
13+
kind: ApiKey
1414
key: =Env.OPENAI_APIKEY
1515
outputSchema:
16-
name: AssistantResponse
17-
description: The response from the assistant.
1816
properties:
1917
language:
20-
kind: string
18+
type: string
2119
required: true
2220
description: The language of the answer.
2321
answer:
24-
kind: string
22+
type: string
2523
required: true
2624
description: The answer text.
2725
type:
28-
kind: string
26+
type: string
2927
required: true
3028
description: The type of the response.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
kind: Prompt
2+
name: Assistant
3+
description: Helpful assistant
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format. You must include Chat as the type in your response.
5+
model:
6+
id: gpt-4.1-mini
7+
provider: OpenAI
8+
apiType: Chat
9+
options:
10+
temperature: 0.9
11+
topP: 0.95
12+
connection:
13+
kind: ApiKey
14+
key: =Env.OPENAI_APIKEY
15+
outputSchema:
16+
properties:
17+
language:
18+
type: string
19+
required: true
20+
description: The language of the answer.
21+
answer:
22+
type: string
23+
required: true
24+
description: The answer text.
25+
type:
26+
type: string
27+
required: true
28+
description: The type of the response.
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
kind: Prompt
22
name: Assistant
33
description: Helpful assistant
4-
instructions: You are a helpful assistant. You answer questions is the language specified by the user. You return your answers in a JSON format. You must include Responses as the type in your response.
4+
instructions: You are a helpful assistant. You answer questions in the language specified by the user. You return your answers in a JSON format. You must include Responses as the type in your response.
55
model:
6-
id: =Env.OPENAI_MODEL
6+
id: gpt-4.1-mini
77
provider: OpenAI
88
apiType: Responses
99
options:
10-
text:
11-
verbosity: medium
10+
temperature: 0.9
11+
topP: 0.95
1212
connection:
13-
kind: key
13+
kind: ApiKey
1414
key: =Env.OPENAI_APIKEY
1515
outputSchema:
1616
properties:
1717
language:
18-
kind: string
18+
type: string
1919
required: true
2020
description: The language of the answer.
2121
answer:
22-
kind: string
22+
type: string
2323
required: true
2424
description: The answer text.
2525
type:
26-
kind: string
26+
type: string
2727
required: true
2828
description: The type of the response.

dotnet/agent-framework-dotnet.slnx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
<Project Path="samples/GettingStarted/Agents/Agent_Step16_ChatReduction/Agent_Step16_ChatReduction.csproj" />
7979
<Project Path="samples/GettingStarted/Agents/Agent_Step17_BackgroundResponses/Agent_Step17_BackgroundResponses.csproj" />
8080
<Project Path="samples/GettingStarted/Agents/Agent_Step18_DeepResearch/Agent_Step18_DeepResearch.csproj" />
81+
<Project Path="samples/GettingStarted/Agents/Agent_Step19_Declarative/Agent_Step19_Declarative.csproj" />
82+
</Folder>
83+
<Folder Name="/Samples/GettingStarted/DeclarativeAgents/">
84+
<Project Path="samples/GettingStarted/DeclarativeAgents/ChatClient/DeclarativeChatClientAgents.csproj" />
8185
</Folder>
8286
<Folder Name="/Samples/GettingStarted/DevUI/">
8387
<File Path="samples/GettingStarted/DevUI/README.md" />
@@ -343,12 +347,13 @@
343347
<Folder Name="/src/">
344348
<Project Path="src/Microsoft.Agents.AI.A2A/Microsoft.Agents.AI.A2A.csproj" />
345349
<Project Path="src/Microsoft.Agents.AI.Abstractions/Microsoft.Agents.AI.Abstractions.csproj" />
346-
<Project Path="src/Microsoft.Agents.AI.CosmosNoSql/Microsoft.Agents.AI.CosmosNoSql.csproj" />
347350
<Project Path="src/Microsoft.Agents.AI.AGUI/Microsoft.Agents.AI.AGUI.csproj" />
348351
<Project Path="src/Microsoft.Agents.AI.Anthropic/Microsoft.Agents.AI.Anthropic.csproj" />
349352
<Project Path="src/Microsoft.Agents.AI.AzureAI.Persistent/Microsoft.Agents.AI.AzureAI.Persistent.csproj" />
350353
<Project Path="src/Microsoft.Agents.AI.AzureAI/Microsoft.Agents.AI.AzureAI.csproj" />
351354
<Project Path="src/Microsoft.Agents.AI.CopilotStudio/Microsoft.Agents.AI.CopilotStudio.csproj" />
355+
<Project Path="src/Microsoft.Agents.AI.CosmosNoSql/Microsoft.Agents.AI.CosmosNoSql.csproj" />
356+
<Project Path="src/Microsoft.Agents.AI.Declarative/Microsoft.Agents.AI.Declarative.csproj" />
352357
<Project Path="src/Microsoft.Agents.AI.DevUI/Microsoft.Agents.AI.DevUI.csproj" />
353358
<Project Path="src/Microsoft.Agents.AI.DurableTask/Microsoft.Agents.AI.DurableTask.csproj" />
354359
<Project Path="src/Microsoft.Agents.AI.Hosting.A2A.AspNetCore/Microsoft.Agents.AI.Hosting.A2A.AspNetCore.csproj" />
@@ -384,11 +389,12 @@
384389
<Folder Name="/Tests/UnitTests/">
385390
<Project Path="tests/Microsoft.Agents.AI.A2A.UnitTests/Microsoft.Agents.AI.A2A.UnitTests.csproj" />
386391
<Project Path="tests/Microsoft.Agents.AI.Abstractions.UnitTests/Microsoft.Agents.AI.Abstractions.UnitTests.csproj" />
387-
<Project Path="tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj" />
388392
<Project Path="tests/Microsoft.Agents.AI.AGUI.UnitTests/Microsoft.Agents.AI.AGUI.UnitTests.csproj" />
389393
<Project Path="tests/Microsoft.Agents.AI.Anthropic.UnitTests/Microsoft.Agents.AI.Anthropic.UnitTests.csproj" />
390394
<Project Path="tests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests/Microsoft.Agents.AI.AzureAI.Persistent.UnitTests.csproj" />
391395
<Project Path="tests/Microsoft.Agents.AI.AzureAI.UnitTests/Microsoft.Agents.AI.AzureAI.UnitTests.csproj" />
396+
<Project Path="tests/Microsoft.Agents.AI.CosmosNoSql.UnitTests/Microsoft.Agents.AI.CosmosNoSql.UnitTests.csproj" />
397+
<Project Path="tests/Microsoft.Agents.AI.Declarative.UnitTests/Microsoft.Agents.AI.Declarative.UnitTests.csproj" />
392398
<Project Path="tests/Microsoft.Agents.AI.DevUI.UnitTests/Microsoft.Agents.AI.DevUI.UnitTests.csproj" />
393399
<Project Path="tests/Microsoft.Agents.AI.DurableTask.UnitTests/Microsoft.Agents.AI.DurableTask.UnitTests.csproj" />
394400
<Project Path="tests/Microsoft.Agents.AI.Hosting.A2A.UnitTests/Microsoft.Agents.AI.Hosting.A2A.UnitTests.csproj" />

0 commit comments

Comments
 (0)