Skip to content

Commit 9a47c30

Browse files
authored
Merge pull request #645 from MicrosoftDocs/main
Merge from main to live
2 parents f9eeb5f + 3dc4079 commit 9a47c30

6 files changed

Lines changed: 147 additions & 8 deletions

File tree

agent-framework/TOC.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
- name: Index
2-
href: index.md
2+
href: index.md
3+
- name: Tutorials
4+
href: tutorials/TOC.yml

agent-framework/tutorials/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Index
2+
href: index.md
3+
- name: Create and run a simple agent
4+
href: run-agent.md

agent-framework/tutorials/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Agent Framework Tutorials
3+
description: Agent Framework Tutorials
4+
author: westey-m
5+
ms.topic: tutorial
6+
ms.author: westey-m
7+
ms.date: 09/15/2025
8+
ms.service: agent-framework
9+
---
10+
11+
# Agent Framework Tutorials
12+
13+
## Single Agent Tutorials
14+
15+
- [Create and run a simple agent](./run-agent.md)
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: Create and run a simple agent
3+
description: Create and run a simple agent
4+
zone_pivot_groups: programming-languages
5+
author: westey-m
6+
ms.topic: tutorial
7+
ms.author: westey
8+
ms.date: 09/15/2025
9+
ms.service: agent-framework
10+
---
11+
12+
# Create and run a simple agent
13+
14+
::: zone pivot="programming-language-csharp"
15+
16+
This tutorial shows you how to create and run a simple agent, based on the Azure OpenAI Chat Completion service.
17+
18+
> [!IMPORTANT]
19+
> The agent framework supports many different types of agents. This tutorial uses an agent based on a Chat Completion service, but all other agent types are run in the same way. See the [Agent Framework user guide](../user-guide/index.md) for more information on other agent types and how to construct them.
20+
21+
## Prerequisites
22+
23+
Before you begin, ensure you have the following prerequisites:
24+
25+
- [.NET 8.0 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
26+
- [Azure OpenAI service endpoint and deployment configured](https://learn.microsoft.com/azure/ai-foundry/openai/how-to/create-resource)
27+
- [Azure CLI installed](https://learn.microsoft.com/cli/azure/install-azure-cli) and [authenticated (for Azure credential authentication)](https://learn.microsoft.com/cli/azure/authenticate-azure-cli)
28+
- [User has the `Cognitive Services OpenAI User` or `Cognitive Services OpenAI Contributor` roles, depending on need, for the Azure OpenAI resource.](https://learn.microsoft.com/azure/ai-foundry/openai/how-to/role-based-access-control)
29+
30+
> [!IMPORTANT]
31+
> For this tutorial we are using Azure OpenAI for the Chat Completion service, but you can use any inference service that is compatible with [Microsoft.Extensions.AI.IChatClient](https://learn.microsoft.com/dotnet/api/microsoft.extensions.ai.ichatclient).
32+
33+
## Installing Nuget packages
34+
35+
To use the AgentFramework with Azure OpenAI, you need to install the following NuGet packages:
36+
37+
```powershell
38+
dotnet add package Azure.Identity
39+
dotnet add package Azure.AI.OpenAI
40+
dotnet add package Microsoft.Extensions.AI.OpenAI
41+
dotnet add package Microsoft.Agents.OpenAI
42+
```
43+
44+
## Creating the agent
45+
46+
- First we create create a client for Azure OpenAI, by providing the Azure OpenAI endpoint and using the same login as was used when authenticating with the Azure CLI in the [Prerequisites](#prerequisites) step.
47+
- Then we get a chat client for communicating with the chat completion service, where we also specify the specific model deployment to use. Use one of the deployments that you created in the [Prerequisites](#prerequisites) step.
48+
- Finally we create the agent, providing instructions and a name for the agent.
49+
50+
```csharp
51+
using System;
52+
using Azure.AI.OpenAI;
53+
using Azure.Identity;
54+
using Microsoft.Extensions.AI;
55+
using OpenAI;
56+
57+
AIAgent agent = new AzureOpenAIClient(
58+
new Uri("https://<myresource>.openai.azure.com"),
59+
new AzureCliCredential())
60+
.GetChatClient("gpt-4o-mini")
61+
.CreateAIAgent(instructions: "You are good at telling jokes.", name: "Joker");
62+
```
63+
64+
## Running the agent
65+
66+
To run the agent, call the `RunAsync` method on the agent instance, providing the user input.
67+
The agent will return a response object, and calling `.ToString()` or `.Text` on this response object, provides the text result from the agent.
68+
69+
```csharp
70+
Console.WriteLine(await agent.RunAsync("Tell me a joke about a pirate."));
71+
```
72+
73+
## Running the agent with streaming
74+
75+
To run the agent with streaming, call the `RunStreamingAsync` method on the agent instance, providing the user input.
76+
The agent will stream a list of update objects, and calling `.ToString()` or `.Text` on each update object provides the part of the text result contained in that update.
77+
78+
```csharp
79+
await foreach (var update in agent.RunStreamingAsync("Tell me a joke about a pirate."))
80+
{
81+
Console.WriteLine(update);
82+
}
83+
```
84+
85+
## Running the agent with a ChatMessage
86+
87+
Instead of a simple string, you can also provide one or more `ChatMessage` objects to the `RunAsync` and `RunStreamingAsync` methods.
88+
89+
```csharp
90+
ChatMessage message = new(ChatRole.User, [
91+
new TextContent("Tell me a joke about this image?"),
92+
new UriContent("https://samplesite.org/clown.jpg", "image/jpeg")
93+
]);
94+
95+
Console.WriteLine(await agent.RunAsync(message));
96+
```
97+
98+
::: zone-end
99+
::: zone pivot="programming-language-python"
100+
101+
Tutorial coming soon.
102+
103+
::: zone-end
104+
105+
## Next steps
106+
107+
> [!div class="nextstepaction"]
108+
> [Having a multi-turn conversation with an agent](./multi-turn-conversation.md)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# YamlMime:ZonePivotGroups
2+
groups:
3+
- id: programming-languages
4+
title: Programming languages
5+
prompt: Choose a programming language
6+
pivots:
7+
- id: programming-language-csharp
8+
title: C#
9+
- id: programming-language-python
10+
title: Python

semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/oracle-connector.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The Oracle Database Vector Store Connector can be used to access and manage data
4242
| Supported data property types | <ul><li>bool</li><li>byte</li><li>short</li><li>int</li><li>decimal</li><li>long</li><li>float</li><li>double</li><li>DateTime</li><li>DateTimeOffset</li><li>TimeSpan</li><li>char</li><li>char[]</li><li>byte[]</li><li>String</li><li>Guid</li><li>*and nullable type of the above types*</i></li></ul> |
4343
| Supported vector property types | <ul><li>ReadOnlyMemory\<float\></li><li>Embedding\<float\></li><li>float[]</li><li>ReadOnlyMemory\<double\></li><li>Embedding\<double\></li><li>double[]</li><li>ReadOnlyMemory\<short\></li><li>Embedding\<short\></li><li>short[]</li><li>ReadOnlyMemory\<byte\></li><li>Embedding\<byte\></li><li>byte[]</li><li>BitArray</li><li>BinaryEmbedding</li></ul> |
4444
| Supported index types | <ul><li>Flat (default)</li><li>HNSW</li><li>IVF</li></ul> |
45-
| Supported distance functions | <ul><li>CosineDistance</li><ul><li>FLOAT32, FLOAT64, and INT8 vector default</li></ul><li>CosineSimilarity</li><li>DotProductSimilarity</li><li>NegativeDotProductSimilarity</li><li>EuclideanDistance</li><li>EuclideanSquaredDistance</li><li>HammingDistance</li><ul><li>BINARY vector default</li></ul><li>ManhattanDistance</li><li>JaccardSimilarity</li></ul> |
45+
| Supported distance functions | <ul><li>CosineDistance</li><ul><li>FLOAT32, FLOAT64, and INT8 vector default</li></ul><li>CosineSimilarity</li><li>DotProductSimilarity</li><li>NegativeDotProductSimilarity</li><li>EuclideanDistance</li><li>EuclideanSquaredDistance</li><li>HammingDistance</li><ul><li>BINARY vector default</li></ul><li>ManhattanDistance</li><li>JaccardSimilarity<br> To use Jaccard similarity, set the DistanceFunction string to "JACCARD" or "JACCARDSIMILARITY" (for example, DistanceFunction = "JACCARDSIMILARITY"). This value is case sensitive. Jaccard similarity requires BINARY numeric format vectors. </li></ul> |
4646
| Supported filter clauses | <ul><li>==</li><li>!=</li><li><</li><li><=</li><li>></li><li>>=</li><li>List.Contains() <ul><li>Only when checking if the model property is in the list</li></ul></li></ul> |
4747
| Supports zero, one, or multiple vectors in a record | Yes |
4848
| IsIndexed supported? | Yes |
@@ -266,7 +266,7 @@ The Oracle Database Vector Store connector provides a default mapper when mappin
266266

267267
The Oracle Database Vector Store connector supports data model annotations and record definitions.Using annotations, the information can be provided to the data model for creating indexes and database column mapping. Using [record definitions](../schema-with-record-definition.md), the information can be defined and supplied separately from the data model.
268268

269-
The following table shows the default primary key data type mapping between Oracle database and C#:
269+
The following table shows the default primary key data type mapping between Oracle Database and C#:
270270

271271
| C# Data Type | Database Type |
272272
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -361,10 +361,10 @@ The Oracle Database Vector Store connector provides a default mapper when mappin
361361

362362
The Oracle Database Vector Store connector supports data model annotations and record definitions.Using annotations, the information can be provided to the data model for creating indexes and database column mapping. Using [record definitions](../schema-with-record-definition.md), the information can be defined and supplied separately from the data model.
363363

364-
The following table shows the default primary key data type mapping between Oracle database and Java, along with the corresponding methods to retrieve data from a `ResultSet`:
364+
The following table shows the default primary key data type mapping between Oracle Database and Java, along with the corresponding methods to retrieve data from a `ResultSet`:
365365

366366
| Java Type | Database Type | ResultSet Getter Method |
367-
| ------------- |:-------------:| -----:|
367+
| ------------- |-------------| -----|
368368
| byte/Byte | NUMBER(3) | `resultSet.getByte(name)`|
369369
| short/Short | NUMBER(5) |`resultSet.getShort(name)`|
370370
|int/Integer | NUMBER(10) |`resultSet.getInt(name)`|
@@ -375,7 +375,7 @@ The following table shows the default primary key data type mapping between Orac
375375
The following table shows the default data property type mapping along with the corresponding methods to retrieve data from a `ResultSet`:
376376

377377
| Java Type | Database Type | ResultSet Getter Method |
378-
| ------------- |:-------------:| -----:|
378+
| ------------- |-------------| -----|
379379
| boolean | BOOLEAN | `resultSet.getByte(name)`|
380380
|byte/Byte |NUMBER(3)|`resultSet.getByte(name)`|
381381
|byte[] |RAW(2000)|`resultSet.getBytes(name)`|
@@ -392,8 +392,8 @@ The following table shows the default data property type mapping along with the
392392

393393
Starting with Oracle Database 23ai, database vectors can be mapped to Java data types. Multiple vector columns are supported. The following table shows the default vector property type mapping:
394394

395-
| Java Type | Database Type
396-
| ------------- |:-------------:|
395+
| Java Type | Database Type|
396+
| ------------- |-------------|
397397
| String | VECTOR(%d, FLOAT32) |
398398
|Collection`<Float>`|VECTOR(%d, FLOAT32) |
399399
|List`<Float>` |VECTOR(%d, FLOAT32) |

0 commit comments

Comments
 (0)