Skip to content

Commit 5a1de49

Browse files
Fix README's and update getting started (#352)
1 parent ef16774 commit 5a1de49

File tree

3 files changed

+77
-151
lines changed

3 files changed

+77
-151
lines changed

README.md

Lines changed: 12 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Get Started with Microsoft Agent Framework
1+
# Microsoft Agent Framework
22

33
Highlights
44
- Flexible Agent Framework: build, orchestrate, and deploy AI agents and multi-agent systems
@@ -11,150 +11,21 @@ Highlights
1111

1212
Below are the basics for each language implementation. For more details on python see [here](./python/README.md) and for .NET see [here](./dotnet/README.md).
1313

14-
## Python - Quick Install
15-
16-
```bash
17-
pip install agent-framework
18-
# Optional: Add Azure integration
19-
pip install agent-framework[azure]
20-
# Optional: Add Foundry integration
21-
pip install agent-framework[foundry]
22-
# Optional: Both
23-
pip install agent-framework[azure,foundry]
24-
```
25-
26-
Supported Platforms:
27-
- Python: 3.10+
28-
- OS: Windows, macOS, Linux
29-
30-
## Python - 1. Setup API Keys
31-
32-
Set as environment variables, or create a .env file at your project root:
33-
34-
```bash
35-
OPENAI_API_KEY=sk-...
36-
OPENAI_CHAT_MODEL_ID=...
37-
OPENAI_RESPONSES_MODEL_ID=...
38-
...
39-
AZURE_OPENAI_API_KEY=...
40-
AZURE_OPENAI_ENDPOINT=...
41-
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=...
42-
...
43-
FOUNDRY_PROJECT_ENDPOINT=...
44-
FOUNDRY_MODEL_DEPLOYMENT_NAME=...
45-
```
46-
47-
You can also override environment variables by explicitly passing configuration parameters to the chat client constructor:
48-
49-
```python
50-
from agent_framework.azure import AzureChatClient
51-
52-
chat_client = AzureChatClient(
53-
api_key=...,
54-
endpoint=...,
55-
deployment_name=...,
56-
api_version=...,
57-
)
58-
```
59-
60-
See the following [setup guide](https://github.com/microsoft/agent-framework/tree/main/python/samples/getting_started) for more information.
61-
62-
## Python - 2. Create a Simple Agent
63-
64-
Create agents and invoke them directly:
65-
66-
```python
67-
import asyncio
68-
from agent_framework import ChatClientAgent
69-
from agent_framework.foundry import FoundryChatClient
70-
71-
async def main():
72-
async with ChatClientAgent(
73-
chat_client=FoundryChatClient(),
74-
instructions="""These are the Three Laws of Robotics:
75-
1) A robot may not injure a human being...
76-
2) A robot must obey orders given it by human beings...
77-
3) A robot must protect its own existence...
78-
79-
Respond concisely to the user's request.
80-
"""
81-
):
82-
result = await agent.run("Summarize the Three Laws of Robotics")
83-
print(result.text)
84-
"""
85-
Output:
86-
Protect humans, obey, self-preserve, prioritized.
87-
"""
88-
89-
if __name__ == "__main__":
90-
asyncio.run(main())
91-
```
92-
93-
## Python - 3. Build an Agent with Tools
94-
95-
Enhance your agent with custom tools and function calling:
96-
97-
```python
98-
import asyncio
99-
from typing import Annotated
100-
from random import randint
101-
from pydantic import Field
102-
from agent_framework import ChatClientAgent
103-
from agent_framework.openai import OpenAIResponsesClient
104-
105-
106-
def get_weather(
107-
location: Annotated[str, Field(description="The location to get the weather for.")],
108-
) -> str:
109-
"""Get the weather for a given location."""
110-
conditions = ["sunny", "cloudy", "rainy", "stormy"]
111-
return f"The weather in {location} is {conditions[randint(0, 3)]} with a high of {randint(10, 30)}°C."
112-
113-
114-
def get_menu_specials() -> str:
115-
"""Get today's menu specials."""
116-
return """
117-
Special Soup: Clam Chowder
118-
Special Salad: Cobb Salad
119-
Special Drink: Chai Tea
120-
"""
121-
122-
123-
async def main():
124-
agent = ChatClientAgent(
125-
chat_client=OpenAIResponsesClient(),
126-
instructions="You are a helpful assistant that can provide weather and restaurant information.",
127-
tools=[get_weather, get_menu_specials]
128-
)
129-
130-
response = await agent.run("What's the weather in Amsterdam and what are today's specials?")
131-
print(response.text)
132-
133-
"""
134-
Output:
135-
The weather in Amsterdam is sunny with a high of 22°C. Today's specials include
136-
Clam Chowder soup, Cobb Salad, and Chai Tea as the special drink.
137-
"""
138-
139-
if __name__ == "__main__":
140-
asyncio.run(main())
141-
```
142-
143-
You can explore additional agent samples [here](https://github.com/microsoft/agent-framework/tree/main/python/samples/getting_started/agents).
144-
145-
**Note**: Advanced orchestration patterns like GroupChat, Sequential, and Concurrent orchestrations are coming soon.
146-
14714
## More Examples & Samples
14815

149-
- [Getting Started with Agents](https://github.com/microsoft/agent-framework/tree/main/python/samples/getting_started/agents): Basic agent creation and tool usage
150-
- [Chat Client Examples](https://github.com/microsoft/agent-framework/tree/main/python/samples/getting_started/chat_client): Direct chat client usage patterns
151-
- [Azure Integration](https://github.com/microsoft/agent-framework/tree/main/python/packages/azure): Azure OpenAI and AI Foundry integration
152-
- [.NET Orchestration Samples](https://github.com/microsoft/agent-framework/tree/main/dotnet/samples/GettingStarted/Orchestration): Advanced multi-agent patterns (.NET)
16+
### Python
17+
- [Getting Started with Agents](./python/samples/getting_started/agents): Basic agent creation and tool usage
18+
- [Chat Client Examples](./python/samples/getting_started/chat_client): Direct chat client usage patterns
19+
- [Azure Integration](./python/packages/azure): Azure OpenAI and AI Foundry integration
20+
21+
### .Net
22+
- [Getting Started with Agents](./dotnet/samples/GettingStarted/Steps): Basic agent creation and tool usage
23+
- [Agent Provider Samples](./dotnet/samples/GettingStarted/Providers): Samples showing different agent providers
24+
- [Orchestration Samples](./dotnet/samples/GettingStarted/Orchestration): Advanced multi-agent patterns
15325

15426
## Agent Framework Documentation
15527

15628
- [Agent Framework Repository](https://github.com/microsoft/agent-framework)
157-
- [Python Package Documentation](https://github.com/microsoft/agent-framework/tree/main/python)
158-
- [.NET Package Documentation](https://github.com/microsoft/agent-framework/tree/main/dotnet)
159-
- [Design Documents](https://github.com/microsoft/agent-framework/tree/main/docs/design)
29+
- [Design Documents](./docs/design)
30+
- [Architectural Decision Records](./docs/decisions)
16031
- Learn docs are coming soon.

dotnet/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Get Started with Microsoft Agent Framework for C# Developers
2+
3+
## Run the Minimal Console demo
4+
5+
The Minimal Console demo is a simple console application which shows how to create and run an agent.
6+
7+
Supported Platforms:
8+
- .Net: net9.0, net8.0, netstandard2.0, net472
9+
- OS: Windows, macOS, Linux
10+
11+
If you want to use the latest published packages following the instructions [here](../docs/FAQS.md).
12+
13+
### 1. Configure required environment variables
14+
15+
This samples uses Azure OpenAI by default so you need to set the following environment variable
16+
17+
``` powershell
18+
$env:AZURE_OPENAI_ENDPOINT = "https://<your deployment>.openai.azure.com/"
19+
```
20+
21+
If you want to use OpenAI
22+
23+
1. Edit [Program.cs](./demos/MinimalConsole/Program.cs) and change the following lines:
24+
```csharp
25+
AIAgent agent = new AzureOpenAIClient(
26+
new Uri(Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!),
27+
new AzureCliCredential())
28+
.GetChatClient("gpt-4o-mini")
29+
.CreateAIAgent(
30+
instructions: "You are a helpful assistant, you can help the user with weather information.",
31+
tools: [AIFunctionFactory.Create(GetWeather)]);
32+
```
33+
To this:
34+
```csharp
35+
AIAgent agent = new OpenAIClient(Environment.GetEnvironmentVariable("OPENAI_API_KEY")!)
36+
.GetChatClient("gpt-4o-mini")
37+
.CreateAIAgent(
38+
instructions: "You are a helpful assistant, you can help the user with weather information.",
39+
tools: [AIFunctionFactory.Create(GetWeather)]);
40+
```
41+
2. Create an environment variable with your OpenAI key
42+
``` powershell
43+
$env:OPENAI_API_KEY = "sk-..."
44+
```
45+
46+
### 2. Build the project
47+
48+
```powershell
49+
cd demos\MinimalConsole
50+
dotnet build
51+
```
52+
53+
### 3. Run the demonstration
54+
55+
``` powershell
56+
dotnet run --framework net9.0 --no-build
57+
```
58+
59+
Sample output:
60+
61+
```
62+
The weather in Amsterdam is currently cloudy, with a high temperature of 15°C.
63+
```
64+

python/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
# Get Started with Microsoft Agent Framework
2-
3-
Highlights
4-
- Flexible Agent Framework: build, orchestrate, and deploy AI agents and multi-agent systems
5-
- Multi-Agent Orchestration: Group chat, sequential, concurrent, and handoff patterns
6-
- Plugin Ecosystem: Extend with native functions, OpenAPI, Model Context Protocol (MCP), and more
7-
- LLM Support: OpenAI, Azure OpenAI, Azure AI Foundry, and more
8-
- Runtime Support: In-process and distributed agent execution
9-
- Multimodal: Text, vision, and function calling
10-
- Cross-Platform: .NET and Python implementations
1+
# Get Started with Microsoft Agent Framework for Python Developers
112

123
## Quick Install
134

0 commit comments

Comments
 (0)