Skip to content

Commit 0c96e96

Browse files
committed
모델 변경 및 주석 번역
1 parent 8aed1d4 commit 0c96e96

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

7_langchain/langserve_lyrics.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
from langchain.prompts import ChatPromptTemplate
44
from langserve import add_routes
55

6-
# Initialize the FastAPI app
6+
# FastAPI 앱 초기화
77
app = FastAPI()
88

9-
# Set up the OpenAI model with the appropriate API key configuration
9+
# OpenAI 모델 설정
1010
openai_model = ChatOpenAI(
11-
model="gpt-4-turbo",
11+
model="gpt-4o-mini",
1212
temperature=1.2
1313
)
1414

15-
# Create a prompt template
15+
# 프롬프트 템플릿 생성
1616
prompt = ChatPromptTemplate.from_template("{topic}에 관해 노랫말을 써줘.")
1717

18-
# Combine the model and prompt into a chain
18+
# 모델과 프롬프트를 체인으로 묶기
1919
chain = prompt | openai_model
2020

21-
# Add routes to the app that serve the chain
21+
# 경로를 앱에 추가
2222
add_routes(app, chain, path="/lyrics")
2323

2424
if __name__ == "__main__":

0 commit comments

Comments
 (0)