License to Bill๐ธ๐ธ: MCP ์์ด์ ํธ์ Bedrock Budget Protocol
Source: Dev.to
์ฌ์ ์๊ตฌ ์ฌํญ
- โ ํ์ฑ AWS ๊ณ์
- ๐ง Foundation Models(FM)์ Amazon Bedrock์ ๋ํ ๊ธฐ๋ณธ์ ์ธ ์ดํด
- ๐ป AWS Command Line Interface(CLI)๊ฐ ์ค์น๋๊ณ ์๊ฒฉ ์ฆ๋ช ์ด ๊ตฌ์ฑ๋จ
- ๐ Pythonโฏ3.11 ์ด์
- ๐ ๏ธ AWS Cloud Development Kit(CDK) CLI๊ฐ ์ค์น๋จ
- ๐ค Amazon Bedrock์์ Anthropic์ Claudeโฏ3.5โฏSonnetโฏv2 ๋ชจ๋ธ ์ ๊ทผ์ด ํ์ฑํ๋จ
- ๐ ์๋ฒ ์ธ์ฆ์ ์ํด
AWS_ACCESS_KEY_ID์AWS_SECRET_ACCESS_KEY๋ฅผ ํ๊ฒฝ ๋ณ์๋ก ์ค์
์์: InlineAgent Hello World
from bedrock_agents.agent import InlineAgent
InlineAgent(
foundationModel="us.anthropic.claude-3-5-haiku-20241022-v1:0",
instruction="You are a friendly assistant that is supposed to say hello to everything.",
userInput=True,
agentName="hello-world-agent",
).invoke("Hi how are you? What can you do for me?")
์ํ ์ถ๋ ฅ
SessionId: 99c0924d-d5ae-4080-9f59-8b8dc501977e
2025-04-04 17:34:11,438 - botocore.credentials - INFO - Found credentials in shared credentials file: ~/.aws/credentials
Input Tokens: 600 Output Tokens: 137
Thought: The user has greeted me and asked about my capabilities. I'll respond in a friendly manner and use the user interaction tool to engage with them.
Hello there! I'm doing great, thank you for asking. I'm a friendly assistant who loves to say hello to everything! What would you like help with today? I'm ready to assist you with any questions or tasks you might have.
Agent made a total of 1 LLM calls, using 737 tokens (in: 600, out: 137), and took 4.7 total seconds