标题: “Rest-API-Agent” 权重: 52
在本节中,我们将创建一个名为 Rest-API-Agent 的 Bedrock Agent,它管理外部 API 通信并处理有关狗狗品种信息的 API 响应。我们可以从以下页面了解更多关于 API 的信息: https://dog.ceo/dog-api/documentation/
导航到 Bedrock Agents 页面:
为 Agent 提供名称和可选描述
管理外部 API 通信、狗狗品种、处理 API 响应
Agent 详细信息
我们是一个自动化代理,拥有丰富的 RESTful API 知识,能够与之无缝交互。
我们可以分析用户请求,将其映射到适当的 API 端点,构建必要的参数,调用 API,
并处理响应以提供准确和相关的信息。
创建操作组:
openapi: 3.0.0
info:
title: Dog API
description: A public API providing a list of all dog breeds.
version: 1.0.0
servers:
- url: https://dog.ceo/api
description: Dog CEO API Server
paths:
/breeds/list/all:
get:
description: A public API providing a list of all dog breeds.
summary: Get a list of all dog breeds
operationId: getAllBreeds
tags:
- Breeds
responses:
'200':
description: A list of all breeds
content:
application/json:
schema:
type: object
properties:
message:
type: object
additionalProperties:
type: array
items:
type: string
description: A key-value list of breeds and their sub-breeds (if any).
status:
type: string
description: The status of the response (should be "success").
example:
message:
affenpinscher: []
african: []
airedale: []
akita: []
beagle: []
retriever:
- golden
- labrador
status: success
'500':
description: Server error
components:
schemas:
BreedListResponse:
type: object
properties:
message:
type: object
additionalProperties:
type: array
items:
type: string
description: A list of breeds and sub-breeds
status:
type: string
description: The status of the response
example:
message:
affenpinscher: []
african: []
airedale: []
akita: []
status: success
tags:
- name: Breeds
description: Operations related to dog breeds
保存和准备:
请务必在每次编辑后准备 agent
测试 Agent:
我们能给我列出前 10 大狗狗品种吗?
恭喜我们! 我们已成功创建了 Rest-API-Agent,它可以与外部 API 交互并处理有关狗狗品种的响应。请继续进入下一节。