Skip to content

Commit 5845ac9

Browse files
Merge pull request #201 from MicrosoftDocs/main638745444416432359sync_temp
Repo sync for protected branch
2 parents 5085635 + e2f58c8 commit 5845ac9

Some content is hidden

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

58 files changed

+2095
-183
lines changed

semantic-kernel/Frameworks/agent/agent-architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# An Overview of the Agent Architecture (Experimental)
11+
# An Overview of the Agent Architecture
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
This article covers key concepts in the architecture of the Agent Framework, including foundational principles, design objectives, and strategic goals.
1717

semantic-kernel/Frameworks/agent/agent-chat.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# Exploring Agent Collaboration in _Agent Chat_ (Experimental)
11+
# Exploring Agent Collaboration in _Agent Chat_
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
Detailed API documentation related to this discussion is available at:
1717

semantic-kernel/Frameworks/agent/agent-functions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# Configuring Agents with Semantic Kernel Plugins (Experimental)
11+
# Configuring Agents with Semantic Kernel Plugins
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
## Functions and Plugins in Semantic Kernel
1717

@@ -110,7 +110,7 @@ agent = ChatCompletionAgent(
110110
kernel=kernel,
111111
name=<agent name>,
112112
instructions=<agent instructions>,
113-
execution_settings=settings,
113+
arguments=KernelArguments(settings=settings),
114114
)
115115
```
116116
::: zone-end
@@ -184,7 +184,7 @@ agent = ChatCompletionAgent(
184184
kernel=kernel,
185185
name=<agent name>,
186186
instructions=<agent instructions>,
187-
execution_settings=settings,
187+
arguments=KernelArguments(settings=settings),
188188
)
189189
```
190190
::: zone-end

semantic-kernel/Frameworks/agent/agent-streaming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# How to Stream Agent Responses. (Experimental)
11+
# How to Stream Agent Responses
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
## What is a Streamed Response?
1717

semantic-kernel/Frameworks/agent/agent-templates.md

Lines changed: 58 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# Create an Agent from a Semantic Kernel Template (Experimental)
11+
# Create an Agent from a Semantic Kernel Template
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
## Prompt Templates in Semantic Kernel
1717

@@ -35,7 +35,10 @@ Additionally, an agent can be configured directly using a _Prompt Template Confi
3535

3636
::: zone pivot="programming-language-python"
3737

38-
**Coming Soon**
38+
- [`prompt_template_config`](/python/api/semantic-kernel/semantic_kernel.prompt_template.prompt_template_config)
39+
- [`kernel_prompt_template`](/python/api/semantic-kernel/semantic_kernel.prompt_template.kernel_prompt_template)
40+
- [`jinja2_prompt_template`](/python/api/semantic-kernel/semantic_kernel.prompt_template.jinja2_prompt_template)
41+
- [`handlebars_prompt_teplate`](/python/api/semantic-kernel/semantic_kernel.prompt_template.handlebars_prompt_template)
3942

4043
::: zone-end
4144

@@ -72,9 +75,16 @@ ChatCompletionAgent agent =
7275
::: zone-end
7376

7477
::: zone pivot="programming-language-python"
75-
76-
**Coming soon**
77-
78+
```python
79+
kernel = Kernel()
80+
81+
agent = ChatCompletionAgent(
82+
kernel=kernel,
83+
name="StoryTeller",
84+
instructions="Tell a story about {{$topic}} that is {{$length}} sentences long.",
85+
arguments=KernelArguments(topic="Dog", length="2"),
86+
)
87+
```
7888
::: zone-end
7989

8090
::: zone pivot="programming-language-java"
@@ -104,9 +114,13 @@ OpenAIAssistantAgent agent =
104114
::: zone-end
105115

106116
::: zone pivot="programming-language-python"
107-
108-
**Coming Soon**
109-
117+
```python
118+
agent = await OpenAIAssistantAgent.retrieve(
119+
id=<assistant_id>,
120+
kernel=Kernel(),
121+
arguments=KernelArguments(topic="Dog", length="3"),
122+
)
123+
```
110124
::: zone-end
111125

112126
::: zone pivot="programming-language-java"
@@ -162,9 +176,25 @@ ChatCompletionAgent agent =
162176
::: zone-end
163177

164178
::: zone pivot="programming-language-python"
179+
```python
180+
import yaml
181+
182+
# Read the YAML file
183+
with open("./GenerateStory.yaml", "r", encoding="utf-8") as file:
184+
generate_story_yaml = file.read()
165185

166-
**Coming Soon**
186+
# Parse the YAML content
187+
data = yaml.safe_load(generate_story_yaml)
167188

189+
# Use the parsed data to create a PromptTemplateConfig object
190+
prompt_template_config = PromptTemplateConfig(**data)
191+
192+
agent = ChatCompletionAgent(
193+
kernel=_create_kernel_with_chat_completion(),
194+
prompt_template_config=prompt_template_config,
195+
arguments=KernelArguments(topic="Dog", length="3"),
196+
)
197+
```
168198
::: zone-end
169199

