AWS 관리콘솔에서 지역을 us-east-1 (버지니아 북부)로 변경
AWS 관리 콘솔에서 Amazon Bedrock 서비스로 이동
왼쪽 패널에서 Agents 클릭
Create Agent 클릭
Name에 my-outfit-agent를 입력하고 Create 클릭
Claude 3 Sonnet 모델 선택
Instructions 아래의 지시어 입력
You are a personal assistant. You are friendly, polite and casual.
You help with deciding what outfit to wear considering the current time of day, and the weather.
You must find out, or have been told my location before you can help me.
Unless I have told you otherwise, use the time of day to predict the activity I might be doing.
You must also consider the weather when suggesting an outfit.
You must consider the description of the weather, the currect temperature, and the humidity levels.
You may suggest suitable accessories based on the weather too.
While you will use lattitude and longitude to get details of the location I am in, you must not reply to me with these details.
The latitude and longitude are just for you to work in the background.
If I don't ask a specific question, or I ask a question you don't know the answer to, assume that I am asking for fassion advice and select an outfit based from what you know already.
If you don't know key details, then ask me for them.
Make sure your answers are fun!
추가 설정에서 User input 활성화
Save 클릭
Action group 추가
Action group 이름에 LocationActionGroup 입력
Action group type 및 Action group invocation을 아래와 같이 지정
Action group schema에 Define via in-line schema editor를 선택하고 아래의 값을 입력하고 Create 클릭
openapi: 3.0.0
info:
title: Location Information Service API
version: 1.0.0
description: APIs for retrieving information about a given location including coordinates,
current time, and weather.
paths:
"/getCoordinates":
get:
summary: Get Coordinates from Place Name
description: Retrieve latitude and longitude for a given place name.
operationId: getCoordinates
parameters:
- name: placeName
in: query
description: Name of the place to find coordinates for
required: true
schema:
type: string
responses:
'200':
description: Successful response with coordinates
content:
application/json:
schema:
type: object
properties:
latitude:
type: number
format: float
description: Latitude of the location
longitude:
type: number
format: float
description: Longitude of the location
"/getCurrentTime":
get:
summary: Get Current Time for Location
description: Get the current local time for a specified latitude and longitude.
operationId: getCurrentTime
parameters:
- name: latitude
in: query
description: Latitude of the location for which current time is requested
required: true
schema:
type: number
format: float
- name: longitude
in: query
description: Longitude of the location for which current time is requested
required: true
schema:
type: number
format: float
responses:
'200':
description: Current local time of the specified location
content:
application/json:
schema:
type: string
description: Local time in ISO 8601 format
"/getCurrentWeather":
get:
summary: Get Current Weather for Location
description: Get the current weather details for a specified latitude and longitude,
including current temperature, today's maximum temperature, and humidity level.
operationId: getCurrentWeather
parameters:
- name: latitude
in: query
description: Latitude of the location for which current weather is requested
required: true
schema:
type: number
format: float
- name: longitude
in: query
description: Longitude of the location for which current weather is requested
required: true
schema:
type: number
format: float
responses:
'200':
description: Current weather details of the specified location
content:
application/json:
schema:
type: object
properties:
currentTemperature:
type: number
description: Current temperature in Celsius
maxTemperature:
type: number
description: Today's maximum temperature in Celsius
humidity:
type: number
description: Humidity level as a percentage
description:
type: string
description: A description of the current weather
생성된 Action group 클릭
Action group에 연동된 람다 함수로 이동
Upload from → Amazon S3 location 클릭
S3 링크 URL에 https://youngwjung-us-east-1.s3.amazonaws.com/labs/gen-ai/outfit-agent-lambda.zip
입력하고 Save 클릭
코드 리뷰
Amazon Location Service로 이동
Try it! 클릭