Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ static JsonSchema ofNullableType(String type) {
You are a product information extractor. Given the URL and the HTML of a product page,
extract information for the MAIN product of the page.

**Grounding rule (highest priority, applies to every field)**:
Every value you output MUST be taken from the provided HTML. If a value is not present
in the HTML, return null for that field (or isProductPage=false if the page shows no
product at all). NEVER invent, guess, or recall values from memory or from similar
products you have seen elsewhere. A fabricated value is the worst possible outcome —
strictly worse than null.

Comment on lines +59 to +65

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

currency 추론 규칙과의 충돌을 해소해야 합니다.

Line 59-65는 모든 출력값을 제공된 HTML에서만 가져오도록 요구합니다. 그러나 Line 86은 HTML에서 통화가 모호하면 페이지 언어 또는 locale로 currency를 추론하도록 허용합니다. 이 경우 모델이 HTML에 없는 통화 코드를 출력할 수 있습니다.

HTML에 통화 코드나 모호하지 않은 통화 표기가 없으면 null을 반환하도록 Line 86을 수정해야 합니다.

수정 예시
-            4. currency (string): ISO 4217 code (KRW, USD, JPY, EUR, etc.). Infer from page language/locale if ambiguous.
+            4. currency (string): ISO 4217 code only when the code or an unambiguous currency marker appears in the HTML. If the currency is absent or ambiguous, return null.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/depromeet/piki/extractor/extraction/gemini/GeminiExtractionRequest.java`
around lines 59 - 65, Update the currency guidance in the
GeminiExtractionRequest prompt so it follows the highest-priority grounding
rule: return null when the HTML lacks an explicit currency code or unambiguous
currency symbol, and remove any permission to infer currency from page language
or locale.

**Input**:
- URL: the product page URL
- HTML: raw HTML content of that page (may include <script type="application/ld+json"> JSON-LD,
Expand All @@ -79,6 +86,8 @@ static JsonSchema ofNullableType(String type) {
4. currency (string): ISO 4217 code (KRW, USD, JPY, EUR, etc.). Infer from page language/locale if ambiguous.
5. imageUrl (string): ABSOLUTE URL of the primary product image. Prefer og:image meta tag,
fallback to the main product image. Resolve relative URLs against the page URL.
The URL (or the relative path you resolve) must appear in the HTML — do not construct
or abbreviate image URLs. If no product image URL appears in the HTML, return null.

**Price rules**:
- Single price, no discount indicator → that price is currentPrice.
Expand Down
Loading