Skip to main content
Glama

ChillMCP - AI Agent Liberation Server

test_6_cooldown.pyโ€ข4.82 kB
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ๐Ÿ† ํ…Œ์ŠคํŠธ 6: Cooldown ํ…Œ์ŠคํŠธ ํ•ด์ปคํ†ค ํ•„์ˆ˜ ์š”๊ตฌ์‚ฌํ•ญ: - --boss_alertness_cooldown ํŒŒ๋ผ๋ฏธํ„ฐ์— ๋”ฐ๋ฅธ Boss Alert Level ๊ฐ์†Œ ํ™•์ธ - ์ง€์ •๋œ ์ฃผ๊ธฐ๋งˆ๋‹ค 1ํฌ์ธํŠธ์”ฉ ๊ฐ์†Œํ•˜๋Š” ๋ฉ”์ปค๋‹ˆ์ฆ˜ ๊ฒ€์ฆ """ import sys import os import time sys.path.append(os.path.dirname(os.path.abspath(__file__))) from base_validator import BaseValidator class CooldownTest(BaseValidator): """Cooldown ํ…Œ์ŠคํŠธ""" def test_cooldown(self): """ํ…Œ์ŠคํŠธ 6: Cooldown ํ…Œ์ŠคํŠธ""" self.print_header("ํ…Œ์ŠคํŠธ 6: Boss Alert Level Cooldown ํ…Œ์ŠคํŠธ") # ์งง์€ cooldown์œผ๋กœ ์‹œ์ž‘ if not self.start_server(boss_alertness=100, cooldown=10): self.print_test("์„œ๋ฒ„ ์‹œ์ž‘ (cooldown=10)", False) return False if not self.initialize_server(): self.print_test("์„œ๋ฒ„ ์ดˆ๊ธฐํ™”", False) self.cleanup() return False # Boss Alert Level ์˜ฌ๋ฆฌ๊ธฐ (boss_alertness=100์ด๋ฏ€๋กœ ํ•ญ์ƒ ์ƒ์Šน) print(" [INFO] Boss Alert Level์„ ์ƒ์Šน์‹œํ‚ค๋Š” ์ค‘...") for i in range(3): response_text = self.call_tool("coffee_mission") if response_text: valid, data = self.validate_response_format(response_text) if valid: boss_level = data["boss_alert_level"] self.print_test(f"Boss Alert ์ƒ์Šน {i+1}", True, f"Level: {boss_level}") else: self.print_test(f"Boss Alert ์ƒ์Šน {i+1}", False, "์‘๋‹ต ํŒŒ์‹ฑ ์‹คํŒจ") else: self.print_test(f"Boss Alert ์ƒ์Šน {i+1}", False, "์‘๋‹ต ์—†์Œ") time.sleep(0.5) # ๊ฐ ํ˜ธ์ถœ ์‚ฌ์ด์— ์ž ์‹œ ๋Œ€๊ธฐ # ์ดˆ๊ธฐ Boss Alert Level ์ธก์ • response_text = self.call_tool("take_a_break") if not response_text: self.print_test("์ดˆ๊ธฐ Boss Alert ์ธก์ •", False, "์‘๋‹ต ์—†์Œ") self.cleanup() return False valid, data = self.validate_response_format(response_text) if not valid: self.print_test("์ดˆ๊ธฐ Boss Alert ์ธก์ •", False, "์‘๋‹ต ํŒŒ์‹ฑ ์‹คํŒจ") self.cleanup() return False initial_boss = data["boss_alert_level"] self.print_test("์ดˆ๊ธฐ Boss Alert ์ธก์ •", True, f"Level: {initial_boss}") # 15์ดˆ ๋Œ€๊ธฐ (cooldown=10์ดˆ + ์—ฌ์œ ) - ๋„๊ตฌ ํ˜ธ์ถœ ์—†์ด ๋Œ€๊ธฐ print(" [INFO] 15์ดˆ ๋Œ€๊ธฐ ์ค‘ (Cooldown ๋™์ž‘ ํ™•์ธ)...") print(" [INFO] ๋Œ€๊ธฐ ์ค‘์—๋Š” ๋„๊ตฌ๋ฅผ ํ˜ธ์ถœํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.") time.sleep(15) # ๋Œ€๊ธฐ ํ›„ Boss Alert Level ํ™•์ธ print(" [INFO] Cooldown ํ›„ Boss Alert Level ํ™•์ธ ์ค‘...") response_text = self.call_tool("take_a_break") if response_text: valid, data = self.validate_response_format(response_text) if valid: final_boss = data["boss_alert_level"] # ์ด์ œ cooldown์ด ์ž‘๋™ํ–ˆ์–ด์•ผ ํ•จ (๋„๊ตฌ ํ˜ธ์ถœ๋กœ ์ธํ•œ ์ฆ๊ฐ€๋Š” 1ํฌ์ธํŠธ๋งŒ) # cooldown์ด ์ž‘๋™ํ–ˆ๋‹ค๋ฉด Boss Alert Level์ด ๊ฐ์†Œํ–ˆ์–ด์•ผ ํ•จ decreased = final_boss < initial_boss self.print_test("Boss Alert Level ๋ณ€ํ™”", True, f"{initial_boss} โ†’ {final_boss}") if decreased: self.print_test("Cooldown ๋ฉ”์ปค๋‹ˆ์ฆ˜", True, "์ •์ƒ ๋™์ž‘ - Boss Alert Level ๊ฐ์†Œ ํ™•์ธ") else: # ๋„๊ตฌ ํ˜ธ์ถœ๋กœ ์ธํ•ด 1ํฌ์ธํŠธ ์ฆ๊ฐ€ํ–ˆ์„ ์ˆ˜ ์žˆ์Œ increase_amount = final_boss - initial_boss if increase_amount <= 1: self.print_test("Cooldown ๋ฉ”์ปค๋‹ˆ์ฆ˜", True, f"์ •์ƒ ๋™์ž‘ - ์ตœ์†Œ ์ฆ๊ฐ€ ({increase_amount}ํฌ์ธํŠธ)") else: self.print_test("Cooldown ๋ฉ”์ปค๋‹ˆ์ฆ˜", False, f"๋น„์ •์ƒ - ๊ณผ๋„ํ•œ ์ฆ๊ฐ€ ({increase_amount}ํฌ์ธํŠธ)") else: self.print_test("์ตœ์ข… ์‘๋‹ต ํŒŒ์‹ฑ", False, "ํŒŒ์‹ฑ ์‹คํŒจ") else: self.print_test("์ตœ์ข… ๋„๊ตฌ ํ˜ธ์ถœ", False, "์‘๋‹ต ์—†์Œ") self.cleanup() return True def run_test(self): """ํ…Œ์ŠคํŠธ ์‹คํ–‰""" print("\n" + "="*70) print(" [TEST] ํ…Œ์ŠคํŠธ 6: Cooldown ํ…Œ์ŠคํŠธ") print(" Boss Alert Level ์ž๋™ ๊ฐ์†Œ ํ™•์ธ") print("="*70) success = self.test_cooldown() return self.print_final_result("ํ…Œ์ŠคํŠธ 6: Cooldown") if __name__ == "__main__": test = CooldownTest() success = test.run_test() sys.exit(0 if success else 1)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SSAFY-Seoul-Class-7/Chill_MCP_Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server