Skip to content

Commit d2d5c8e

Browse files
committed
fix openai prompt for major events (lacking start time)
1 parent 212b098 commit d2d5c8e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

backend/services/openai_service.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ def extract_events_from_caption(
145145
{self._format_image_list_for_prompt(all_s3_urls) or []}
146146
147147
STRICT CONTENT POLICY:
148-
- ONLY extract an event if the post is clearly announcing or describing a real-world event with BOTH:
149-
* a specific date (e.g., "October 31", "Friday", "tomorrow")
150-
* AND a specific start time (e.g., "at 2pm", "from 10am-4pm", "noon", "evening").
151-
- DO NOT extract an event if there is no explicit mention of a start time. Do NOT default to midnight or any other time if none is given.
148+
- ONLY extract an event if the post is clearly announcing or describing a real-world event.
149+
- Ideally, the post should have BOTH a specific date AND a specific start time.
150+
- EXCEPTION: For major events (e.g., full-day, multi-day, overnight), you MAY extract the event even if a specific start time is not explicitly stated, provided there is a specific DATE or date range.
151+
- For these major events ONLY, if no time is given, you may default the start time to 00:00 (midnight) or a logical start time implied by the context.
152152
- DO NOT extract an event if:
153153
* The post is a meme, personal photo dump, or generic post with no time/place.
154154
* The post is inappropriate (nudity, explicit sexual content, or graphic violence).
155-
* There is no explicit mention of BOTH a date (e.g., "October 31", "Friday", "tomorrow") AND a time (e.g., "at 2pm", "from 10am-4pm", "noon", "evening") in the caption or image.
155+
* There is NO mention of a date at all.
156156
* The post only introduces people or some topic, UNLESS there is a clear call to attend or participate in an actual event (such as a meeting, workshop, performance, or competition).
157157
158158
If you determine that there is NO event in the post, return the JSON value: null (not an object, not an array, just the literal null). Otherwise, return an array of JSON objects with ALL of the following fields:
@@ -253,7 +253,6 @@ def extract_events_from_caption(
253253

254254
# Extract the JSON response
255255
response_text = response.choices[0].message.content.strip()
256-
logger.debug(f"OpenAI Raw Response: {response_text}")
257256

258257
# Try to parse the JSON response
259258
try:

0 commit comments

Comments
 (0)