Spaces:
Paused
Paused
add system prompt
Browse files
app.py
CHANGED
@@ -179,10 +179,14 @@ def rows_to_text(rows: list[list[str]]) -> str:
|
|
179 |
|
180 |
def get_summary(rows: list[list[str]]) -> str:
|
181 |
text = rows_to_text(rows)
|
182 |
-
prompt =
|
183 |
client = openai.Client(api_key=openai_api_key)
|
184 |
completion = client.chat.completions.create(
|
185 |
-
model="gpt-4o-mini",
|
|
|
|
|
|
|
|
|
186 |
)
|
187 |
summary = completion.choices[0].message.content
|
188 |
return summary
|
|
|
179 |
|
180 |
def get_summary(rows: list[list[str]]) -> str:
|
181 |
text = rows_to_text(rows)
|
182 |
+
prompt = text
|
183 |
client = openai.Client(api_key=openai_api_key)
|
184 |
completion = client.chat.completions.create(
|
185 |
+
model="gpt-4o-mini",
|
186 |
+
messages=[
|
187 |
+
{"role": "system", "content": system_prompt},
|
188 |
+
{"role": "user", "content": prompt},
|
189 |
+
],
|
190 |
)
|
191 |
summary = completion.choices[0].message.content
|
192 |
return summary
|