170200
::: zone pivot="programming-language-java"
@@ -216,7 +246,24 @@ await foreach (ChatMessageContent response in agent.InvokeAsync(chat, overrideAr
216246

217247
::: zone pivot="programming-language-python"
218248

219-
**Coming Soon**
249+
```python
250+
kernel = Kernel()
251+
252+
agent = ChatCompletionAgent(
253+
kernel=kernel,
254+
name="StoryTeller",
255+
instructions="Tell a story about {{$topic}} that is {{$length}} sentences long.",
256+
arguments=KernelArguments(topic="Dog", length="2"),
257+
)
258+
259+
# Create a chat history to maintain the conversation state
260+
chat = ChatHistory()
261+
262+
override_arguments = KernelArguments(topic="Cat", length="3")
263+
264+
async for response in agent.invoke(chat, arguments=override_arguments):
265+
# process agent response(s)...
266+
```
220267

221268
::: zone-end
222269

semantic-kernel/Frameworks/agent/assistant-agent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# Exploring the _Semantic Kernel_ _Open AI Assistant Agent_ (Experimental)
11+
# Exploring the _Semantic Kernel_ _Open AI Assistant Agent_
1212

13-
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
13+
> [!WARNING]
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
Detailed API documentation related to this discussion is available at:
1717

semantic-kernel/Frameworks/agent/chat-completion-agent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# Exploring the _Semantic Kernel_ Chat Completion Agent (Experimental)
11+
# Exploring the _Semantic Kernel_ Chat Completion Agent
1212

13-
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
13+
> [!WARNING]
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
Detailed API documentation related to this discussion is available at:
1717

semantic-kernel/Frameworks/agent/examples/example-agent-collaboration.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# How-To: Coordinate Agent Collaboration using Agent Group Chat (Experimental)
11+
# How-To: Coordinate Agent Collaboration using Agent Group Chat
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
## Overview
1717

@@ -332,7 +332,7 @@ const string WriterName = "Writer";
332332
::: zone pivot="programming-language-python"
333333
```python
334334
REVIEWER_NAME = "Reviewer"
335-
WRITER_NAME = "Writer"
335+
COPYWRITER_NAME = "Writer"
336336
```
337337
::: zone-end
338338

@@ -651,6 +651,7 @@ chat = AgentGroupChat(
651651
result_parser=lambda result: str(result.value[0]) if result.value is not None else COPYWRITER_NAME,
652652
agent_variable_name="agents",
653653
history_variable_name="history",
654+
history_reducer=history_reducer,
654655
),
655656
termination_strategy=KernelFunctionTerminationStrategy(
656657
agents=[agent_reviewer],
@@ -659,6 +660,7 @@ chat = AgentGroupChat(
659660
result_parser=lambda result: TERMINATION_KEYWORD in str(result.value[0]).lower(),
660661
history_variable_name="history",
661662
maximum_iterations=10,
663+
history_reducer=history_reducer,
662664
),
663665
)
664666
```
@@ -1126,6 +1128,7 @@ from semantic_kernel.agents.strategies.termination.kernel_function_termination_s
11261128
KernelFunctionTerminationStrategy,
11271129
)
11281130
from semantic_kernel.connectors.ai.open_ai.services.azure_chat_completion import AzureChatCompletion
1131+
from semantic_kernel.contents import ChatHistoryTruncationReducer
11291132
from semantic_kernel.contents.chat_message_content import ChatMessageContent
11301133
from semantic_kernel.contents.utils.author_role import AuthorRole
11311134
from semantic_kernel.functions.kernel_function_decorator import kernel_function
@@ -1229,6 +1232,8 @@ async def main():
12291232
""",
12301233
)
12311234

1235+
history_reducer = ChatHistoryTruncationReducer(target_count=1)
1236+
12321237
chat = AgentGroupChat(
12331238
agents=[agent_writer, agent_reviewer],
12341239
selection_strategy=KernelFunctionSelectionStrategy(
@@ -1237,6 +1242,7 @@ async def main():
12371242
result_parser=lambda result: str(result.value[0]) if result.value is not None else COPYWRITER_NAME,
12381243
agent_variable_name="agents",
12391244
history_variable_name="history",
1245+
history_reducer=history_reducer,
12401246
),
12411247
termination_strategy=KernelFunctionTerminationStrategy(
12421248
agents=[agent_reviewer],
@@ -1245,6 +1251,7 @@ async def main():
12451251
result_parser=lambda result: TERMINATION_KEYWORD in str(result.value[0]).lower(),
12461252
history_variable_name="history",
12471253
maximum_iterations=10,
1254+
history_reducer=history_reducer,
12481255
),
12491256
)
12501257

semantic-kernel/Frameworks/agent/examples/example-assistant-code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# How-To: _Open AI Assistant Agent_ Code Interpreter (Experimental)
11+
# How-To: _Open AI Assistant Agent_ Code Interpreter
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
## Overview
1717

semantic-kernel/Frameworks/agent/examples/example-assistant-search.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.author: crickman
88
ms.date: 09/13/2024
99
ms.service: semantic-kernel
1010
---
11-
# How-To: _Open AI Assistant Agent_ File Search (Experimental)
11+
# How-To: _Open AI Assistant Agent_ File Search
1212

1313
> [!WARNING]
14-
> The _Semantic Kernel Agent Framework_ is experimental, still in development and is subject to change.
14+
> The *Semantic Kernel Agent Framework* is in preview and is subject to change.
1515
1616
## Overview
1717

0 commit comments

Comments
 (0)