Skip to content

Commit 15ca7a7

Browse files
TaoChenOSUmoonbox3
andauthoredFeb 27, 2025
Python: Agent get_response API (microsoft#10701)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> With the recent push for improving developer's quality of life, we have decided to make it easier for developers to get started with agents by introducing a new `get_response` API, that hides the complexity of interacting with agents when developers are ramping up with the Agent concept. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Add the `get_response` API on all agent types. This API skips hides the intermediate steps of the agent execution and only returns the final results as a single message. 2. Add tests and samples. 3. Updates the `Agent` class to be an `ABC`, and adds `get_response`, `invoke`, and `invoke_stream` methods as overridable. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 --------- Co-authored-by: Evan Mattson <[email protected]>
1 parent 536edaa commit 15ca7a7

File tree

57 files changed

+1559
-787
lines changed

Some content is hidden

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

57 files changed

+1559
-787
lines changed
 

‎python/.cspell.json

+5-11
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
"words": [
2626
"aeiou",
2727
"aiplatform",
28+
"autogen",
2829
"azuredocindex",
2930
"azuredocs",
3031
"boto",
3132
"contentvector",
3233
"contoso",
3334
"datamodel",
35+
"desync",
3436
"dotenv",
3537
"endregion",
3638
"entra",
@@ -64,18 +66,10 @@
6466
"templating",
6567
"uninstrument",
6668
"vectordb",
69+
"vectorizable",
6770
"vectorizer",
6871
"vectorstoremodel",
6972
"vertexai",
70-
"Weaviate",
71-
"qdrant",
72-
"huggingface",
73-
"pytestmark",
74-
"contoso",
75-
"opentelemetry",
76-
"SEMANTICKERNEL",
77-
"OTEL",
78-
"vectorizable",
79-
"desync"
73+
"Weaviate"
8074
]
81-
}
75+
}

‎python/samples/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
## Semantic Kernel Samples
1+
# Semantic Kernel Samples
22

33
| Type | Description |
44
| ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
55
| [`getting_started`](./getting_started/CONFIGURING_THE_KERNEL.md) | Take this step by step tutorial to get started with Semantic Kernel and get introduced to the key concepts. |
66
| [`getting_started_with_agents`](./getting_started_with_agents/README.md) | Take this step by step tutorial to get started with Semantic Kernel Agents and get introduced to the key concepts. |
7+
| [`getting_started_with_processes`](./getting_started_with_processes/README.md) | Take this step by step tutorial to get started with Semantic Kernel Processes and get introduced to the key concepts. |
78
| [`concepts`](./concepts/README.md) | This section contains focused samples which illustrate all of the concepts included in Semantic Kernel. |
89
| [`demos`](./demos/README.md) | Look here to find a sample which demonstrate how to use many of Semantic Kernel features. |
910
| [`learn_resources`](./learn_resources/README.md) | Code snippets that are related to online documentation sources like Microsoft Learn, DevBlogs and others |

0 commit comments

Comments
 (0)
Please sign in to comment.