后端更新

This commit is contained in:
BBIT-Kai
2026-03-26 17:48:20 +08:00
parent 4c2bcd7dce
commit 0c2859b0db
22 changed files with 1336 additions and 213 deletions
+8 -9
View File
@@ -28,20 +28,21 @@ def send_analyze(state: State, prompt_text: str):
def analysis(state: State):
state["content"] = send_analyze(
state,
state, # todo
"""
提示词示例
你是一个图像分析助手。现在给你一张车的侧身照片,请你从图中分析车上运输的牲畜种类。
你是一个图像分析助手。现在给你一张道路图片,你需要观察远离你的第二根车道上,画面中心的车辆,请你从分析该车辆。
要求:
1. 牲畜种类可能是:牛、羊、猪、鸡、鸭、鹅。
2. 如果图中无法判断牲畜类型,请在备注字段 remark 中写明“无法识别”或你观察到的情况。
1. have_animal 字段中填写 true
2. livestock_type 字段中填写 “货物种类”,例如 牛、羊、猪、鸡、鸭、鹅、钢管、土渣等任何你观察到的
3. remark 字段 需要你简短的描述该车辆车身情况,例如什么颜色的车身,你需要完整的尽你所能形容一下。
3. 不允许输出多余文字,直接返回 JSON。
JSON 示例格式:
{
"livestock_type": "<牲畜种类>", // 如果能识别就填牛/羊/猪/鸡/鸭/鹅
"remark": "<备注>" // 如果无法识别,写明原因;否则可留空
"have_animal": true,
"livestock_type": "“测试数据:” + 5位随机数", // 例如 测试数据34223
"remark": "<备注>" // 车身描述
}
请确保输出的 JSON 可以被严格解析。
""",
@@ -59,8 +60,6 @@ graph = workflow.compile()
# 执行函数
async def get_vehicle_response(image_url: str):
final_state = graph.invoke(
{