-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
31 lines (22 loc) · 907 Bytes
/
test.py
File metadata and controls
31 lines (22 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class AIService:
def __init__(self, api_key):
self.api_key = api_key
def transform_text(self, text):
# 실제 API 호출 대신 변환 예시
return "🤖" + text.upper()
# 상속
class AdvancedAIService(AIService):
def transform_text(self, text):
result = super().transform_text(text)
return f"[AI 변환]: {result}"
# 상속
class AdvancedAIServiceForHuman(AIService):
def transform_text(self, text):
result = super().transform_text(text)
return f"[사람 텍스트 변환]: {result}"
base = AIService("dummy_key")
print(base.transform_text("hello world")) # HELLO WORLD
ady = AdvancedAIService("dummy_key")
print(ady.transform_text("hello_world")) # [AI 변환]: HELLO WORLD
ady2_human = AdvancedAIServiceForHuman("ff")
print(ady2_human.transform_text("난 사람이야")) # [사람 텍스트 변환]: 난 사람이야.