fix: replace sommelier role with OCR system role to prevent brand name hallucination

- Rewrote prompt: 'ソムリエ' role -> pure OCR system role
- Explicit prohibition on brand name completion/correction
  (e.g. label shows 東魁 -> output 東魁, never 東魁盛)
- prefecture: output null if not written on label; inference from brand knowledge forbidden
- tasteStats: default to mid-value 3 instead of 'reasonable estimate' (was encouraging hallucination)
- Added concrete examples for white-deer, kubota, tokai cases
- Bumped version 1.0.35+42 -> 1.0.36+43

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ponshu Developer 2026-04-15 13:53:47 +09:00
parent cb152ef78a
commit 3643ab7690
2 changed files with 26 additions and 20 deletions

View File

@ -23,25 +23,36 @@ class GeminiService {
Future<SakeAnalysisResult> analyzeSakeLabel(List<String> imagePaths, {bool forceRefresh = false}) async {
//
const prompt = '''
: "name"
: 鹿鹿
OCR
使
---
## nameとbrandの絶対ルール
-
- : name
- 鹿鹿鹿
- 寿
-
JSON形式で情報を返してください
## prefectureのルール
-
- null
## descriptiontasteStatsflavorTagsのルール
- type
- nameで読み取った銘柄名の
- tasteStatsは153使
##
JSONのみ返す:
{
"name": "ラベルに書かれた銘柄名をそのまま(変更・補完禁止)",
"brand": "ラベルに書かれた蔵元名をそのまま(変更・補完禁止)",
"prefecture": "都道府県名",
"type": "特定名称(純米大吟醸など)",
"description": "味や特徴の魅力的な説明文(100文字程度)",
"catchCopy": "短いキャッチコピー(20文字以内)",
"name": "ラベルに写っている銘柄名の文字(一字一句そのまま",
"brand": "ラベルに写っている蔵元名の文字(一字一句そのまま",
"prefecture": "ラベルに書かれた都道府県名なければnull",
"type": "特定名称(ラベルから読む。なければnull",
"description": "ラベルの情報とtypeから推定した説明文100文字程度",
"catchCopy": "20文字以内のキャッチコピー",
"confidenceScore": 80,
"flavorTags": ["フルーティー", "辛口", "華やか"],
"flavorTags": ["フルーティー", "辛口"],
"tasteStats": {"aroma":3,"sweetness":3,"acidity":3,"bitterness":3,"body":3},
"alcoholContent": 15.0,
"polishingRatio": 50,
@ -50,11 +61,6 @@ class GeminiService {
"yeast": "きょうかい9号",
"manufacturingYearMonth": "2023.10"
}
:
- "name""brand"
- tasteStatsは必ず15
- null
''';
return _callProxyApi(

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.35+42
version: 1.0.36+43
environment:
sdk: ^3.10.1