Skip to content

alexheat/Random-User-Declarative-Agent-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random-User-Declarative-Agent- (Unofficial Sample App)

Sample Declarative Agent for Microsoft 365 Copilot using the public random user generator API at https://randomuser.me/.

image

This tutorial uses the Teams Toolkit and Visual Studio Code to build the sample agent, if you have not used the Teams Toolkit before I recomend completing this official tutorial first Create declarative agents using Teams Toolkit.

Planning the Agent

I am a member of the Microsoft Copilot team working on the Declarative Agent platform and I created this sample app to explore and test building an agent that retrieves data from external APIs (also known as actions).

My first step was finding a suitable API. At Apipheny, a site offering a collection of free public APIs, I discovered a random user data generator randomuser.me). This open-source API provides details about a fictional user, including gender, name, email, and address—a “Lorem Ipsum” for user data.

Build the Open API Specification File

The creators of Random User don’t provide an OpenAPI specification file, but you can use Copilot to generate one from the available documentation. Try this prompt:

Can you create an open API specification from this web page https://randomuser.me/documentation

image

Next ask Copilot to save it as a YAML file image

Build the Declarative Agent Using the Teams Toolkit and Visual Studio Code

In the Teams Toolkit, select Create New App, select Agent, Declarative Agent, Add Plugin, and then select “Start with an OpenAPI Description Document”, and browse to the YAML file. alt text The Teams Toolkit will build the files needed for a declarative agent. The files you want to edit to add the functionality are in the /appPackage.

image

The only 2 files you probably need to modify are instructions.txt (where you put the LLM instructions for what the agent should do) and declarativeAgent.json (where you can add the conversation starters) and other configurations.

When you're ready, select Provision to validate the agent, package it into a zip file, and deploy it.

image

About

Sample declarative agent for Microsoft 365 Copilot using the public random user generator API https://randomuser.me/

Topics

Resources

License

Stars

Watchers

Forks