环境/版本适应py39

This commit is contained in:
LiangShiyun 2025-06-30 16:00:40 +08:00
parent 00bbd902b8
commit 4d95d727b4
24 changed files with 102 additions and 10 deletions

View File

@ -128,5 +128,16 @@
"embedding_max": null,
"original_prompt": "我的大腿有些酸痛请给出一些分布于腿的重点按摩穴位。在回答的最后将重点穴位罗列为方便python脚本读取的list形式['XX穴','XX穴', ...]"
}
},
"naive": {
"9cd9187dfd3550dc4cc70bc2ca314615": {
"return": "### 针对肩部不适的按摩穴位建议\n\n肩部不适通常是由于肌肉紧张、劳损或血液循环不良引起的。按摩相关穴位可以帮助放松肌肉、缓解疼痛、促进气血流通。以下是一些分布于肩部区域的重点穴位每个穴位都位于肩部或肩胛骨周围便于自我按摩。按摩时建议用拇指或食指以适中的力度以感到轻微酸胀感为宜按压或揉按每个穴位2-3分钟每天重复2-3次。避免用力过猛以免损伤组织如果疼痛持续或加重请及时就医。\n\n#### 重点穴位列表(附位置和按摩方法):\n1. **肩井穴 (Jianjing)** \n - **位置**:在肩部,大椎穴(第七颈椎棘突下)与肩峰(肩部最高点)连线的中点。 \n - **作用**:缓解肩颈酸痛、僵硬,改善肩部血液循环。 \n - **按摩方法**:用拇指垂直按压,或画小圈揉按。\n\n2. **肩髃穴 (Jianyu)** \n - **位置**:在肩部三角肌上,当手臂外展或向前平伸时,肩峰前下方的凹陷处。 \n - **作用**:舒缓肩臂疼痛、肩周炎,减轻运动后的疲劳。 \n - **按摩方法**:用食指指腹按压,配合手臂轻微活动以增强效果。\n\n3. **肩髎穴 (Jianliao)** \n - **位置**:在肩部,肩髃穴后方,当手臂外展时,肩峰后下方的凹陷处。 \n - **作用**:针对肩关节周围疼痛,改善肩部活动受限。 \n - **按摩方法**:用拇指按压,可向肩胛骨方向推揉。\n\n4. **天宗穴 (Tianzong)** \n - **位置**:在肩胛骨冈下窝中央凹陷处,约在肩胛骨中点下方。 \n - **作用**:缓解肩背疼痛、僵硬,尤其适合久坐或伏案工作后的不适。 \n - **按摩方法**:坐姿时,用对侧手的拇指深压,或借助按摩工具滚动。\n\n5. **曲垣穴 (Quyuan)** \n - **位置**:在肩胛骨冈上窝内侧端,约在肩胛骨内侧缘上方。 \n - **作用**:减轻肩胛区酸痛,改善肩部柔韧性。 \n - **按摩方法**:用指尖按压,配合深呼吸以放松。\n\n6. **秉风穴 (Bingfeng)** \n - **位置**:在肩胛骨冈上窝中点,约在肩胛冈上方中央。 \n - **作用**:缓解肩背疲劳和酸痛,促进气血运行。 \n - **按摩方法**:用拇指或肘部轻柔按压,可结合热敷。\n\n7. **巨骨穴 (Jugu)** \n - **位置**:在肩上部,锁骨肩峰端与肩胛冈之间的凹陷处。 \n - **作用**:舒缓肩臂疼痛和紧张,尤其适合肩峰区域的劳损。 \n - **按摩方法**:用食指和中指并拢按压,力度适中。\n\n#### 按摩小贴士:\n- **最佳时间**:工作后或睡前按摩,效果更佳。\n- **增强效果**按摩前可热敷肩部5分钟如用热毛巾以放松肌肉。\n- **注意事项**:孕妇、皮肤损伤或炎症者慎用;如果按摩后不适无改善,建议咨询专业医师。\n\n### 方便Python脚本读取的穴位列表\n以下是上述重点穴位的名称以Python列表形式呈现便于您直接复制到脚本中使用例如用于生成提醒或数据分析\n```python\n['肩井穴', '肩髃穴', '肩髎穴', '天宗穴', '曲垣穴', '秉风穴', '巨骨穴']\n```\n您可以在Python中直接使用这个列表例如\n```python\nshoulder_acupoints = ['肩井穴', '肩髃穴', '肩髎穴', '天宗穴', '曲垣穴', '秉风穴', '巨骨穴']\nprint(\"建议按摩穴位:\", shoulder_acupoints)\n```\n这样就能轻松集成到您的自动化脚本中。希望您的肩部不适早日缓解",
"cache_type": "query",
"embedding": null,
"embedding_shape": null,
"embedding_min": null,
"embedding_max": null,
"original_prompt": "我昨天工作完肩部有点不舒服请给出一些分布于肩部的重点按摩穴位。在回答的最后将重点穴位罗列为方便python脚本读取的list形式['XX穴','XX穴', ...]"
}
}
}

