# Anthropic API 테스트
from langchain_anthropic import ChatAnthropic
try:
llm = ChatAnthropic(
model="claude-3-haiku-20240307",
api_key=ANTHROPIC_API_KEY
)
response = llm.invoke(
[
{"role": "system", "content": "당신은 친절한 AI Assistance 입니다."},
{"role": "user", "content": "1줄로만 다음 내용을 반영해주세요."},
]
)
print(response.content)
print(">>> Anthropic API 성공")
except Exception as e:
print(f">>> Anthropic API 실패 {e}")