Note
The Agents SDK is generally available ((GA)) for C#/.NET and JavaScript/Node.js.
This example shows you how to download and run the Empty Agent sample from GitHub.
Prerequisites
You need a few things before you get started. These steps use the Empty Agent sample, but any Agents SDK sample could be used.
Set up and run the sample agent
There are three ways to get started:
- Clone and run the Empty/echo agent sample available on GitHub
- Use the Microsoft 365 Agents Toolkit. The Agents Toolkit has two built-in templates for Visual Studio and Visual Studio Code that use the Microsoft 365 Agents SDK for starting with an Echo/Empty Agent and a Weather Agent that uses Azure Foundry or OpenAI Services with either Semantic Kernel or LangChain
- Use the CLI, as shown in the quickstart
The steps depend on the language you're using. Follow the instructions for your language of choice.
Open the solution file EmptyAgent.csproj
in Visual Studio.
Run the project.
At this point, your agent is running locally using port 3978.
Next, start your agent locally. We provide instructions for VS Code. For Node samples, we also provide:
- A workspace
- Launch settings to help with debugging from VS Code.
Open the sample folder in VS Code using File > Open Folder.
Open a terminal window in VS Code using Terminal > New Terminal. A terminal window opens, and should be pointing to the Echo Agent/Empty Agent sample folder.
In the terminal, run the following command to install the required packages:
npm install
This command installs the needed packages in the app, pulling from registries as needed. You can see the code in the node_modules
subfolder.
Create a .env file in the folder. There's a template file env.TEMPLATE in the sample folder that you can use.
In the terminal, run the following command to start the app:
npm start
You can see messages in the terminal verifying that the app is started and listening on port 3978.
First, install the Agents SDK Python packages from TestPyPI, in the following order:
pip install -i https://test.pypi.org/simple/ microsoft-agents-core
pip install -i https://test.pypi.org/simple/ microsoft-agents-authorization
pip install -i https://test.pypi.org/simple/ microsoft-agents-connector
pip install -i https://test.pypi.org/simple/ microsoft-agents-builder
pip install -i https://test.pypi.org/simple/ microsoft-agents-authentication-msal
pip install -i https://test.pypi.org/simple/ microsoft-agents-hosting-aiohttp
The empty_agent
sample uses the dotenv
package, so install this package with pip install python-dotenv
.
Clone the empty_agent
sample from the Agents GitHub repo. The Echo Agent sample has all the files you need to configure and run the Echo Agent agent.
Next, start your agent locally. We provide instructions for VS Code.
Install the Agents SDK packages before starting.
Open the sample folder in VS Code using File > Open Folder.
Open a terminal window in VS Code using Terminal > New Terminal. A terminal window opens, and should be pointing to the Echo Agent sample folder.
Run the Echo Agent sample with the following command:
python app.py
The agent starts and runs on the port specified in the terminal window (3978, by default).
Test your agent locally
If you haven't done so already, install the Agents Playground
winget install agentsplayground
Start the Agent in VS or VS Code
Start the Teams App Tester. At a command prompt: agentsplayground
- The tool will open a web browser showing the Teams App Test Tool, ready to send messages to your agent.
Interact with the Agent via the browser
- From the project directory, start the test tool with
npm run test
This command opens a new browser window with a teams app test chat client running.
Type inputs and submit them to send to the agent. The agent echoes back the messages you send to the agent.
To test your agent, you should use the Microsoft 365 Agents Playground.
The Agents Playground is available by default if you're already using the Microsoft 365 Agents Toolkit. You can use one of the following guides if you want to get started with the toolkit:
Connect to the Agents Playground
If you didn't start with the Agents Toolkit, you can still use the Agents Playground. You just need to connect your code with the test tool.
Next Steps