Binary file not shown.

View File

@ -2,12 +2,12 @@ from dataclasses import dataclass
import os
from typing import Any, Union, final
from lightrag.base import (
from ..base import (
DocProcessingStatus,
DocStatus,
DocStatusStorage,
)
from lightrag.utils import (
from ..utils import (
load_json,
logger,
write_json,

View File

@ -1,10 +1,9 @@
import asyncio
import os
from typing import Any, final
from typing import Any, final, List,Dict,Tuple,Union
from dataclasses import dataclass
import numpy as np
import time
from ..utils import (
logger,
compute_mdhash_id,
@ -77,7 +76,7 @@ class NanoVectorDBStorage(BaseVectorStorage):
return self._client
async def upsert(self, data: dict[str, dict[str, Any]]) -> None:
async def upsert(self, data: Dict[str, Dict[str, Any]]) -> None:
"""
Importance notes:
1. Changes will be persisted to disk during the next index_done_callback
@ -122,8 +121,8 @@ class NanoVectorDBStorage(BaseVectorStorage):
)
async def query(
self, query: str, top_k: int, ids: list[str] | None = None
) -> list[dict[str, Any]]:
self, query: str, top_k: int, ids: Union[List[str],None]= None
) -> List[Dict[str, Any]]:
# Execute embedding outside of lock to avoid improve cocurrent
embedding = await self.embedding_func(
[query], _priority=5
@ -259,7 +258,7 @@ class NanoVectorDBStorage(BaseVectorStorage):
return True # Return success
async def get_by_id(self, id: str) -> dict[str, Any] | None:
async def get_by_id(self, id: str) -> Union[Dict[str, Any],None]:
"""Get vector data by its ID
Args:
@ -279,7 +278,7 @@ class NanoVectorDBStorage(BaseVectorStorage):
}
return None
async def get_by_ids(self, ids: list[str]) -> list[dict[str, Any]]:
async def get_by_ids(self, ids: List[str]) -> List[Dict[str, Any]]:
"""Get multiple vector data by their IDs
Args:
@ -302,7 +301,7 @@ class NanoVectorDBStorage(BaseVectorStorage):
for dp in results
]
async def drop(self) -> dict[str, str]:
async def drop(self) -> Dict[str, str]:
"""Drop all vector data from storage and clean up resources
This method will:

View File

@ -0,0 +1,82 @@
{
"shoulder-thermotherapy-1751270415": {
"body_part": "shoulder",
"can_delete": true,
"choose_task": "thermotherapy",
"introduction": "shoulder-AI诊断理疗方案",
"task_plan": [
{
"start_point": "秉风左",
"end_point": "附分左",
"time": null,
"path": "line"
},
{
"start_point": "附分左",
"end_point": "魄户左",
"time": null,
"path": "line"
},
{
"start_point": "魄户左",
"end_point": "天宗左",
"time": null,
"path": "line"
},
{
"start_point": "天宗左",
"end_point": "魄户左",
"time": null,
"path": "line"
},
{
"start_point": "魄户左",
"end_point": "附分左",
"time": null,
"path": "line"
},
{
"start_point": "附分左",
"end_point": "曲垣左",
"time": null,
"path": "line"
},
{
"start_point": "秉风右",
"end_point": "附分右",
"time": null,
"path": "line"
},
{
"start_point": "附分右",
"end_point": "魄户右",
"time": null,
"path": "line"
},
{
"start_point": "魄户右",
"end_point": "天宗右",
"time": null,
"path": "line"
},
{
"start_point": "天宗右",
"end_point": "魄户右",
"time": null,
"path": "line"
},
{
"start_point": "魄户右",
"end_point": "附分右",
"time": null,
"path": "line"
},
{
"start_point": "附分右",
"end_point": "曲垣右",
"time": null,
"path": "line"
}
]
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.