Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -179,7 +179,8 @@ def respond_o1mini_qna(
|
|
179 |
):
|
180 |
"""
|
181 |
o1-mini 모델을 이용해 한 번의 질문(question)에 대한 답변을 반환하는 함수.
|
182 |
-
o1-mini에서는
|
|
|
183 |
"""
|
184 |
openai_token = os.getenv("OPENAI_TOKEN")
|
185 |
if not openai_token:
|
@@ -187,9 +188,10 @@ def respond_o1mini_qna(
|
|
187 |
|
188 |
openai.api_key = openai_token
|
189 |
|
|
|
|
|
190 |
messages = [
|
191 |
-
{"role": "
|
192 |
-
{"role": "user", "content": question}
|
193 |
]
|
194 |
|
195 |
try:
|
|
|
179 |
):
|
180 |
"""
|
181 |
o1-mini 모델을 이용해 한 번의 질문(question)에 대한 답변을 반환하는 함수.
|
182 |
+
o1-mini에서는 'system' 역할 메시지를 지원하지 않으므로,
|
183 |
+
system_message와 question을 하나의 'user' 메시지로 합쳐 전달합니다.
|
184 |
"""
|
185 |
openai_token = os.getenv("OPENAI_TOKEN")
|
186 |
if not openai_token:
|
|
|
188 |
|
189 |
openai.api_key = openai_token
|
190 |
|
191 |
+
# system_message와 question을 하나의 메시지로 합침
|
192 |
+
combined_message = f"{system_message}\n\n{question}"
|
193 |
messages = [
|
194 |
+
{"role": "user", "content": combined_message}
|
|
|
195 |
]
|
196 |
|
197 |
try:
|