We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8aed1d4 commit 0c96e96Copy full SHA for 0c96e96
7_langchain/langserve_lyrics.py
@@ -3,22 +3,22 @@
3
from langchain.prompts import ChatPromptTemplate
4
from langserve import add_routes
5
6
-# Initialize the FastAPI app
+# FastAPI 앱 초기화
7
app = FastAPI()
8
9
-# Set up the OpenAI model with the appropriate API key configuration
+# OpenAI 모델 설정
10
openai_model = ChatOpenAI(
11
- model="gpt-4-turbo",
+ model="gpt-4o-mini",
12
temperature=1.2
13
)
14
15
-# Create a prompt template
+# 프롬프트 템플릿 생성
16
prompt = ChatPromptTemplate.from_template("{topic}에 관해 노랫말을 써줘.")
17
18
-# Combine the model and prompt into a chain
+# 모델과 프롬프트를 체인으로 묶기
19
chain = prompt | openai_model
20
21
-# Add routes to the app that serve the chain
+# 경로를 앱에 추가
22
add_routes(app, chain, path="/lyrics")
23
24
if __name__ == "__main__":
0 commit comments