q_a优化,提示词优化

This commit is contained in:
yujj128
2025-10-15 16:52:35 +08:00
parent 987db89d7d
commit 2b10826568
5 changed files with 108 additions and 16 deletions

View File

@@ -1,7 +1,8 @@
import logging
from typing import Optional
from orjson import orjson
logger = logging.getLogger(__name__)
keywords = {
# "gender":{"1":"男","2":"女"},
"person_status":{"1":"草稿","2":"审批中","3":"制卡中","4":"已入库","5":"停用"},
@@ -43,7 +44,8 @@ def extract_nested_json(text):
stack = []
start_index = -1
results = []
if not text:
logger.warning("extract_nested_json: text is empty")
for i, char in enumerate(text):
if char in '{[':
if not stack: # 记录起始位置