Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You can enhance the abilities of your agent by adding skills. Skills can be added either by enabling built-in capabilities like image generator or code interpreter, or by adding API plugins as custom actions.
Important
This guide assumes you have completed the Create declarative agents using Microsoft 365 Agents Toolkit tutorial.
Add image generator to the agent
The image generator capability enables agents to generate images based on user prompts.
Open the
appPackage/declarativeAgent.json
file and add theGraphicArt
entry to thecapabilities
array.{ "name": "GraphicArt" }
For more information, see Graphic art object.
Select Provision in the Lifecycle pane of the Agents Toolkit.
The declarative agent will have the ability to generate images after you reload the page.
Add code interpreter to the agent
Code interpreter is an advanced tool designed to solve complex tasks via Python code.
Open the
appPackage/declarativeAgent.json
file and add theCodeInterpreter
entry to thecapabilities
array.{ "name": "CodeInterpreter" }
For more information, see Code interpreter object.
Select Provision in the Lifecycle pane of the Agents Toolkit.
The declarative agent will have the code interpreter capability after you reload the page.
Add an API plugin as a custom action to the agent
API plugins add new abilities to your agent by allowing your agent to interact with a REST API.
Before you begin, create a file named posts-api.yml
and add the code from the Posts API OpenAPI description document.
Select Add Action in the Development pane of Agents Toolkit.
Select Start with an OpenAPI Description Document.
Select Browse and browse to the
posts-api.yml
file.Select all available APIs, then select OK.
Select manifest.json.
Review the warning in the dialog. When you're ready to proceed, select Add.
Select Provision in the Lifecycle pane of the Agents Toolkit.
The declarative agent will have access to your plugin content to generate its answers after you reload the page.
Posts API OpenAPI description document
The following OpenAPI description is for the JSONPlaceHolder API, a free online REST API that you can use whenever you need some fake data.
openapi: '3.0.2'
info:
title: Posts API
version: '1.0'
servers:
- url: https://jsonplaceholder.typicode.com/
components:
schemas:
post:
type: object
properties:
userId:
type: integer
description: The ID of the user that authored the post.
id:
type: integer
title:
type: string
body:
type: string
user:
type: object
properties:
id:
type: integer
name:
type: string
username:
type: string
email:
type: string
phone:
type: string
website:
type: string
address:
$ref: '#/components/schemas/address'
company:
$ref: '#/components/schemas/company'
address:
type: object
properties:
street:
type: string
suite:
type: string
city:
type: string
zipcode:
type: string
geo:
$ref: '#/components/schemas/coordinates'
coordinates:
type: object
properties:
lat:
type: string
description: The latitude of the ___location
lng:
type: string
description: The longitude of the ___location
company:
type: object
properties:
name:
type: string
catchPhrase:
type: string
bs:
type: string
parameters:
post-id:
name: post-id
in: path
description: 'key: id of post'
required: true
style: simple
schema:
type: integer
user-id:
name: user-id
in: path
description: 'key: id of user'
required: true
style: simple
schema:
type: integer
paths:
/posts:
get:
description: Get posts
operationId: GetPosts
parameters:
- name: userId
in: query
description: Filter results by user ID
required: false
style: form
schema:
type: integer
maxItems: 1
- name: title
in: query
description: Filter results by title
required: false
style: form
schema:
type: string
maxItems: 1
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/post'
post:
description: 'Create post'
operationId: CreatePost
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/post'
responses:
'201':
description: Created
content:
application/json:
schema:
$ref: '#/components/schemas/post'
/posts/{post-id}:
get:
description: 'Get post by ID'
operationId: GetPostById
parameters:
- $ref: '#/components/parameters/post-id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/post'
patch:
description: 'Update post'
operationId: UpdatePost
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/post'
parameters:
- $ref: '#/components/parameters/post-id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/post'
delete:
description: 'Delete post'
operationId: DeletePost
parameters:
- $ref: '#/components/parameters/post-id'
responses:
'200':
description: OK
/users:
get:
summary: Get users
description: Returns details about users
operationId: GetUsers
parameters:
- name: name
in: query
description: The user's real name
schema:
type: string
- name: username
in: query
description: The user's login name
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/user'
/users/{user-id}:
get:
description: 'Get user by ID'
operationId: GetUserById
parameters:
- $ref: '#/components/parameters/user-id'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/user'
Related content
You've completed the declarative agent guide for Microsoft 365 Copilot. Now that you're familiar with the capabilities of a declarative agent, you can learn more about declarative agents in the following articles.
- Learn how to build declarative agents with TypeSpec.
- Learn how to write effective instructions for your agent.
- Test your agent with Copilot developer mode to verify if and how the copilot orchestrator selects your knowledge sources for use in response to given prompts.
- Get answers to frequently asked questions.
- Learn about an alternative method of building declarative agents with Copilot Studio agent builder.