feat: RAG에 성분/용도 정보 추가
This commit is contained in:
parent
d612563580
commit
c022ee21d0
@ -2708,7 +2708,10 @@ def _get_animal_drug_rag(apc_codes):
|
|||||||
llm_pharm->>'체중/부위' as dosage_weight,
|
llm_pharm->>'체중/부위' as dosage_weight,
|
||||||
llm_pharm->>'기간/용법' as usage_period,
|
llm_pharm->>'기간/용법' as usage_period,
|
||||||
llm_pharm->>'월령금기' as age_restriction,
|
llm_pharm->>'월령금기' as age_restriction,
|
||||||
llm_pharm->>'반려인주의' as owner_caution
|
llm_pharm->>'반려인주의' as owner_caution,
|
||||||
|
llm_pharm->>'주성분' as main_ingredient_detail,
|
||||||
|
llm_pharm->>'LLM설명' as description,
|
||||||
|
llm_pharm->>'어떤질병에사용하나요?' as usage_for
|
||||||
FROM apc
|
FROM apc
|
||||||
WHERE apc IN ({placeholders})
|
WHERE apc IN ({placeholders})
|
||||||
"""))
|
"""))
|
||||||
@ -2721,7 +2724,10 @@ def _get_animal_drug_rag(apc_codes):
|
|||||||
'dosage_weight': row.dosage_weight or '',
|
'dosage_weight': row.dosage_weight or '',
|
||||||
'usage_period': row.usage_period or '',
|
'usage_period': row.usage_period or '',
|
||||||
'age_restriction': row.age_restriction or '',
|
'age_restriction': row.age_restriction or '',
|
||||||
'owner_caution': row.owner_caution or ''
|
'owner_caution': row.owner_caution or '',
|
||||||
|
'main_ingredient': row.main_ingredient_detail or row.main_ingredient or '',
|
||||||
|
'description': row.description or '',
|
||||||
|
'usage_for': row.usage_for or ''
|
||||||
}
|
}
|
||||||
return rag_data
|
return rag_data
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -2830,6 +2836,10 @@ def api_animal_chat():
|
|||||||
details = []
|
details = []
|
||||||
if info.get('target_animals'):
|
if info.get('target_animals'):
|
||||||
details.append(f"대상: {info['target_animals']}")
|
details.append(f"대상: {info['target_animals']}")
|
||||||
|
if info.get('main_ingredient'):
|
||||||
|
details.append(f"성분: {info['main_ingredient']}")
|
||||||
|
if info.get('usage_for'):
|
||||||
|
details.append(f"용도: {info['usage_for']}")
|
||||||
if info.get('dosage_weight'):
|
if info.get('dosage_weight'):
|
||||||
details.append(f"용량: {info['dosage_weight']}")
|
details.append(f"용량: {info['dosage_weight']}")
|
||||||
if info.get('age_restriction'):
|
if info.get('age_restriction'):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user